alertmanager: add package documentation for contributors - #8720
Open
locker95 wants to merge 2 commits into
Open
Conversation
Adding a new Alertmanager configuration option requires coordinated changes across the AlertmanagerConfig CRD versions, the conversion and validation logic, the configuration generation and the operator's mirror of the upstream configuration types. This isn't obvious for new contributors and maintainers have to repeat the same explanations on issues. Document the involved files and the expected contribution flow as doc comments of the alertmanager package. Picks up the work started in prometheus-operator#6897, addressing the review comments. Fixes prometheus-operator#6429 Signed-off-by: Dean Chen <862469039@qq.com>
Author
|
Re-running the failed E2E tests (prometheusAllNS) job. This PR only adds |
Signed-off-by: Dean Chen <862469039@qq.com>
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.
Description
Adding a new Alertmanager configuration option requires coordinated changes across several places (both AlertmanagerConfig CRD versions, the conversion and validation logic, the config generation in
amcfg.go, and the operator's mirror of the upstream config types inpkg/alertmanager/types.go). This isn't obvious for new contributors and maintainers end up repeating the same explanations on issues (the motivation behind #6429).This PR documents the involved files, the generated assets to refresh with
make generate, the golden-file testing workflow and an example contribution flow, as doc comments of thepkg/alertmanagerpackage (rendered on pkg.go.dev and bygo doc).It picks up where #6897 left off (closed as stale): the review suggestions from that PR are applied, and two gaps are filled — the mirror types in
types.goused for strict parsing of the global configuration secret (the "static config" part of the original issue), and themake generate/ golden files workflow.Type of change
CHANGE(fix or feature that would cause existing functionality to not work as expected)FEATURE(non-breaking change which adds functionality)BUGFIX(non-breaking change which fixes an issue)ENHANCEMENT(non-breaking change which improves existing functionality)NONE(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
gofmt -l pkg/alertmanager/is clean andgo build ./pkg/alertmanager/passes.go test -short -count=1 ./pkg/alertmanager/...passes.go doc ./pkg/alertmanager(headings and lists parse correctly).Per the AI use policy: AI tooling assisted with drafting this documentation; the content was verified against the current code base and the review feedback of #6897 by the author.
Fixes #6429