浏览代码

Stop reusing one fact name for two deprecation checks

The `matrix_redis_` -> `redis_` check and the `redis_` -> `valkey_`
check both stored their matches in
`matrix_playbook_migration_redis_migration_vars`.

Facts persist for the whole play, so the second check was silently
overwriting the first one's value. Nothing reads these facts outside the
block that sets them, so this was harmless in practice, but it breaks as
soon as anyone reorders the checks, reads a fact later on, or disables
one of the two checks and expects the other's value to still be around.

Name the second one after its own check, like every other check here
does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pull/5494/head
Slavi Pantaleev 2 周前
父节点
当前提交
6dbeb9418a
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      roles/custom/matrix_playbook_migration/tasks/validate_config.yml

+ 3
- 3
roles/custom/matrix_playbook_migration/tasks/validate_config.yml 查看文件

@@ -270,7 +270,7 @@
- when: matrix_playbook_migration_redis_valkey_migration_validation_enabled | bool
block:
- ansible.builtin.set_fact:
matrix_playbook_migration_redis_migration_vars: |-
matrix_playbook_migration_redis_valkey_migration_vars: |-
{{ lookup('ansible.builtin.varnames', '^redis_.+', wantlist=True) }}

- name: (Deprecation) Catch and report redis variables
@@ -282,8 +282,8 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars | join(', ') }}
when: "matrix_playbook_migration_redis_migration_vars | length > 0"
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_valkey_migration_vars | join(', ') }}
when: "matrix_playbook_migration_redis_valkey_migration_vars | length > 0"

- when: matrix_playbook_migration_keydb_valkey_migration_validation_enabled | bool
block:


正在加载...
取消
保存