Repository navigation
fix(lint): use repo-root-relative path in git restore call in container_configs - #4301
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
@copilot resolve the merge conflicts in this pull request |
mashehu
left a comment
There was a problem hiding this comment.
please add a test to tests/pipelines/lint/test_container_configs.py to test this scenario.
Codecov Report✅ All modified and coverable lines are covered by tests.
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
nice fix! I guess the PR title needs to be updated. We actually have a similar logic already in files_unchanged.py, where we use filecmp.cmp(). |
|
This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful. |
3f59ea5 to
974a0fd
Compare
|
went back to an in-memory only checking of differences. These files are not in the template, so it is different than what |
|
@nf-core-bot changelog |
…figs.py Agent-Logs-Url: https://github.com/nf-core/tools/sessions/1d9f4c7e-f5d1-42ae-9baa-8e581e139ebb Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com> # Conflicts: # nf_core/pipelines/lint/container_configs.py
…configs lint The old approach used repo.index.diff(None) to detect stale configs, which compared the working tree against HEAD. This caused false 'out of date' failures when configs were already regenerated (e.g. by modules update) but not yet committed. The new approach: 1. Snapshots file content on disk before generation 2. Generates new configs 3. Compares new content to the snapshot 4. If unchanged → pass; if different → fail This makes the lint correct regardless of the git commit state. The restore logic now simply writes back the saved content instead of using git restore, which also fixes the original repo-root-relative path bug. Also adds two new tests: - test_container_configs_uncommitted_but_correct_passes: verifies that uncommitted but correct configs don't produce false failures - test_container_configs_working_tree_restored_after_lint: verifies the working tree is properly restored after lint Agent-Logs-Url: https://github.com/nf-core/tools/sessions/e3bf8950-f65b-4a3d-9b94-e3a275b359eb Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nf-core/tools/sessions/e3bf8950-f65b-4a3d-9b94-e3a275b359eb Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nf-core/tools/sessions/f898f098-3f2a-4e3f-8bbd-2fe45e5fed00 Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nf-core/tools/sessions/0c47257c-1ebc-4639-95c8-377dc2159244 Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nf-core/tools/sessions/660f217b-3360-4cc5-8f61-35616aadd65e Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
Sorry for the back and forth
923d492 to
465ec20
Compare
Co-authored-by: JulianFlesch <julian.flesch@qbic.uni-tuebingen.de>
Completed Fixes for container_configs lint
Fixes Implemented
I think this is the right thing to do, even if you do not need testing of older releases. It just did not come up because your container configs were always update during checkout already and modules update did not change anything.
git restorewith relative pathsTests Added
test_container_configs_uncommitted_but_correct_passes: Key scenario where modules update regenerated configs without committingtest_container_configs_working_tree_restored_after_lint: Verifies working tree restorationtest_container_configs_restore_with_relative_wf_path: Verifies relative path handlingPR Status
copilot/fix-container-configs-buggit restorecall incontainer_configs#4301