Repository navigation
π± test: make the event-triggers storage-failure case order independent - #15997
Conversation
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>
|
[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
|
|
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.
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
There was a problem hiding this comment.
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
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Read the recovery path this test depends on; the fix is correct and complete.
One coordination note: #15999 carries a semantically identical fix to the same lines ( 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 |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
β¦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>
Why
TestEventTriggersRejectInvalidAndUnpersistedRulesis order-dependent, and it is currently failingtest (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.RuntimeConfigFileat an emptyt.TempDir().Config.saveLockedtreats 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 removespkg/dashboardtests 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
saveLockedis deliberate and unchanged.Closes #15996
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88