Bug #23959
closedWhen removing files from a technique, it might get disabled unexpectedly
Description
After a partial migration to 8.0rc, we had a an issue on technique editor techniques. They were migrated to yml, and the new file were committed, but the json file we only deleted on disk but not in the git repo. To fix the issue, we made a manual commit to remove the json files for the techniques, and it resulted in disabling all these techniques at the next automated technique reload.
This is due to a simplistic logic in technique changes reader, which does not check file names and only relies on change type (https://github.com/Normation/rudder/blob/6281da8a4c4cd0bd36587a5d4deb362e30c4ccc2/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/cfclerk/services/impl/GitTechniqueReader.scala#L279).
Hence a commit affecting a technique and containing only deletions is considered as a technique deletion, and results in disabling it, even if the deleted file is not the metadata or current policy file
Updated by Vincent MEMBRÉ about 2 months ago
- Status changed from New to In progress
- Assignee set to Vincent MEMBRÉ
Updated by Vincent MEMBRÉ about 2 months ago
- Status changed from In progress to Pending technical review
- Assignee changed from Vincent MEMBRÉ to François ARMAND
- Pull Request set to https://github.com/Normation/rudder/pull/5981
Updated by Anonymous about 2 months ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|87cf1d8daf9ea3def7129f2492c51f4f925465d8.
Updated by François ARMAND about 2 months ago
- Fix check changed from To do to Checked
Tested:
- create technique.json, add/commit
- rudder server reload-techniques
- rm technique.json, add/commit
- rudder server reload-techinques
The technique is correctly seen as updated, not deleted as before.
Updated by Vincent MEMBRÉ about 1 month ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 8.1.8 and 8.2.1 which were released today.