Repository navigation
Outside work is done by the run first; notes carry what is left, looked up, ordered and confirmable - #356
Merged
Conversation
…ooked up, ordered and confirmable A reviewer found an "Also needed outside the code" note that said it could not look up the CMS content while the CMS read API was public, told editors to add an item that was already there without describing it, put content before the studio deploy that makes the new fields exist, gave no exact values or confirm query, mixed up the project id and the dataset, and handed every step to a person. - The run does the work first. Each outside step is decided in order and recorded with who does it: the change itself (a migration in the repository's migrations folder, fixtures or end-to-end setup, config), then CoderHelm after the PR opens (starting the studio/staging deploy or end-to-end workflow by workflow_dispatch or its label, running the confirm query), then a person only for what is left, with why CoderHelm couldn't (the missing permission or connection, named) and how to grant it. Results (run links, query output) go into the note. - outside_work reads what the repository offers: the CMS project id and dataset from its config, .env files or codegen environment (so the public query endpoint is derived), its deploy and end-to-end workflows and package scripts, its migrations and fixtures folders. - The planner gets query_content, a read-only query on that endpoint, and the repository's options. Its note is checked in code and sent back when it says it couldn't look while a readable source exists, quotes no lookup, leaves found items undescribed or adds a second one, has no ordered steps with owners, puts content before the schema deploy, gives a person a step the change or CoderHelm could do, gives a person a step with no reason, has content without exact values or a minimum, has no confirm query, or labels an identifier wrongly. - The ticket note and the PR's Not in this PR section render from the same steps; after the PR opens the note is posted once with results (edited in place on GitHub) and the PR section is updated with them. - The plan check counts outside steps: a person's step with its reason is listed as not done; one with no reason is listed as not covered. - content.rs looks existing blocks up through the public read API without a write connection, sets the least content from the spec's own counts, and every blocked line says why CoderHelm didn't and how to grant it.
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.
Summary
A reviewer found an "Also needed outside the code" note with these problems:
Now the run does that work itself first. A person gets a step only when CoderHelm can't do it, and the note then says why and how to give CoderHelm that access. Code checks every note before it can go out. The ticket note and the PR's "Not in this PR" section are built from the same steps.
Changes
Decide who does each step, in code (
passes/outside_work.rs). Each step records who does it, checked in this order:this_pr: the change itself. For example a migration in the repo's migrations folder that replaces the existing item by key, fixtures or e2e setup that create their own content, or config.coderhelm: CoderHelm, after the PR opens. It starts the studio/staging deploy or e2e workflow (by workflow_dispatch, or by adding the label the workflow runs on) and runs the confirm query (perform). It reports the results: the run link and the query output.person: only what is left. The step must givewhy_person(the missing permission or connection, by name) andgrant(how to give CoderHelm that access next time).What the repository offers (
Abilities):.env*files (not production ones),sanity.config.*/sanity.cli.*(includingprocess.env.Xvalues) or the codegen environment. A staging dataset is preferred. The public query endpoint is derived from these.sanity deploypackage scripts.Planner (
plan.rs,fix_location.rs):query_content, a read-only GROQ query on the derived endpoint with no token. It is registered as Read in both tool registries.outside_changegainssteps,lookup,existing_items,confirmandnames.Note check, which sends the plan back (
outside_work::gaps,plan_gaps). A note goes back to the planner when it:why_personandgrant;values, or without theminimuman e2e test needs;confirm.e2e;A gap still open after one send-back goes on the decision's open gaps, so the ticket, the PR and the reviewer see it.
One source for the ticket and the PR:
push_changerenders the ticket note from the steps (note_markdown).not_in_pr_stepsuses the same lines (context_lines,pr_lines) for "Not in this PR".after_pr_outside_work). On GitHub the same notice is edited in place (the PR updates stay true: description, risk, own review, generated types, e2e skips, content notes, questions, ticket comments #353 dedup), and the PR's section is rewritten with the same results.Plan check (
plan_coverage::outside_findings). Every person step goes into Open items:A progress note gives both counts.
Staging content (
feature/content.rs):min_itemsreads the least content the spec needs from its own assertions (toHaveCount,toBeGreaterThan,.nth).Blockedwithwhy_personandgrant.E2e that skips: PR updates stay true: description, risk, own review, generated types, e2e skips, content notes, questions, ticket comments #353's checklist already fails a spec that skips on missing content, and its guidance says to fail with a message naming the missing content. Nothing changed there.
Verification
cargo fmt --all --check: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace: 1281 + 2 + 605 + 957 passed, 0 failed.outside_work::the_reviewed_note_goes_back_with_every_rule: the reviewed note gets every check: the public API, why a person, the startable deploy, the migrations folder, deploy as step 1, values, minimum, confirm and labels.a_lookup_that_found_items_needs_them_described_and_replaced: also checks the rendered note, that the PR uses the same lines, and that a failed lookup quotes its error.reads_the_cms_deploys_and_folders_from_the_repositoryeach_coderhelm_step_gets_its_actionthe_plan_check_counts_a_person_step_without_a_reason_as_not_coveredfix_location::the_ticket_note_and_the_pr_carry_the_same_stepsplan_coverage::an_outside_step_without_a_reason_is_not_coveredcontent::without_any_access_the_note_says_why_and_how_to_grant, plus the updated content tests.