Sfoglia il codice sorgente

Simplify the synapse-usage-exporter git ownership fix

The recursive chown in front of the git task already guarantees that git
operates on a checkout owned by the user it becomes, so marking the path
as a safe.directory on top of that protects against nothing. Drop the
environment variables and condense the comment to a single line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pull/5483/head
Slavi Pantaleev 10 ore fa
parent
commit
118eb9019f
1 ha cambiato i file con 1 aggiunte e 9 eliminazioni
  1. +1
    -9
      roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml

+ 1
- 9
roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml Vedi File

@@ -43,11 +43,7 @@

- when: "matrix_synapse_usage_exporter_container_image_self_build | bool"
block:
# A repository left behind with different file ownership (e.g. cloned by another user in the past)
# would make the git update below fail, either with a permission error or with git's
# dubious-ownership protection kicking in (which manifests as a confusing
# "'origin' does not appear to be a git repository" error, because git ignores
# the repository's own configuration in that case).
# A checkout owned by a different user (a uid change, an earlier clone by another user, etc.) would make the git task below fail on ownership or permissions.
- name: Ensure synapse-usage-exporter repository ownership is correct on self-build
ansible.builtin.file:
path: "{{ matrix_synapse_usage_exporter_docker_src_files_path }}"
@@ -64,10 +60,6 @@
force: "yes"
become: true
become_user: "{{ matrix_user_name }}"
environment:
GIT_CONFIG_COUNT: "1"
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: "{{ matrix_synapse_usage_exporter_docker_src_files_path }}"
register: matrix_synapse_usage_exporter_git_pull_results

- name: Check if synapse-usage-exporter Docker image exists


Caricamento…
Annulla
Salva