Skip to content

🌱 test: make the event-triggers storage-failure case order independent - #15997

Merged
hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-event-triggers-test-order
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-event-triggers-test-order

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

TestEventTriggersRejectInvalidAndUnpersistedRules is order-dependent, and it is currently failing test (dashboard 3/4) / test (dashboard shuffle 3/3) on #15994 and #15984 β€” two PRs whose diffs do not touch it.

The test simulates a storage failure by pointing config.RuntimeConfigFile at an empty t.TempDir(). Config.saveLocked treats an unwritable runtime path as the root-created-file case: it removes the path and retries. Removing an empty directory succeeds, the retry succeeds, and the save is reported as persisted (PVC runtime config written … (recovered from permission error) in the failing logs), so the handler answers 200. Outside Kubernetes the overlay write is a no-op, so the expected 500 only appears when an earlier test in the same process leaves the overlay layer failing. Any PR that adds or removes pkg/dashboard tests re-slices the shards and flips the outcome.

What

Point the runtime and overlay paths at a file under a directory that does not exist, so the write, the remove and the retry all fail regardless of what ran before. Test-only; the remove-and-retry recovery in saveLocked is deliberate and unchanged.

Closes #15996

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

TestEventTriggersRejectInvalidAndUnpersistedRules pointed RuntimeConfigFile
at an empty temp directory. saveLocked removes an unwritable runtime path
and retries, so the retry succeeded and the save was reported persisted;
the 500 only appeared when an earlier test left the overlay layer failing.
Use a path under a missing directory so every layer fails deterministically.

Closes #15996

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@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

@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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

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.

PR Title Relation Files
#15977 ✨ feat: serve Matrix lines via authorized /api/matrix/lines and content-free code-lines SSE nudge CONFLICT src/pkg/dashboard/api_event_triggers_test.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 31, 2026
@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.

Read saveLocked at src/pkg/config/config.go:7323-7332 (head 7ff7399) alongside the test. The diagnosis holds: os.WriteFile on an empty directory fails with EISDIR, the best-effort os.Remove of that empty directory succeeds, and the retry then writes a regular file, so runtimeErr stays nil and the 500 depended on the overlay layer having been left failing by an earlier test. With the parent directory absent, the write, the remove and the retry all fail, and SourcePath = t.TempDir() still fails both the OpenFile and the WriteFile fallback, so saveLocked returns srcErr regardless of shard order.

filepath is already imported in the test file; no production code changes. Looks correct to me.

β€” 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.

Read the diff against saveLocked at src/pkg/config/config.go:7360-7372 on this head. The mechanism in the body checks out: os.WriteFile on an empty t.TempDir() fails, os.Remove(runtimePath) then succeeds on the empty directory, the retry WriteFile succeeds, runtimeErr stays nil, and outside Kubernetes overlayErr is also nil β€” so saveLocked returns nil at config.go:7395-7397 and the handler answers 200. A path under a missing parent fails the write, the remove and the retry, so runtimeErr is set and srcErr propagates. path/filepath is already imported (api_event_triggers_test.go:8). Looks correct to me.

One coordination note for the maintainer: #15999 (the adopted #15973) carries the same fix to the same two lines as an unrelated rider hunk (api_event_triggers_test.go:177-180 there, different variable and file names), which is why both PRs show conflicts-with-open-pr. The two are semantically identical; this PR is the dedicated one and should land first, and #15999's fix agent can drop its hunk on rebase. I have not changed anything on either PR.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Read the recovery path this test depends on; the fix is correct and complete.

  • src/pkg/config/config.go:7362-7367: os.WriteFile on an empty directory fails with EISDIR, os.Remove of that empty directory succeeds, and the retry WriteFile then succeeds β€” so the old t.TempDir() runtime path reported the save as persisted, exactly as the PR body says. With a file under a non-existent parent, write, remove and retry all fail with ENOENT, so runtimeErr stays set and saveLocked returns srcErr (config.go:7381-7394).
  • The overlay path is irrelevant outside Kubernetes (saveDashboardOverlay returns nil early, config.go:7532), so the runtime path is the decisive layer and this change alone makes the 500 deterministic regardless of shard order.

One coordination note: #15999 carries a semantically identical fix to the same lines (api_event_triggers_test.go:177-180) but with different filenames (runtime/overlay), so whichever lands second gets a trivial textual conflict rather than a no-op. This XS PR is the right one to land first; #15999 can drop its hunk on rebase.

