Add onboarding pre-flight to changelog validate - #4024
Open
Mpdreamz wants to merge 1 commit into
Open
Conversation
validate-entries now fails fast when the calling repository is not registered in products.yml or all matching products have release notes disabled — before any file discovery or GitHub API calls. Gate.Onboarding is written to the decision metadata so the comment service renders a copy-pasteable products.yml snippet pointing the repo owner at the self-serve path. Co-Authored-By: Claude <noreply@anthropic.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.
changelog validatenow fails fast before any file discovery when the calling repository is not registered inproducts.yml, posting a copy-pasteable YAML snippet so the repo owner can self-serve the fix.Affects:
changelog validatecommand, PR comment body,GithubDecisionMetadataPrompt summary: Part of the multi-PR plan to fix
changelog gh-releasecrashing on empty repo and model the one-repo-to-many-products relationship. This PR (4 of 5) adds the onboarding pre-flight gate so unregistered repositories get a blocking but actionable PR comment instead of a misleading error deep in file validation.Why
A repository that runs
release-notes.ymlbut is not registered inproducts.ymlwould previously fail deep in file discovery with an unhelpful error — or succeed silently when there happened to be no changelog files. Failing before any file or GitHub API work, with a message that includes the exact YAML to add, makes the fix self-serve.What
Pre-flight check in
validate-entriesChangelogEntryValidationService.ValidateEntriesnow callsGetProductsByRepositoryName(input.Repo)before label resolution and file discovery. Empty result → error +ValidationGate.Onboardingmetadata +return false. All matching products withReleaseNotes == None→ same.New
ValidationGate.OnboardingandRenderRepositoryNotOnboardedGithubDecisionMetadata.ValidationGategains theOnboardingvariant.ChangelogCommentRenderer.RenderRepositoryNotOnboardedrenders a copy-pasteableproducts.ymlsnippet with a link to the catalog reference doc.ChangelogGithubCommentService.SelectBodydispatches onGate.Onboardingbefore any other gate.WriteMetadataAsyncgate parameterThe private helper gains an optional
gateparameter (defaulting toValidationGate.Entries) so the pre-flight can writeOnboardingwithout duplicating the entire metadata construction.Verify
Stack: 4 of 5, on top of #4023