Skip to content

Build/Test Tools: Output relevant URLs in GitHub Actions logs - #11223

Closed
ArkaPrabhaChowdhury wants to merge 3 commits into
WordPress:trunkfrom
ArkaPrabhaChowdhury:add-actions-logging
Closed

Build/Test Tools: Output relevant URLs in GitHub Actions logs#11223
ArkaPrabhaChowdhury wants to merge 3 commits into
WordPress:trunkfrom
ArkaPrabhaChowdhury:add-actions-logging

Conversation

@ArkaPrabhaChowdhury

@ArkaPrabhaChowdhury ArkaPrabhaChowdhury commented Mar 11, 2026

Copy link
Copy Markdown

I have added core.notice() logging to output the relevant URLs for Trac tickets, PRs, and SVN logs to the workflows mentioned in #64299.

Because these workflows run on pull_request_target and workflow_run events, GitHub enforces running the trunk version of the workflow files, so I was unable to test the live output of these changes in this PR.

Let me know if you need any adjustments!

Use of AI Tools

Tools: Google Antigravity for basic suggestions and confirmation. Final implementation were reviewed and edited by me.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

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

Use of AI Tools

AI assistance: Yes
Tool(s): OpenAI Codex
Model(s): GPT-5
Used for: Reviewing the Trac ticket and relevant code, helping with the initial implementation and regression-test approach, and assisting with validation and PR-description drafting. The final implementation, tests, validation results, and description were reviewed and accepted by me.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

Copy link
Copy Markdown

Hi @ArkaPrabhaChowdhury! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

@ArkaPrabhaChowdhury
ArkaPrabhaChowdhury marked this pull request as ready for review March 11, 2026 07:31
@github-actions

github-actions Bot commented Mar 11, 2026

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 arkaprabhachowdhury, adrianmoldovanwp, desrosj, lancewillett.

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

@ArkaPrabhaChowdhury ArkaPrabhaChowdhury changed the title Build/Test Tools: Output relevant URLs in GitHub Actions logs. Fixes … Build/Test Tools: Output relevant URLs in GitHub Actions logs. Mar 11, 2026
@desrosj
desrosj self-requested a review March 11, 2026 16:26
@desrosj

desrosj commented Mar 11, 2026

Copy link
Copy Markdown
Member

Assigning myself to take a look.

Comment thread .github/workflows/reusable-cleanup-pull-requests.yml Fixed
Comment thread .github/workflows/reusable-cleanup-pull-requests.yml Fixed
@lancewillett

lancewillett commented Sep 8, 2026

Copy link
Copy Markdown
Member

Thanks for this. 3 changes would make it ready for review again:

  1. Drop the commit-built-file-changes.yml hunk. That workflow was removed from trunk in r63315, which is why the PR now shows a merge conflict.
  2. Reuse the existing variables in reusable-cleanup-pull-requests.yml. On trunk, the script there already receives FIXED_LIST and SVN_REVISION_NUMBER through env: and reads them into fixedList and svnRevisionNumber. Using those instead of expanding ${{ steps.trac-tickets.outputs.fixed_list }} and ${{ steps.git-svn-id.outputs.svn_revision_number }} inline will clear the two open zizmor "code injection via template expansion" alerts.
  3. Pin actions/github-script to the version already in use. The new steps pin v8.0.0; every existing step in these files is on v9.0.0 (3a2844b7e9c422d3c10d287c895573f7108da1b3).

Once those are in and the branch is rebased on trunk, ping us and we will take another look.

@ArkaPrabhaChowdhury

Copy link
Copy Markdown
Author

Hi @lancewillett,

Thanks for the feedback.

I have addressed the issues. Please do take another look. Thanks!

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

Thanks @ArkaPrabhaChowdhury, the three earlier points are all addressed. A few more, all about the log lines themselves.


