Skip to content

fix(safety): make dependency-safety/gate status clickable#71

Merged
j7an merged 1 commit into
mainfrom
fix/gate-status-target-url
May 28, 2026
Merged

fix(safety): make dependency-safety/gate status clickable#71
j7an merged 1 commit into
mainfrom
fix/gate-status-target-url

Conversation

@j7an
Copy link
Copy Markdown
Owner

@j7an j7an commented May 28, 2026

Summary

  • Add target_url to all three gh api .../statuses/... calls in dependency-safety.yml so the dependency-safety / gate PR check row becomes clickable.
  • URL points at the current workflow run (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) — in workflow_call context this resolves to the caller's run, where the safety / scan logs live.
  • No script changes, no inline-sync impact, no test fixtures touched.

Why

The gate row was rendered as a `StatusContext` with empty `targetUrl`, so users couldn't click through to see why a gate was failing or stuck pending. The legacy Statuses API documents `target_url` as optional but unused-by-default; we just hadn't been setting it.

Test plan

  • CI: `ci-scripts.yml` (bats + inline-sync + workflow-call lint) is green on this PR.
  • CI: `ci-safety.yml` exercises the updated workflow's non-bot early-exit path only on this PR (this PR is human-authored, not Dependabot-authored, so the scan path is skipped by design); confirm the resulting `dependency-safety / gate` row on this PR is clickable and lands on this PR's safety workflow run.
  • Deferred to the next Dependabot PR after merge (only way to exercise the pending/final-state code paths): hover the `dependency-safety / gate` row and confirm the link target is `.../actions/runs/`; click through and confirm it lands on the `Dependency Safety` workflow run page; confirm the row remains clickable across the pending → final state transition.

The gate row in PR check rollups was rendered with empty target_url
because the legacy Statuses API calls didn't set one. Users had to
manually locate the Dependency Safety workflow run under the Actions
tab to inspect a failed or stuck-pending gate.

Add target_url pointing at the current workflow run to all three
gh api .../statuses/... calls (non-bot success, Dependabot pending,
and final state). In workflow_call context, github.server_url /
.repository / .run_id resolve to the caller's run — which is where
the safety/scan logs live.

No script changes; no inline-sync impact.
@j7an j7an merged commit 6e54797 into main May 28, 2026
5 checks passed
@j7an j7an deleted the fix/gate-status-target-url branch May 28, 2026 05:27
j7an added a commit that referenced this pull request May 28, 2026
Both ci-safety.yml and the reusable dependency-safety.yml declared
name: Dependency Safety. GitHub registered ci-safety.yml first under
that name and fell back to registering dependency-safety.yml under
its file path as the display name. The unresolvable name caused the
check-suite scheduler to emit phantom startup-failure runs (0 jobs,
no logs) on pushes that touch dependency-safety.yml — observed on
the fix/gate-status-target-url branch push and on the merge of #71.

Renaming ci-safety.yml's name: to "CI Safety" disambiguates the two
workflows so dependency-safety.yml can register under its proper
name. The reusable workflow's display name is unchanged, so consumer
repos see no difference.

Cosmetic-only on this repo's Actions tab: the dogfood workflow row
will now read "CI Safety" instead of "Dependency Safety".

Refs run https://github.com/j7an/shared-workflows/actions/runs/26556546736
(the phantom failure on the post-merge push to main).
j7an added a commit that referenced this pull request May 28, 2026
…ger (#76)

Background: ci-safety.yml's dogfood (`safety / scan` job) has been
silently broken since 2026-05-28 05:21 — every PR produces a 0-job
phantom startup_failure. The complete file-level diff between the
last working state (HEAD a8655fe at 2026-05-26 06:19) and the first
broken state (HEAD 01d9280 at 2026-05-28 05:21) is exactly these 9
lines: three `-f target_url=...` arguments added to three
`gh api .../statuses/${HEAD_SHA}` calls inside dep-safety.yml's
run-blocks.

This PR reverts those 3 lines (plus the 3 backslash-continuation
modifications they required on the preceding `-f description=` lines)
to test whether they are causally involved in the phantom-failure
behavior.

Possible outcomes when this lands on a PR:
1. Phantom failures STOP and ci-safety's `safety / scan` job runs
   again → the target_url expressions are causally involved. We then
   need to either find another way to make the gate clickable or
   accept the unclickable status.
2. Phantoms persist → the target_url changes are NOT involved; the
   regression must be a coincident GitHub-side platform change.
   Support ticket is the only path remaining.

Refs phantom runs:
- 26556360487 (first phantom, our feature branch push 2026-05-28 05:21)
- 26556546736 (PR #71 merge)
- 26556922328 (PR #72 feature branch)
- 26557123379 (PR #73 feature branch)
- 26557436258 (PR #74 merge)
- 26558104480 (PR #75 merge — new workflow_id 284671829, still broken)

The diagnostic itself reverts to the working file-content state for
just this file; everything else (file rename to dep-safety.yml, doc
header from #73, name="Dependency Safety (reusable)" from #74) is
left intact since we want to test the target_url-specific hypothesis
in isolation.
j7an added a commit that referenced this pull request May 28, 2026
#77)

Restore the clickable gate-status feature originally attempted in #71,
this time using shell environment variables instead of GitHub Actions
template-expression syntax.

#71's form (now removed from history):

    -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

caused GitHub Actions' scheduler to abort caller invocations of this
reusable workflow before any job launched — a 0-job startup_failure
with no logs. The dogfood (ci-safety.yml → dependency-safety.yml) was
silently broken for ~24 hours until the cause was localized to those
three expressions.

This commit uses the shell-env-var form instead:

    -f target_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"

Identical runtime values — GitHub Actions exports these as standard env
vars to the runner — but GitHub's template-expression analyzer sees no
${{ }} substitution in the target_url area. Hypothesis: the scheduler's
expression analyzer specifically tripped on the previous form; bypassing
template substitution should sidestep it.

If this PR's ci-safety dogfood produces a real `safety / scan` job AND
the resulting `dependency-safety / gate` row in the PR check rollup
becomes clickable, the workaround is confirmed.

If the dogfood breaks again (0-job phantom), revert this PR; the bug is
about target_url presence regardless of substitution form, and we live
with an unclickable gate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant