Repository navigation
OVCS rc.49: readiness permission-label pre-flight and a plain 403 message (meta#15613) - #4679
Merged
Merged
Conversation
…(meta#15613) - harvest: `readiness_check` takes `preflight: true`, a read-only answer listing each election of either event the caller's permission labels don't reach (event, election, label, alias). It and the check's own refusal go through one function, so they can't disagree. The refusal is now a 403 with code `readiness-outside-permission-labels` naming the missing labels. - admin portal: the readiness dialog runs the pre-flight when the tested event is chosen, lists the unreachable elections with the label to grant, and disables Run check while any remain. A permission-label 403 says "You don't hold permission labels for: ..." and that nothing was recorded; other refusals before any write say so too. The "may have been lost after evidence was recorded" message is kept for network, 5xx and unreadable answers only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the
|
edulix
added a commit
that referenced
this pull request
Dec 3, 2026
…'s message (meta#15602) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Parent issue: https://github.com/sequentech/meta/issues/15613 (rc.49 tracker sequentech/meta#15576)
Problem
On ovcs-server, "Production readiness (signed)" returned a bare 403 "Election outside the user's permission labels" from harvest's
authorize_events, because TEST elections carried<LABEL>-TESTlabels the admin didn't hold. The dialog then said the response "may have been lost after evidence was recorded", but nothing had been recorded: the refusal happens before any lock or write.Changes
Pre-flight (harvest + admin portal)
readiness_checktakes an optionalpreflight: Boolean(added toactions.graphql; absent or null means the normal check). Withpreflight: trueit opens a read-only transaction, checks tenant, permission and event existence as usual, and returns{preflight: true, unreachable: [{event: official|tested, event_id, election_id, permission_label, external_id?, presentation?}]}. It never locks, compares or records anything.unreachable_elections, which usesauthorization::elections_outside_permission_labels. That is the ruleensure_elections_permittedapplies (from meta#15614), now public, so the two can't disagree.Wording
readiness-outside-permission-labels. Its message isElection outside the user's permission labels: ROME, ROME-TEST, naming the missing labels once each. The refusal is also logged throughwarn_label_refusal(meta#15614).services/readinessPreflight.ts::readinessFailuresorts failures into three kinds:Unauthorized,InvalidReadinessCheckorElectionEventNotFound, all refused before any write. Shows "The server refused the check before recording anything." plus the server's message.Status check. The read-only label status check is in sequentech/beyond (
sequent status), in a separate PR. It flags (a) elections whose label differs from their area's Post label and (b) events no single admin fully covers.Coordination
ovcsafter meta#15614 (OVCS rc.49: election-scoped log export checks only its election; name 403 refusals (meta#15614) #4677). That PR had added the same "unreachable elections" filter privately; this PR makes it public and reuses it instead of adding a second copy.gql/graphql.tsandgraphql.schema.jsonare not regenerated, as with the rehearsalcomparisonargument. The dialog types its variables inline.Tests
cargo test -p harvest --lib, dockercargo-packages):routes::readiness::tests::{a_label_refusal_is_a_403_naming_each_missing_label_once, the_preflight_answer_names_the_event_and_label_of_each_gap, preflight_is_opt_in_and_never_the_signed_check}andservices::authorization::permission_label_tests::the_preflight_lists_exactly_what_the_refusal_refuses.readiness_routesintegration tests, which need the test Postgres.src/services/readinessPreflight.test.ts: parsing, plus the 403 / refused / ambiguous choice.ReadinessCheckButton.test.tsx: new cases for the unreachable list blocking Run, a clean pre-flight allowing it, a failed pre-flight not blocking, the label-403 wording, and the refused-before-write wording. The existing cases are unchanged.tsc --noEmitreports nothing new in the touched files (only the pre-existing unbuilt@sequentech/ui-coreimport).🤖 Generated with Claude Code