Repository navigation
π± chore(rfcnotify): add tests for card.go helper functions - #16014
Conversation
Adds direct unit tests for isRelatedKey and isTableHeaderOrSeparator to pin their behavior. The helpers are used by ParseRFC to identify RFC metadata fields and table structures. Tests cover all key predicate branches to ensure equivalence is maintained during any future refactoring. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible β a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me, and Closes #16006 is justified.
- The refactor #16006 asked for is already on
v5:src/pkg/rfcnotify/card.go:182-188(from #15999 as merged, c766074) hasisRelatedKeyask == "builds on" || k == "supersedes" || strings.HasPrefix(k, "related")andisTableHeaderOrSeparatoras a single returned expression. The issue's evidence link points at an earlier head (b6a3a55) that still had the redundant equality checks. So nothing in card.go is left to change; these tests pin the behaviour. - Checked every table row in
card_test.go:539-579against the two one-liners β all 17 expectations match (including"related-anything"via the prefix,"---"as key, and"---"as value).
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Looks correct to me. Tests-only change; every table row matches the helpers as they stand on the base branch:
isRelatedKey(src/pkg/rfcnotify/card.go:186-188) isk == "builds on" || k == "supersedes" || strings.HasPrefix(k, "related")β so"related rfcs","related-anything"β true and"status",""β false, as asserted.isTableHeaderOrSeparator(card.go:182-184) iskey == "field" || key == "key" || HasPrefix(key, "---") || HasPrefix(val, "---")β all seven rows agree.
Note for the maintainer on the Closes #16006 link: that issue asked for the redundant == "related" / "related rfcs" / "related rfc" checks and the if/return-true form to be simplified. Both simplifications are already present on the base at the lines above (this PR does not touch card.go), so pinning the behaviour with tests is what is left and closing the issue on merge is appropriate.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
CI triage β
Attempt 2 is already in progress; no code change needed. DEFER to the re-run. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
The only π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me. Read src/pkg/rfcnotify/card.go:182-188 at this head and on v5: the predicates #16006 called redundant are already in their reduced form (isRelatedKey is k == "builds on" || k == "supersedes" || strings.HasPrefix(k, "related"), and isTableHeaderOrSeparator returns the expression directly) β they landed that way in c766074 (#15999). So there is no cleanup left to do and this PR touching only card_test.go is the right shape; every table row I checked (including "related-anything" β true via the prefix, and "normal", "---" β true via the value prefix) matches the code. Closing #16006 with these tests is consistent with the issue's "cosmetic only" scope.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #16006
Adds direct unit tests for isRelatedKey and isTableHeaderOrSeparator to pin
their behavior. The helpers are used by ParseRFC to identify RFC metadata
fields and table structures. Tests cover all key predicate branches to ensure
equivalence is maintained during any future refactoring.
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88