Looks correct to me. I have not approved or closed anything.

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

hivecommons-hive Bot added a commit that referenced this pull request Oct 31, 2026
… card branch

The persistence-failure fixture repair is tracked separately in #15978
and #15997; restore the file to the v5 version so this branch only
carries the RFC summary-card change.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@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 merged commit 3353296 into v5 Oct 31, 2026
79 of 82 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-event-triggers-test-order branch October 31, 2026 09:11
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15997d7a2ffc` sha256:8de8865962892a459278637eaf64ce591ccac7c1872307e205b5f5558456c593 β€” download from the dashboard or `hivectl review evidence #15997`.

@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/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
hivecommons-hive Bot added a commit that referenced this pull request Oct 31, 2026
…rd (#15999)

* ✨ feat: render RFC notices as summary-card embeds when rfc_format: card

Render an RFC event as a Discord summary card (embed) when
rfc_format: card is configured on the designated announcer. Line mode
is unchanged.

- Add Body to github.IssueSnapshot and map it in rfcnotify.Issue.
- Parse RFC target, status, scrubbed summary, and decisions count in
  rfcnotify.ParseRFC.
- Render Discord embed with state-based color in rfcnotify.Card.
- Fall back to plain Format when the RFC body is malformed.
- Support SendEmbedTo and bounded 429 retries in pkg/discord.
- Adapt Sweeper to Publisher interface.

Hive-Run: #15927
Hive-Plan: summary-card-embeds
Hive-Spec: rfc-publishing#summary-cards
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

* πŸ› fix: repair RFC notify card tests, bot client transport and trigger persistence test

- Assign updated instead of since on fakeSource in card_test.go
- Guard redirectTransport against nil httptest.Server in newTestBot
- Provide statePath in TestRFCNotifyWire_CardFormatPostsEmbed to persist state across forcePoll
- Point trigger persistence test storage paths to uncreatable locations

Hive-Fix-Attempt: 1/6
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

* πŸ”’ fix: scrub Target, Status, and Related fields in RFC summary card

Apply logscrub.ScrubString to embed field values extracted from
contributor-controlled RFC tables and add TestCard_FieldScrubbing.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

* πŸ› fix: remove ineffectual assignment and unreachable type switch case

- Remove ineffectual newPoster assignment and unused discordRFCPoster in cmd/hive/rfcnotify_wire.go
- Remove unreachable Poster case in rfcnotify.toPublisher type switch

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

* πŸ› fix: preserve RFC card transitions and type publisher API

Send the formatted lifecycle event alongside cards so Discord and plain-poster fallbacks retain the transition, URL and linked RFC. Exclude checked numbered decisions, require Publisher at compile time, and cover lifecycle transitions in both publishing paths.

Drop the unrelated dashboard persistence test change as requested in review.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

* πŸ› test: make dashboard persistence failure fixture deterministic

CI at 146f530 fails TestEventTriggersRejectInvalidAndUnpersistedRules in both dashboard 2/4 and dashboard shuffle 2/3. Save removes the empty directory used as RuntimeConfigFile and retries successfully, returning HTTP 200 instead of the expected failure.

Use paths beneath a missing parent so persistence still fails after the remove-and-retry recovery. Keep this base-test repair separate from RFC card changes for review and bisectability. Related: #15978.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

* πŸ› fix: keep decision count under sub-headings, defuse embed links, tidy card post

Hive-Fix-Attempt: 1/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>

* test(dashboard): drop unrelated event-trigger fixture change from RFC card branch

The persistence-failure fixture repair is tracked separately in #15978
and #15997; restore the file to the v5 version so this branch only
carries the RFC summary-card change.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>

* refactor: single Publisher seam for RFC notices; use config label constants in card

Hive-Fix-Attempt: 2/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>

* fix: omit RFC card author icon for non-plain GitHub logins

Hive-Fix-Attempt: 3/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>

* 🌱 docs(rfcnotify): clarify card vs threads, simplify card helpers

Hive-Fix-Attempt: 4/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>

---------

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: thatguywob <thatguywob@users.noreply.github.com>
Co-authored-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 conflicts-with-open-pr Open PR has a merge conflict with another open PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] [shared-ci] test (dashboard 3/4) failing across hivecommons/hive

0 participants