feat: strategies decline with a status that names the rule that applied - #98
Merged
Merged
Conversation
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.
Closes #97.
A strategy's no-bump answer used to be one fixed status and reason per strategy, so it could say something false:
conventional-commitsreported a valid non-bumping commit (ci: ...,docs: ...) asno_conforming_commit, "No conforming Conventional Commits type found in commit message."branch-prefixreported a merge commit from an unmapped branch (Merge branch 'docs/typo' into main) asno_merge_commit, "Latest commit on default branch is not a merge commit."BumpStrategy.decidenow returnsBump | Decline(status, reason), so each rule names itself, and the use case turns aDeclineinto theNoBumpoutcome. Theno_bump_status/no_bump_reasonclass attributes are gone, and so isBump.NONE: a decline is now the only way to say "no bump", so a strategy can't return a value the version computation can't handle. The wirebumpfield still reads"none".no_conforming_commitminor_types/patch_typesno_bumping_type(new)patch_on_non_merge_commitoffno_merge_commitunmapped_branch_prefix(new)Decisions (from the triage grilling on #97):
schema_versionstays"1.0".action.ymlmaps every non-createdstatus tono-bump, so Action users see no change. A JSON consumer matchingno_conforming_commitorno_merge_commitexactly will see the new tokens for those inputs; 0.10.0's release notes will carry an Upgrading note.reasonsemvertag-controlled text (see the field audit pinned in test: pin RunResult's fields so a new one forces a redaction audit #92).CONTEXT.md(only status tokens frozen) and theno_tagsreason rewordings already shipped in feat: read v-prefixed tags and keep their prefix on the next tag #93 and feat: say how many tags were skipped when no_tags fires on a tagged repo #95.action.ymlnever readsreason. The ADR now says only status tokens are frozen andreasonis human-facing; the rest of its decision (renderings stay split) stands.CONTEXT.mdadds Decline and updates Strategy and Outcome to match.Also updated: both strategy pages name each decline status; the provider guides mention
unmapped_branch_prefix; the GitHub outputs table'sno-bumpdescription; and theaction.ymlcomment now says "any other status" instead of keeping a second copy of every token.Tests go through
decidefor each table row and throughSemvertagUseCase.__call__with a stub strategy returning aDecline(checked to fail with the mapping removed). ExistingBump.NONEassertions now assert the specific decline.Verified with
just lint-ci,just test-ci(500 passed, 100% coverage),just adr-checkandjust docs-build.