fix(repo-settings): apply the unreadable guard to the topics probe too - #325
Merged
Merged
Conversation
RSRMID-2988 fixed this idiom in the secrets and variables probes and missed the topics one at line 187, which has exactly the same defect: on a 403 `gh api` exits non-zero *and* prints the error JSON to stdout, so `$(cmd || echo unknown)` captures that JSON with `unknown` appended, never equals `unknown`, and compare() reports drift with a JSON blob as the observed value instead of counting the row as unreadable. Topics happens to be readable on a public repository with the current token, which is why the run stayed clean and the bug stayed hidden — it would have surfaced the first time this ran against a repository or token where it was not. Brings this copy back in line with the template, where all three probes are fixed together under the same issue. RSRMID-2989
Collaborator
Author
|
🎉 This PR is included in version 33.0.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
One-line fix: the
topicsprobe never got the guard that RSRMID-2988 applied to thesecretsandvariablesprobes. Brings this copy back in line with the template, where all three are fixed together.Jira: RSRMID-2989
Type of change
fix) — releases a patchfeat) — releases a minorBREAKING CHANGE:in the commit body, plus a MIGRATION.md sectionci/build/chore/docs/test/refactor)Note the
fix(...)type is safe here:scripts/is notsrc/, so semantic-release will not cut a release from it.The defect
Same one fixed in the other two probes:
got_topics=$(gh api … 2>/dev/null || echo unknown)On a 403,
gh apiexits non-zero and writes the error JSON to stdout, so this captures the JSON withunknownappended. That never equalsunknown, socompare()'s unreadable guard misses and the row is reported as drift with a JSON blob as its observed value — rather than being counted as unreadable.Why it stayed hidden
topicshappens to be readable on a public repository with the current token, so the drift run stayed clean and the bug never showed. It would have surfaced the first time this ran against a repository or token where it wasn't — which is precisely the situation theunreadablecount exists to report honestly.I fixed two of the three probes under RSRMID-2988 and missed this one; it turned up while porting the fix upstream to the template.
Verification
shellcheck scripts/repo-settings.shat default severity — exit 0composer lint— exit 0pnpm repo:settings— stilldrift: 0 unreadable: 0 unconfigured: 0, topics row still reads correctlyChecklist
<type>(<scope>): <summary>with a scopecomposer lintruns locally and passes