fix(cli): regenerate pristine warn-only files - #877
Merged
Conversation
Warn-only shared files were always preserved, even when untouched, leaving stack-dependent Dockerfiles stale after htmx changes. Regenerate verified-pristine files while preserving and warning on customized files. Add add/remove and customization regressions.
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #870 by allowing “warn-only” shared files (notably Dockerfile) to be regenerated during stack changes when the on-disk file is still pristine (template-default), while continuing to preserve and warn on genuinely customized files. This aligns aegis add/remove htmx with the template’s conditional Dockerfile content so the project’s Docker build stays valid in both directions.
Changes:
- Update shared-file regeneration logic to rewrite
warnpolicy files when they are pristine, and only require manual merge when the file has diverged and the rendered content changed. - Add regression tests covering both directions of the
htmxtoggle (pristine Dockerfile regenerates) and the customized Dockerfile case (preserved + flagged for manual merge).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
aegis/core/manual_updater.py |
Regenerates warn-only shared files when pristine; otherwise preserves them and warns only if the new render differs. |
tests/cli/test_issue_870_warn_only_regeneration.py |
Adds regressions ensuring pristine warn-only Dockerfiles update with htmx add/remove while customized Dockerfiles remain untouched. |
Owner
|
Thanks for the PR/fix, will take a look shortly, @Sanjays2402! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #870
Pristine warn-only shared files now regenerate when the stack changes, so adding or removing htmx updates the Dockerfile. Customized Dockerfiles remain untouched and continue to require a manual merge.
Tested with the focused add/remove/customization regressions plus the manual-updater service and plugin tests (18 passed); changed-file Ruff checks also pass.