Repository navigation
fix(gateway): release a merged plan task's own dependents via its ticket's plan link - #719
Conversation
nambok
left a comment
There was a problem hiding this comment.
lgtm, good catch. looking the task up by its own plan link instead of scanning for the first matching issue number fixes both jira runs (issue number 0) and the cross-repo #12 case. sharing github_link_sk/jira_link_sk between the worker and the gateway means they can't drift. merges clean with main.
one follow-up, not blocking: link_ticket_to_plan is best effort (a failed put just logs), so if that write fails, dependents now stall silently. could you fall back to the run record's plan_id and match by issue number + repo inside that one plan when no link exists? that also covers plans from before #335.
…ket's plan link After a pull request merged, the tasks waiting on its plan task were found by issue number alone: the first task row in any of the team's plans with the run's issue number. A Jira ticket's run records issue number 0, so a merged Jira task never released its own dependents and could release those of a task with no issue yet, in any plan. GitHub issue numbers repeat across repositories, so a merge in one repository could release the dependents of a task in another. The merged run's task is now found through its ticket's plan link, the settings row the plan wrote when it opened the ticket (repository and issue number, or Jira key), and issue number 0 never names a ticket. A merge whose ticket has no plan link releases nothing.
…w records The link from a ticket to its plan task is written best effort, and plans from before links existed have none. A merge on such a task released nothing, so its waiting tasks stayed waiting. Without a link, the merged run's task is now the task row that records the same ticket: the repository and issue number from the issue's URL, or the Jira key. Never issue number 0 and never a number alone. The search stays in the run's plan when the run names one, otherwise covers the team's plans, and a ticket that more than one task names releases nothing. The link is still looked up first.
4cc0294 to
5985ce8
Compare
|
The review's follow-up is included in 5985ce8. The fallback as suggested (use the run record's What's built instead: when there is no link, the merged run's ticket is matched against the plan task rows' own ticket fields, which the plan writes separately from the link. For GitHub that's the repository and issue number from Testing: 7 new unit tests in |
…#707) * Fill the Before and After table from the end-to-end run's screenshots CoderHelm's own pull request now shows the screenshots its end-to-end run already took, instead of "No screenshot". - common::e2e::shots reads the images Cucumber JSON embeds, Playwright JSON attaches and Playwright's HTML report keeps under data/, keyed by the test's id, and picks the test that shows the change: one the change edits, one the test map ties to the changed files, or one whose name shares a word with a changed UI file. - e2e_screens keeps that test's screenshot on the head and on the default branch's newest passing run in the install's own bucket, records it for the head and rebuilds the description. - The table links each image through the API with a signed link that works for a year (GET /webhooks/ci/tests/screenshot); the bucket keeps the images 395 days. * Say why a screenshot's test was picked, and pass clippy The reason names the test, not only its name (the match reads its title and file); an empty Before cell says no passing run on the base kept one rather than "yet"; the caption gives the reason before the run links. Formatted, and two iterator and one slice lint fixed. * no-mistakes(review): Claim head record, use PR base, align record TTL * no-mistakes(review): Upload screenshots before claiming the head record * no-mistakes(review): Detect lost claim race with the typed DynamoDB error * Format the screenshot fixes with cargo fmt * no-mistakes(review): Pick screenshot test against PR base, fetch PR once * no-mistakes(document): Format is_own_pr with cargo fmt * Fill the Before and After table from the end-to-end run's screenshots CoderHelm's own pull request now shows the screenshots its end-to-end run already took, instead of "No screenshot". - common::e2e::shots reads the images Cucumber JSON embeds, Playwright JSON attaches and Playwright's HTML report keeps under data/, keyed by the test's id, and picks the test that shows the change: one the change edits, one the test map ties to the changed files, or one whose name shares a word with a changed UI file. - e2e_screens keeps that test's screenshot on the head and on the default branch's newest passing run in the install's own bucket, records it for the head and rebuilds the description. - The table links each image through the API with a signed link that works for a year (GET /webhooks/ci/tests/screenshot); the bucket keeps the images 395 days. * Say why a screenshot's test was picked, and pass clippy The reason names the test, not only its name (the match reads its title and file); an empty Before cell says no passing run on the base kept one rather than "yet"; the caption gives the reason before the run links. Formatted, and two iterator and one slice lint fixed. * no-mistakes(review): Claim head record, use PR base, align record TTL * no-mistakes(review): Upload screenshots before claiming the head record * no-mistakes(review): Detect lost claim race with the typed DynamoDB error * Format the screenshot fixes with cargo fmt * no-mistakes(review): Pick screenshot test against PR base, fetch PR once * no-mistakes(document): Format is_own_pr with cargo fmt * Keep end-to-end screenshots on the screenshots ref, under the preview's pages Review asked for one hosting model and for the pair not to hide the preview's page captures. - The Before and After images are committed to refs/coderhelm/screenshots beside the preview's captures and linked by commit, so only people who can read the repository see them. The public screenshot route, its signed links, the bucket copies and their lifecycle rule are gone. - preview::keep_on_ref is the one way both write that ref: blobs, a commit on top of the ref, and a move without force (advance_own_ref), tried again on top when another writer moved it, so no writer's commit is dropped and no image link breaks. - The pair is its own fact (e2e_screens), rendered as a table under the preview's pages and never instead of them; it takes the place of a "No screenshot" line. The preview's pages now win over a set screens table. - An ingest reads the pull request only when it needs it: a failure on a branch that is not CoderHelm's shape, or a report that carries screenshots. CiReports gets the run's real attempt. * Pin the dashboard for the November 17 proof release (#770) * The changed tests run both ways: CI's install, a budget of their own, every runner read (#769) * A bug is reproduced on the base before it is planned; people's answers decide scope The planner runs the ticket's inputs through the base code (reproduce_on_base) and writes ## Reproduce: inputs with stored variants, the command and its output, the wrong line. The fix goes in that line's mechanism; questions a lookup answers are looked up first; a diff rewriting a path for a few named records goes back; new tests run on the base the way CI runs them, loops included, and an unproven bug fix says Unverified. A person's answer or comment moves an out-of-scope item in at seed and every round, and a revert of it is a breach. * The changed tests run both ways: CI's install, a budget of their own, every runner read Across the 53 most recent runs, none of the 17 with a test check ran a new test on the base and the head. Six failed the install: a pnpm workspace member was installed on its own (`cd apps/web && pnpm install --ignore-workspace --frozen-lockfile`), where pnpm stops with ERR_PNPM_NO_LOCKFILE. Seven ran out of time: the fresh step ran every other check first and reached the sandbox runs short again, with its one request spent. Two could not read a CI loop and listed fixtures as tests. - A workspace member installs from the workspace root (falling back to the member and its dependencies); the runs use CI's job for the test files, its install lines, Node and pnpm versions, through the cached environment. A failed install says why. - The sandbox runs are owed to a fresh step, which runs them before any other check and records them for the head; up to four asks a run. - One `test_env::narrow` for pytest, unittest, Vitest, Jest, go test and cargo test; package scripts and make targets read to their runner; a file's own package script as the narrow fallback; end-to-end specs and test data are not unit tests; one file without a command no longer stops the rest. - Whether the tests ran, and why not, is counted (`tests_ran`) on the run's checks, its notes and the pull request. Incident: tq_tests_run. * ci: bump the actions group across 1 directory with 8 updates (#313) Bumps the actions group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `4.4.0` | `7.0.1` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.2` | | [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.10.1` | `4.1.3` | | [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) | `2.4.0` | `4.2.2` | | [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `4.3.1` | `6.3.0` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4.3.0` | `8.0.2` | | [actions/setup-python](https://github.com/actions/setup-python) | `5.6.0` | `7.1.0` | | [actions/setup-node](https://github.com/actions/setup-node) | `4.4.0` | `7.1.0` | Updates `actions/checkout` from 4.4.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@11d5960...3d3c42e) Updates `actions/upload-artifact` from 4.6.2 to 7.0.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@ea165f8...cf430e0) Updates `sigstore/cosign-installer` from 3.10.1 to 4.1.3 - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](sigstore/cosign-installer@7e8b541...756fe2d) Updates `actions/attest-build-provenance` from 2.4.0 to 4.2.2 - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](actions/attest-build-provenance@e8998f9...4d10147) Updates `aws-actions/configure-aws-credentials` from 4.3.1 to 6.3.0 - [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases) - [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md) - [Commits](aws-actions/configure-aws-credentials@7474bc4...e125382) Updates `actions/download-artifact` from 4.3.0 to 8.0.2 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@d3f86a1...9000827) Updates `actions/setup-python` from 5.6.0 to 7.1.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@a26af69...6d4fd22) Updates `actions/setup-node` from 4.4.0 to 7.1.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@49933ea...949feb2) --- updated-dependencies: - dependency-name: actions/attest-build-provenance dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-node dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-python dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: aws-actions/configure-aws-credentials dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: sigstore/cosign-installer dependency-version: 4.1.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(gateway): release a merged plan task's own dependents via its ticket's plan link (#719) * A merged plan task releases its own dependents, found through its ticket's plan link After a pull request merged, the tasks waiting on its plan task were found by issue number alone: the first task row in any of the team's plans with the run's issue number. A Jira ticket's run records issue number 0, so a merged Jira task never released its own dependents and could release those of a task with no issue yet, in any plan. GitHub issue numbers repeat across repositories, so a merge in one repository could release the dependents of a task in another. The merged run's task is now found through its ticket's plan link, the settings row the plan wrote when it opened the ticket (repository and issue number, or Jira key), and issue number 0 never names a ticket. A merge whose ticket has no plan link releases nothing. * Without a plan link, a merged task is found by the ticket its task row records The link from a ticket to its plan task is written best effort, and plans from before links existed have none. A merge on such a task released nothing, so its waiting tasks stayed waiting. Without a link, the merged run's task is now the task row that records the same ticket: the repository and issue number from the issue's URL, or the Jira key. Never issue number 0 and never a number alone. The search stays in the run's plan when the run names one, otherwise covers the team's plans, and a ticket that more than one task names releases nothing. The link is still looked up first. --------- Co-authored-by: Shoyu <shoyu@hmdnyc-v29dlvcg.tail1a3f79.ts.net> * Pin the dashboard for the November 17 test-run release (#771) * Find each pull request's preview wherever it is published (#772) The preview was found only through a workflow CoderHelm recognized, an address whose host said "preview", and a deployment's first status of any state. A host that publishes its preview through deployments, deploy statuses, check runs or a bot comment was read as having no preview, a protected preview could not be opened, and a preview still building was waited on with no limit. - common::preview_find reads every route a preview is published on (deployment statuses, commit statuses, check runs, bot comments edited in place, the description, the team's address template), counts only what is tied to the head commit first, picks the changed app's preview in a monorepo, and gives one answer: up, building, failed, or nothing. - preview::settle bounds the wait: a short grace when nothing is published, a pending preview looked at every two minutes, at most an hour per commit, and a failed or taken-down deploy said with its source. - common::preview_access and /api/repos/:owner/:name/preview-access: one per-repository Settings item holding the address template and a sealed secret (header lines, query parameters or a password) that the capture sends only to the preview's own host. - The capture keeps a preview's path, retries pages still warming up, and reads a sign-in wall (401, 403, or a redirect to another host) as a wall that points to the setting. - Replay tests with payloads shaped like the code host's listings and common preview bots' comments, one per route. * Fill the Before and After table from the end-to-end run's screenshots CoderHelm's own pull request now shows the screenshots its end-to-end run already took, instead of "No screenshot". - common::e2e::shots reads the images Cucumber JSON embeds, Playwright JSON attaches and Playwright's HTML report keeps under data/, keyed by the test's id, and picks the test that shows the change: one the change edits, one the test map ties to the changed files, or one whose name shares a word with a changed UI file. - e2e_screens keeps that test's screenshot on the head and on the default branch's newest passing run in the install's own bucket, records it for the head and rebuilds the description. - The table links each image through the API with a signed link that works for a year (GET /webhooks/ci/tests/screenshot); the bucket keeps the images 395 days. * Say why a screenshot's test was picked, and pass clippy The reason names the test, not only its name (the match reads its title and file); an empty Before cell says no passing run on the base kept one rather than "yet"; the caption gives the reason before the run links. Formatted, and two iterator and one slice lint fixed. * no-mistakes(review): Claim head record, use PR base, align record TTL * no-mistakes(review): Upload screenshots before claiming the head record * no-mistakes(review): Detect lost claim race with the typed DynamoDB error * Format the screenshot fixes with cargo fmt * no-mistakes(review): Pick screenshot test against PR base, fetch PR once * no-mistakes(document): Format is_own_pr with cargo fmt * Keep end-to-end screenshots on the screenshots ref, under the preview's pages Review asked for one hosting model and for the pair not to hide the preview's page captures. - The Before and After images are committed to refs/coderhelm/screenshots beside the preview's captures and linked by commit, so only people who can read the repository see them. The public screenshot route, its signed links, the bucket copies and their lifecycle rule are gone. - preview::keep_on_ref is the one way both write that ref: blobs, a commit on top of the ref, and a move without force (advance_own_ref), tried again on top when another writer moved it, so no writer's commit is dropped and no image link breaks. - The pair is its own fact (e2e_screens), rendered as a table under the preview's pages and never instead of them; it takes the place of a "No screenshot" line. The preview's pages now win over a set screens table. - An ingest reads the pull request only when it needs it: a failure on a branch that is not CoderHelm's shape, or a report that carries screenshots. CiReports gets the run's real attempt. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Shoyu <shoyu@hmdnyc-v29dlvcg.tail1a3f79.ts.net> Co-authored-by: Nam Bok Rodriguez <nambok@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
What Changed
trigger_plan_dependentsinservices/gateway/src/routes/github_webhook.rsno longer looks up the plan task by issue number alone. Before, it took the first task row with a matching number in any of the team's plans, and a missing number counted as 0. It now passes the whole run record to the newcommon::plan_dependents::dependents_to_release. That function looks up the ticket'sPLAN_TICKET#…plan link in the settings table first, then releases only thewaitingtasks that depend on the task the link names.issue_url. For a Jira run it matchesjira_ticket_key. Issue number 0, a missing repository or a number on its own never match. If the run record names a plan, only that plan is searched. Otherwise it searches all of the team's plans and releases dependents only when exactly one task names the ticket.PlanTicket::skinplan_execute.rsnow builds its link keys with the sharedgithub_link_skandjira_link_skhelpers, so the key written when a plan opens a ticket is the same key read at merge. The new module includes unit tests against an in-memory store. They cover a Jira merge releasing its own dependents, the same issue number in another repository releasing nothing, number 0 never matching, a ticket named by two tasks releasing nothing, and the link being checked before the task rows.Follow-ups (not in this change)
🤖 Generated with Claude Code