Skip to content

Feat | Add --include-helm-hooks flag - #500

Merged
dag-andersen merged 2 commits into
dag-andersen:mainfrom
lmbaschiera:feat/include-helm-hooks
Oct 17, 2026
Merged

dag-andersen merged 2 commits into
dag-andersen:mainfrom
lmbaschiera:feat/include-helm-hooks

Conversation

@lmbaschiera

Copy link
Copy Markdown
Contributor

Summary

Adds --include-helm-hooks (INCLUDE_HELM_HOOKS, default false). When set, resources annotated helm.sh/hook stay in the diff and in the --output-app-manifests / --output-branch-manifests files, exactly as Argo CD rendered them. Without the flag, output is unchanged.

  • Both render paths stop dropping hooks themselves (extract.getManifestsFromApp and reposerverextract.renderApp). cmd/main.go now removes them once after rendering, through a new extract.RemoveHelmHooks, unless the flag is set.
  • App-of-apps child discovery (--traverse-app-of-apps) still skips hook-annotated documents, so which child Applications get rendered doesn't depend on the flag.
  • Docs: new row in docs/options.md, new section in docs/output.md.

Fixes #499

Testing

  • go test ./cmd/... ./pkg/..., including a new TestRemoveHelmHooks
  • golangci-lint run on the changed packages: 0 issues
  • New integration case branch-2/target-1: the existing branch-2 data with --include-helm-hooks. The chart's helm.sh/hook: test Pod is renamed along with the Deployment and now appears in the diff.
  • TEST_CASE="branch-2/target" … -docker still passes against its existing golden output, which leaves that hook Pod out, so the default is unchanged.

lmbaschiera and others added 2 commits October 8, 2026 14:46
Helm hook resources were removed unconditionally inside both render paths.
Remove them once in main after rendering instead, unless --include-helm-hooks
is set, so the diff and the manifest outputs can include them. App-of-apps
child discovery keeps skipping hook documents.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dag-andersen

Copy link
Copy Markdown
Owner

@lmbaschiera Thank you so much for this PR! I think it's a great feature overall. I'll take a closer look over the weekend.

Sorry for the slow reply! I'll have more time to review PRs and add features after KubeCon in November!

@lmbaschiera

Copy link
Copy Markdown
Contributor Author

@dag-andersen - No worries at all! Really appreciate all the effort you pour into this project. Good luck in the KubeCon!

@dag-andersen dag-andersen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I ran the tests and everything seems to work as expected 🚀 Overall looks good 🥇 Thank you for the PR

@dag-andersen
dag-andersen merged commit 3c638a2 into dag-andersen:main Oct 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat | Option to keep Helm hook resources in the diff and manifest output

2 participants