Skip to content

fix(cli): regenerate pristine warn-only files - #877

Merged
lbedner merged 2 commits into
lbedner:mainfrom
Sanjays2402:fix/pristine-warn-only-files
Jul 20, 2026
Merged

fix(cli): regenerate pristine warn-only files#877
lbedner merged 2 commits into
lbedner:mainfrom
Sanjays2402:fix/pristine-warn-only-files

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI review requested due to automatic review settings July 19, 2026 20:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 warn policy 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 htmx toggle (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.

Comment thread aegis/core/manual_updater.py
@lbedner

lbedner commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR/fix, will take a look shortly, @Sanjays2402!

@lbedner lbedner added bug Something isn't working cli labels Jul 20, 2026
@lbedner
lbedner merged commit 91ac679 into lbedner:main Jul 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aegis add/remove htmx leaves the Dockerfile stale in both directions

3 participants