Repository navigation
PR updates stay true: description, risk, own review, generated types, e2e skips, content notes, questions, ticket comments - #353
Merged
Conversation
… skips, content notes, questions and ticket comments A new-feature PR that CoderHelm updated over several runs kept describing its first state, called a change to a shared query Low risk, left its own review saying the same, shipped without regenerated types, had an e2e test that skipped when content was missing, told editors to add a CMS block that staging already had, repeated one question on every update and posted the same ticket comment twice. - Fix rounds on an open PR rewrite its description from the whole diff; older review-fix rounds keep only their headline, so a failed suite of an earlier commit is not left in it. - The Risk level follows from the diff (shared files, a network call per page render, the reviewer's hard rules) and is raised with its reasons when the writer states less. - A silent review of a new commit replaces the body of CoderHelm's standing review, and threads the commit settled are resolved either way. - The generators gate checks that new schema types are in the generated output and that no file declares a parallel copy; review fix rounds run the same check; Sanity typegen settings in sanity.cli are read. - The feature checklist fails an e2e spec that skips on missing content. - Content notes look up blocks already on staging and name the one to replace, or say they could not look. - Questions are judged against the ticket text and comments, asked once per ticket, and ticket notices are posted once (edited in place on GitHub).
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 new-feature pull request that CoderHelm opened and then updated over several runs went wrong in eight ways: the description kept describing the first commit, the Risk was "Low" for a change to a query every page uses, CoderHelm's own review repeated the old claims, the generated types were never regenerated, the new end-to-end test skipped itself when staging content was missing, the content note told editors to add a block that staging already had in an older shape, one question was asked on every update, and the same ticket comment was posted twice. Each is fixed in the code that writes or checks that part, with a test.
Changes
1. Description rewritten from the final diff on every update
passes/resume.rs: a CI, security or review fix round that lands commits now callspr::refresh_description. Before, only the feedback path did, so later commits left the first description in place.passes/pr.rs(refresh_description): the rewrite is told to rebuild Changes from this diff and drop statements about an earlier version, to set Risk from the diff, and to keep in Verification only the commands whose results the description shows for the current commit.passes/review_fix/evidence.rs: only the newest review fix round keeps its check results. Older rounds keep one headline line, so a "Full test suite FAILED" from an earlier commit no longer stays in the description.2. Risk follows from the diff (new
passes/pr_risk.rs)floorreads the diff and sets the lowest level the description may state. These raise it: a file every page or request goes through (a shared query or fragment, a layout, middleware, global config, or a file the code graph shows 8 or more files importing), a network call added where pages render, and the reviewer's hard rules (migration, auth, payments). A shared file plus a new call per render is High.enforceraises a lower stated level and puts the reasons, with the files, first in the Risk section. It never lowers a level. Both the first writer and the refresh use it. The writer's template now offers High, and the writer is told the floor.3. CoderHelm's own review doesn't keep stale claims
passes/review_verdict.rs: when a finished review of a new commit posts nothing (same verdict, CoderHelm's own push),refresh_standingreplaces the body of CoderHelm's standing review with the new review, under an "Updated for<sha>" line. The body is edited in place, so nobody gets a new notification.GitHubClient::update_pr_reviewis added to the review endpoints only this module may call.passes/review_pr.rs: threads the new commit settled are resolved whether or not a review was posted. Before, they were resolved only when one was.4. Generated types: why the gate missed it, and the new check
Reading
generators::gatefrom #331 turned up four holes:The fixes, in
passes/generators.rs:ownership_problems: for each type the change adds to a generator's inputs (SanitydefineType, GraphQLtype/input/enum, Prismamodel, protobufmessage), the generated output must contain it, and no source file may declare a paralleltype/interfacefor it (GalleryPropsfor the generatedGallery). A type built from the generated one, such asGallery & {…}, is allowed. This runs in every gate pass and goes to the existing fix round.sanity.cli.*(typegen.generates,typegen.path) are read, so the output path is right in newer setups.passes/review_fix/mod.rs: review fix rounds get the same check as a step (generated_step), run on the staged files. It reports a finding first, then holds the push.5. End-to-end tests can't pass by skipping (
passes/feature/checklist.rs,feature/mod.rs)data_skipsfindstest.skip,fixme,it.skip,this.skip()and similar calls that a new or changed spec adds. Skips whose condition names a browser or platform (browserName,process.platform,isMobile, a project name) are allowed.6. Content notes check what is already there
passes/feature/content.rs: before the staging content note asks for a block, read-only queries look for blocks of that type, both inside the document fields that list it and as documents of their own. When one exists, the note says to replace or update that exact document and key, lists the fields to set and to remove, and gives the query that confirms the change. With no connection, the note says it couldn't look instead of guessing.passes/fix_location.rs: the planner's outside change has a newexistingfield, for what it looked up about existing content and what came back. A change that adds content with that field empty gets a "Not checked" line in the PR and on the ticket, saying to check first and update an existing one rather than add a second.7. Questions asked once; answered ones go
passes/resolved.rs(settled_on_ticket): the ticket's own text and people's comments on it now count as settled entries next to the answers.passes/plan.rsandfeature::open_questionscheck the decision's and the product questions against them every run, not only when answers exist. A question the ticket settles (for example "this replaces the earlier work") leaves the plan, the ticket comment and the PR description.passes/mod.rs(report_questions): each question is recorded on the ticket's record. A later run doesn't ask it again and never waits on it.8. One ticket comment per thing (
common/src/ticket_state.rs,passes/mod.rs)notice_text/notice_hashcompare notices with whitespace, emphasis, timestamps and run links taken out.notice_actiondecides between skip, edit and post.post_ticket_noticeposts "Also needed outside the code" and the questions through it. The same text is never posted again. New text edits the earlier GitHub comment (its id is now kept on the notice). Jira comments can't be edited here, so only changed text is posted there.Already covered before this PR:
refresh_descriptionon feedback pushes.This PR adds to those: the question check against the ticket text, the generator gaps above, two new checklist items, the content lookup, and description refresh on fix rounds.
Verification
cargo fmt --all --check: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace: 2,826 passed, 0 failed, 16 ignored (common 1,277, gateway 605 + 2, worker 942).pr_risk::tests(6)review_fix::evidence::tests::an_older_rounds_results_go_when_a_newer_round_landsgenerators::tests::a_new_schema_type_must_be_generated_and_imported,schema_languages_name_their_new_types,typegen_settings_in_the_sanity_cli_config_are_readreview_fix::tests::a_later_round_that_edits_a_schema_needs_the_generated_typeschecklist::tests::a_spec_that_skips_on_missing_content_fails_the_checklistcontent::tests::a_block_already_on_staging_is_replaced_not_addedfix_location::tests::a_note_that_adds_content_says_what_is_already_there_or_that_nobody_lookedreview_verdict::tests::a_silent_review_of_a_new_commit_replaces_the_old_reviews_claimsresolved::tests::the_ticket_text_and_people_comments_settle_questionsticket_notice_tests::a_question_is_asked_on_the_ticket_onceticket_state::tests::the_same_note_from_two_runs_minutes_apart_is_posted_onceNot done here: the refresh after a fix round doesn't rerun the questions check against new ticket comments. That happens on the next ticket run.