Skip to content

🌱 chore(rfcnotify): add tests for card.go helper functions - #16014

Merged
hivecommons-hive[bot] merged 6 commits into
v5from
scanner/fix-16006
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 6 commits into
v5from
scanner/fix-16006

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

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>
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible β€” a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking β€”
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly β€” that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) has isRelatedKey as k == "builds on" || k == "supersedes" || strings.HasPrefix(k, "related") and isTableHeaderOrSeparator as 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-579 against 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) is k == "builds on" || k == "supersedes" || strings.HasPrefix(k, "related") β€” so "related rfcs", "related-anything" β†’ true and "status", "" β†’ false, as asserted.
  • isTableHeaderOrSeparator (card.go:182-184) is key == "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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

CI triage β€” gosec (insecure patterns) (run 41198755355, attempt 1): infrastructure failure, not a code finding.

  • All setup steps (checkout, toolcache guard, setup-go, module download, Install gosec) completed success.
  • The Scan step has no conclusion β€” the runner was lost mid-scan. The step is continue-on-error: true, so a gosec finding could not have failed the job anyway.
  • The only code change in this PR is src/pkg/rfcnotify/card_test.go (pure table-driven tests, no exec/fs/crypto).

Attempt 2 is already in progress; no code change needed. DEFER to the re-run.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/stalled In its current stage longer than expected stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/stalled In its current stage longer than expected stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

The only gosec (insecure patterns) run at 465db8f failed because the self-hosted runner lost communication with the server (check-run 124538397043, 12:47Z, incident #16048) and never re-ran. Pushed a signed merge of v5 (46a49e9, no code change) to re-trigger CI. hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: e10cacf5

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 44d531b into v5 Oct 31, 2026
75 of 76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16006 branch October 31, 2026 20:44
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reviewer] Review backlog (style): Redundant predicates in card.go helpers

0 participants