Skip to content

Build/test tools: run test-old-branches on the security mirror (checks only, no Slack) - #12698

Open
lancewillett wants to merge 1 commit into
WordPress:trunkfrom
lancewillett:fix/test-old-branches-security-mirror
Open

Build/test tools: run test-old-branches on the security mirror (checks only, no Slack)#12698
lancewillett wants to merge 1 commit into
WordPress:trunkfrom
lancewillett:fix/test-old-branches-security-mirror

Conversation

@lancewillett

@lancewillett lancewillett commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Trac ticket: https://core.trac.wordpress.org/ticket/64893

Summary

test-old-branches.yml restricts its dispatch job to github.repository == 'WordPress/wordpress-develop', so it only runs on the canonical public repository. This extends that one guard to also allow the private security mirror (WordPress/wordpress-develop-security), so backport branches there get the same cross-branch test coverage. The Slack notification job is deliberately left public-only, so the mirror runs the tests without posting to the public channel. The public repository's behavior is unchanged.

Why

Security backport branches are prepared on the private mirror, which shares this workflow file but is excluded by the repo-name guard. As a result the suite never runs across old branches there, and a missed backport can ship without a red test. Enabling the dispatch job closes that gap; the per-branch results are visible as checks without a Slack alert.

Guard expression

Two options enable a private mirror: the explicit repository name (used here) or github.event.repository.private. test-old-branches.yml runs on pushes to trunk that change its workflow files, twice-monthly schedules, and manual workflow_dispatch events. Because github.event.repository is not reliably populated on schedule events, the explicit-name form is used for reliability. Happy to switch to the private-flag form if preferred.

Testing

  • actionlint passes on the changed workflow.
  • git diff --check passes.
  • The change is limited to the dispatch job's if: guard; the Slack notification job's guard is untouched.
  • The public repository's guard clause is unchanged, so canonical CI is unaffected.

Copilot AI review requested due to automatic review settings July 26, 2026 21:02
@lancewillett
lancewillett marked this pull request as ready for review July 26, 2026 21:02
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props lancewillett.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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

Updates the test-old-branches.yml GitHub Actions workflow guard conditions so it runs not only on the public WordPress/wordpress-develop repository, but also on the private security mirror WordPress/wordpress-develop-security, enabling the same cross-branch coverage for security backport branches.

Changes:

  • Expand the repository-name if: guard on dispatch-workflows-for-old-branches to allow the security mirror.
  • Expand the repository-name if: guard on slack-notifications to allow the security mirror (while preserving the existing pull_request exclusion and always() behavior).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lancewillett
lancewillett force-pushed the fix/test-old-branches-security-mirror branch from c92c3d1 to 887d1f4 Compare July 26, 2026 21:11
The dispatch job's guard restricts it to the canonical public repository, so it
never runs on the private security mirror and backport branches get no
cross-branch CI. Extend that guard to also allow WordPress/wordpress-develop-security.

The Slack notification job is left public-only on purpose: the mirror runs the
tests and reports per-branch results, but does not post to the public Slack channel.

See #64893.

Props lance.willett@automattic.com
@lancewillett
lancewillett force-pushed the fix/test-old-branches-security-mirror branch from 887d1f4 to 0ca85d7 Compare July 26, 2026 22:03
Copilot AI review requested due to automatic review settings July 26, 2026 22:03

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@lancewillett lancewillett changed the title Build/Test Tools: Run test-old-branches on the security mirror Build/test tools: run test-old-branches on the security mirror (CI alerts only) Jul 26, 2026
@lancewillett lancewillett changed the title Build/test tools: run test-old-branches on the security mirror (CI alerts only) Build/test tools: run test-old-branches on the security mirror (checks only, no Slack) Jul 27, 2026
@lancewillett
lancewillett requested a review from adimoldovan July 27, 2026 15:51

@adimoldovan adimoldovan 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.

test-old-branches.yml dispatches other workflows and each has their own guard:

All still github.repository == 'WordPress/wordpress-develop'

Those guards need updating too, but in a separate PR — test-old-branches.yml only exists on trunk, while the dispatched workflows live on every branch:

  1. This PR — trunk only, nothing to backport.
  2. Follow-up — the seven workflows above, on trunk + backported to 7.0…4.7.

actions: write
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.repository == 'WordPress/wordpress-develop-security' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We probably don't want it to run on push and schedule in the mirror repo.

Suggested change
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.repository == 'WordPress/wordpress-develop-security' }}
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.repository == 'WordPress/wordpress-develop-security' && github.event_name == 'workflow_dispatch' )

@lancewillett
lancewillett requested a review from johnbillion July 27, 2026 17:18
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.

3 participants