// Update all matched pull requests.
for (const prNumber of prNumbers) {
core.notice(`Closed pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${prNumber}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This says "Closed" before the comment and close calls below run. If either call fails, the PR stays open and the run summary still says it was closed. Move the notice after pulls.update, or at least make the wording honest:

Suggested change
core.notice(`Closed pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${prNumber}`);
core.notice(`Closing pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${prNumber}`);

Comment on lines 124 to 125
core.notice(`Created Playground comment for pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${issue_number}`);
github.rest.issues.createComment( commentInfo );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"Created" is logged before the comment exists, and the create call is not awaited, so a failed call leaves a log that claims a comment that is not there. pr.data.html_url is already in scope, so the URL does not need to be built by hand.

Suggested change
core.notice(`Created Playground comment for pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${issue_number}`);
github.rest.issues.createComment( commentInfo );
await github.rest.issues.createComment( commentInfo );
core.notice( `Created Playground comment for pull request: ${ pr.data.html_url }` );

Comment on lines 164 to 165
core.notice(`Created missing Trac ticket comment for pull request: https://github.com/${owner}/${repo}/pull/${number}`);
github.rest.issues.createComment( {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same problem: "Created" is logged before the create call, which is not awaited. pr.html_url is already in scope.

Suggested change
core.notice(`Created missing Trac ticket comment for pull request: https://github.com/${owner}/${repo}/pull/${number}`);
github.rest.issues.createComment( {
core.notice( `Creating missing Trac ticket comment for pull request: ${ pr.html_url }` );
await github.rest.issues.createComment( {

Comment on lines +100 to +103
for (const ticket of fixedList) {
core.notice(`Ticket: https://core.trac.wordpress.org/ticket/${ticket}`);
}
core.notice(`SVN changeset: https://core.trac.wordpress.org/changeset/${svnRevisionNumber}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These run only after the whole search loop, so a run that fails during the GraphQL search logs no ticket or changeset at all. The loop at line 60 already builds tracTicketUrl: log the ticket there, and log the changeset before the search starts.

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.`;

for (const ticket of fixedList) {
core.notice(`Ticket: https://core.trac.wordpress.org/ticket/${ticket}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

core.notice() makes an annotation, and GitHub shows at most 10 per step. One per ticket, one per changeset and one per closed PR in this single step means a commit that closes many PRs loses the last links from the summary. Use core.info() for the per-item lines (as pull-request-comments.yml already does) and keep one headline core.notice().

Comment on lines 105 to 106
// Update all matched pull requests.
for (const prNumber of prNumbers) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Two small things on this loop. When no PR matches, the run says nothing, so a reader cannot tell "nothing to close" from "loop never ran". And prNumbers can hold the same PR twice when a commit fixes two tickets that one PR references, which now also repeats the notice.

Suggested change
// Update all matched pull requests.
for (const prNumber of prNumbers) {
const uniquePrNumbers = [...new Set(prNumbers)];
core.info(`Found ${uniquePrNumbers.length} pull request(s) to close.`);
// Update all matched pull requests.
for (const prNumber of uniquePrNumbers) {

Comment thread .github/workflows/failed-workflow.yml Outdated
Comment on lines +46 to +49
return;
}

core.notice(`Rerunning workflow run: ${workflow_run.data.html_url}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The early return still logs nothing, so a second-attempt run is green with an empty log, which is the no-context case in the ticket. The run data already has the name and branch, so log them too.

Suggested change
return;
}
core.notice(`Rerunning workflow run: ${workflow_run.data.html_url}`);
core.info(`Skipping rerun, attempt ${workflow_run.data.run_attempt}: ${workflow_run.data.html_url}`);
return;
}
core.notice(`Rerunning workflow run "${workflow_run.data.name}" on ${workflow_run.data.head_branch}: ${workflow_run.data.html_url}`);

Comment thread .github/workflows/props-bot.yml Outdated
Comment on lines +73 to +77
- name: Output PR link
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
core.notice(`Pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${context.issue.number}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This boots a whole Node step to echo one string. A plain run step does the same, and the event payload already has the URL for every trigger this job accepts.

Suggested change
- name: Output PR link
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
core.notice(`Pull request: https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${context.issue.number}`);
- name: Output PR link
env:
PR_URL: ${{ github.event.pull_request.html_url || github.event.issue.html_url }}
run: echo "::notice::Pull request: $PR_URL"

@ArkaPrabhaChowdhury

Copy link
Copy Markdown
Author

Hi @adimoldovan,

Thanks for the detailed review. Helps a lot to understand the flow in-depth.

I have addressed the issues.

Thanks!

@adimoldovan
adimoldovan self-requested a review September 10, 2026 13:46

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

Thanks for addressing all the raised issues @ArkaPrabhaChowdhury.

It looks good to land for me.

@lancewillett lancewillett changed the title Build/Test Tools: Output relevant URLs in GitHub Actions logs. Build/Test Tools: Output relevant URLs in GitHub Actions logs Sep 10, 2026
wporg-sync pushed a commit that referenced this pull request Sep 10, 2026
Log the workflow run, pull request, Trac ticket, and SVN changeset URLs handled by the automation workflows. Report skipped reruns and empty pull request searches, and avoid processing the same pull request more than once.

Await comment creation so failures are reported and success notices reflect completed requests.

Developed in: #11223

Props arkaprabhachowdhury, adrianmoldovanwp, desrosj.
Fixes #64299.


git-svn-id: https://develop.svn.wordpress.org/trunk@63583 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 63583
GitHub commit: 9a2e38e

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Sep 10, 2026
@lancewillett

Copy link
Copy Markdown
Member

Thanks, @ArkaPrabhaChowdhury Arkaprabha, for sticking with your first wordpress-develop PR through review! 🙌 Great to see it land alongside your other Core contributions this year.

wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Sep 10, 2026
Log the workflow run, pull request, Trac ticket, and SVN changeset URLs handled by the automation workflows. Report skipped reruns and empty pull request searches, and avoid processing the same pull request more than once.

Await comment creation so failures are reported and success notices reflect completed requests.

Developed in: WordPress/wordpress-develop#11223

Props arkaprabhachowdhury, adrianmoldovanwp, desrosj.
Fixes #64299.

Built from https://develop.svn.wordpress.org/trunk@63583


git-svn-id: http://core.svn.wordpress.org/trunk@62759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

5 participants