Skip to content

fix(ci-insights): name the job-name variable the uploader actually reads - #12415

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/jd/mrgfy-8720-settle-four-docs-asks-the-agent-could-not-bypass-anchor-ci/name-job-name-var-uploader-actually-reads--96e06bb4
Aug 21, 2026
Merged

fix(ci-insights): name the job-name variable the uploader actually reads#12415
mergify[bot] merged 1 commit into
mainfrom
devs/jd/jd/mrgfy-8720-settle-four-docs-asks-the-agent-could-not-bypass-anchor-ci/name-job-name-var-uploader-actually-reads--96e06bb4

Conversation

@jd

@jd jd commented Aug 17, 2026

Copy link
Copy Markdown
Member

The CI Insights setup pages and the two matrix helpers disagreed with each other
about how to override the job name a test report is filed under, and none of
them said where the default comes from.

The three setup pages now name MERGIFY_TEST_JOB_NAME — the variable the CLI
reads, and the one every framework plugin (pytest, rspec, vitest) already
documents — say where the default comes from on each provider (GITHUB_JOB on
GitHub Actions, Jenkins' own JOB_NAME, the step label on Buildkite), and show
where to set it. They also state why it matters: the job name is part of a
test's identity, so a scheduled run that reports a different name splits its
results off from the pull request ones.

The GitHub Actions matrix case is stated the way it actually breaks: every leg
of a matrix reports the same job name because they share one GITHUB_JOB. The
old text left the reader to infer why an override was needed at all.

The two matrix helpers keep recommending the native override — the action's
job_name input and the Buildkite plugin's job_name property. Both currently
export MERGIFY_JOB_NAME, which no uploader reads, so neither takes effect
today; that is a bug in the three producers of that variable, not something the
docs should route readers around. Fixing them is tracked separately, and the
snippets pin moving tags (the action's v25, the plugin's #v1), so readers
pick the fix up when those tags move.

The pytest, rspec and vitest pages already agreed with this and are unchanged.

Settles Mergifyio/ci-bot#369.
Part of MRGFY-8720

Copilot AI lite review requested due to automatic review settings August 17, 2026 17:18
@jd

jd commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(ci-insights): name the job-name variable the uploader actually reads #12415 👈
2 fix(test-insights): drop the removed Gradle report properties #12416
3 fix(test-insights): point the framework recipes at a dashboard page that exists #12417
4 fix(test-insights): stop pinning the Buildkite plugin to its first release #12426

@mergify

mergify Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • all of:
      • author = mergify-ci-bot
      • -head ~= ^docs-agent/

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 17, 2026 17:19 Failure
@mergify
mergify Bot requested a review from a team August 17, 2026 17:20
@jd

jd commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

Context for the reviewer, since this commit answers a question rather than just fixing prose.

The docs and the dashboard's flaky-detection setup prompt named two different environment variables for the same thing, so I settled it from the source rather than picking one.

MERGIFY_TEST_JOB_NAME is the only job-name variable any uploader reads. The CLI reads it in junit-process and reports it as the test run's job name; the engine prefers that value over the auto-detected one. Nothing anywhere reads MERGIFY_JOB_NAME. The default the override replaces is GITHUB_JOB on GitHub Actions, JOB_NAME on Jenkins, and the step label on Buildkite.

Two consequences outside this repo, which I have not fixed here and which need their own change:

  1. The mergifyio/gha-mergify-ci action exposes a job_name input that sets MERGIFY_JOB_NAME. Nothing reads it, so the input is a no-op, and it fails silently, because an unset name just falls back to the auto-detected one. That is why the matrix helper in this repo told readers to use it. This commit stops the docs recommending it; the action still needs fixing.
  2. The dashboard's Test Insights detection setup prompt hands users MERGIFY_JOB_NAME on every job, with a checklist item telling them to set it. Same no-op. Our own flaky-detection workflow sets it too, so those scheduled runs are filing under the auto-detected name rather than the intended one.

Both are recorded for follow-up work rather than left in a comment thread.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns CI Insights setup documentation and matrix helper components to the single job-name override variable actually consumed by Mergify uploaders (MERGIFY_TEST_JOB_NAME), and clarifies provider-specific defaults and matrix behavior so reports are filed under the intended job name.

Changes:

  • Updates CI Insights setup pages (Jenkins, GitHub Actions, Buildkite) to document MERGIFY_TEST_JOB_NAME as the override and explain default job-name sources.
  • Reworks the GitHub Actions and Buildkite matrix helper components to remove guidance around unused job-name inputs/properties and show where to set the env var.
  • Clarifies why matrix runs need overrides on GitHub Actions (shared GITHUB_JOB) and when overrides are needed on Buildkite.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/content/docs/ci-insights/setup/jenkins.mdx Expands the “Job name” guidance and clarifies how to override via MERGIFY_TEST_JOB_NAME.
src/content/docs/ci-insights/setup/github-actions.mdx Explains default job name (GITHUB_JOB), matrix collision, and documents MERGIFY_TEST_JOB_NAME usage.
src/content/docs/ci-insights/setup/buildkite.mdx Updates “Job name” guidance to use MERGIFY_TEST_JOB_NAME in step env.
src/components/MergifyCIUploadStepMatrix.astro Updates matrix helper to set MERGIFY_TEST_JOB_NAME at the job level and removes job_name input guidance.
src/components/BuildkiteCIUploadStepMatrix.astro Updates matrix helper to use MERGIFY_TEST_JOB_NAME in step env and removes job_name plugin property guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/MergifyCIUploadStepMatrix.astro Outdated
Comment thread src/content/docs/ci-insights/setup/github-actions.mdx Outdated
@jd
jd force-pushed the devs/jd/jd/mrgfy-8720-settle-four-docs-asks-the-agent-could-not-bypass-anchor-ci/name-job-name-var-uploader-actually-reads--96e06bb4 branch from da5211b to c6280ed Compare August 17, 2026 19:00
@jd

jd commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial da5211b 2026-08-17 19:00 UTC
2 content da5211b → c6280ed Reworded the job-level caution: it claimed a step's env is not visible to the action, which is a claim about composite-action internals I could not verify. Replaced with the pitfall that is actually … 2026-08-17 19:00 UTC
3 content c6280ed → 42d7aae Put the job_name removals back: the action's job_name input in MergifyCIUploadStepMatrix.astro and the Buildkite plugin's job_name property in BuildkiteCIUploadStepMatrix.astro. Both are declared and… 2026-08-18 07:18 UTC

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 17, 2026 19:01 Failure
@jd

jd commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

Re-pushed to address both review comments: da5211bc6280ed (compare).

Both flagged the same sentence, duplicated in github-actions.mdx and MergifyCIUploadStepMatrix.astro: "a step's env is not visible to the action, which runs its own steps". I could not confirm that from GitHub's metadata documentation — it does not say whether a composite action's steps inherit the env of the calling step — and the advice does not need the claim. So it is gone rather than reworded around.

The caution now says what holds either way: a step's env applies to that step alone, so a job name set on the step that runs the tests never reaches the upload step. Setting it on the job keeps every step reporting the same name, and is where the matrix.* interpolation has to live anyway.

Nothing else in the commit changed. #12416 and #12417 were restacked on top and carry no content change.

Comment thread src/components/BuildkiteCIUploadStepMatrix.astro
The CI Insights setup pages and the two matrix helpers disagreed with each other
about how to override the job name a test report is filed under, and none of
them said where the default comes from.

The three setup pages now name `MERGIFY_TEST_JOB_NAME` — the variable the CLI
reads, and the one every framework plugin (pytest, rspec, vitest) already
documents — say where the default comes from on each provider (`GITHUB_JOB` on
GitHub Actions, Jenkins' own `JOB_NAME`, the step label on Buildkite), and show
where to set it. They also state why it matters: the job name is part of a
test's identity, so a scheduled run that reports a different name splits its
results off from the pull request ones.

The GitHub Actions matrix case is stated the way it actually breaks: every leg
of a matrix reports the same job name because they share one `GITHUB_JOB`. The
old text left the reader to infer why an override was needed at all.

The two matrix helpers keep recommending the native override — the action's
`job_name` input and the Buildkite plugin's `job_name` property. Both currently
export `MERGIFY_JOB_NAME`, which no uploader reads, so neither takes effect
today; that is a bug in the three producers of that variable, not something the
docs should route readers around. Fixing them is tracked separately, and the
snippets pin moving tags (the action's `v25`, the plugin's `#v1`), so readers
pick the fix up when those tags move.

The pytest, rspec and vitest pages already agreed with this and are unchanged.

Settles Mergifyio/ci-bot#369.
Part of MRGFY-8720

Change-Id: I96e06bb4500bf9e7664d36d941ef0d962004e9a9
@jd
jd force-pushed the devs/jd/jd/mrgfy-8720-settle-four-docs-asks-the-agent-could-not-bypass-anchor-ci/name-job-name-var-uploader-actually-reads--96e06bb4 branch from c6280ed to 42d7aae Compare August 18, 2026 07:18
@mergify
mergify Bot deployed to Mergify Merge Protections August 18, 2026 07:18 Active
@jd

jd commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

Re-pushed: c6280ed42d7aae (compare).

The two matrix helpers go back to recommending the native override — the action's job_name input, the Buildkite plugin's job_name property — instead of routing readers to MERGIFY_TEST_JOB_NAME.

I had it backwards. Both properties are declared and documented by their producers, and both are dead only because those producers export MERGIFY_JOB_NAME, which no uploader reads (mergify-cli reads MERGIFY_TEST_JOB_NAME and contains no occurrence of the other name). Documenting the workaround would have left three READMEs disagreeing with the docs and the broken inputs in place forever. The fix belongs in the three producers — the Buildkite plugin's lib/junit.sh, gha-mergify-ci's action.yml, and the dashboard's Test Insights setup prompt — and that work is tracked separately.

That leaves the docs briefly ahead of the code: job_name starts working when those land. The snippets pin moving tags (the action's v25, the plugin's #v1), so readers pick it up without editing anything. No "not yet supported" note — it would be wrong within days and nobody would come back to remove it.

Everything else in the PR is unchanged: job-name-as-test-identity, the per-provider defaults (GITHUB_JOB, Jenkins' JOB_NAME, the Buildkite step label), the matrix explanation, and the setup pages naming MERGIFY_TEST_JOB_NAME for anyone setting the name by env instead. The commit message no longer argues the case it used to.

@jd

jd commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

One thing worth knowing while reviewing this commit: the Buildkite snippet it restores job_name into was pinning mergifyio/mergify-ci#v1 by hand — the oldest of six tags, not a floating major. So job_name would have been recommended in a snippet that installs a plugin predating the code that reads it.

Fixed at the top of the stack in #12426, which points both Buildkite components at src/data/buildkite-plugin-version.json the same way the GitHub Actions component already reads gha-mergify-ci-version.json. Nothing in this commit changes as a result.

@jd jd left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're fixing the code here rather than this

@jd
jd marked this pull request as ready for review August 21, 2026 06:41
@mergify
mergify Bot requested a review from a team August 21, 2026 06:48
@mergify

mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 3 minutes 26 seconds in the queue, including 2 minutes 21 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Aug 21, 2026
@mergify
mergify Bot merged commit 0199bd5 into main Aug 21, 2026
10 checks passed
@mergify
mergify Bot deleted the devs/jd/jd/mrgfy-8720-settle-four-docs-asks-the-agent-could-not-bypass-anchor-ci/name-job-name-var-uploader-actually-reads--96e06bb4 branch August 21, 2026 12:58
@mergify mergify Bot removed the queued label Aug 21, 2026
mergify Bot pushed a commit that referenced this pull request Aug 21, 2026
The JUnit and TestNG recipes told Gradle users to configure their report output
with a `reports { junitXml.enabled = true; junitXml.destination = ... }` block.
Gradle 8.0 removed both of those properties ("The deprecated `destination`, and
`enabled` properties of the `Report` type have been removed", per Gradle's own
upgrade notes), so on any current Gradle that block fails the build. A reader
following either page was stopped at the very first step, before ever reaching
the upload step.

Nothing needs to replace it. Gradle's `test` task already writes JUnit XML to
`build/test-results/test/`, which is the path both pages then tell the reader to
upload, so the block was configuring the default. It goes, the default location
is stated instead, and only the line that does have to be there stays:
`useJUnitPlatform()` for JUnit 5, `useTestNG()` for TestNG.

That also settles the version question the recipe would otherwise have to
answer, since `useJUnitPlatform()` and `useTestNG()` are accepted by every
Gradle version anyone is running.

Settles Mergifyio/ci-bot#370. The same broken block was in the TestNG recipe,
which that issue did not mention.
Part of MRGFY-8720

Depends-On: #12415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants