Make WordPress Core

Opened 11 months ago

Closed 5 weeks ago

Last modified 5 weeks ago

#64299 closed enhancement (fixed)

Output relevant URLs in GitHub Actions logs.

Reported by: desrosj Owned by: lancewillett
Priority: normal Milestone: 7.2
Component: Build/Test Tools Version:
Severity: normal Keywords: good-first-bug has-patch changes-requested
Cc: Focuses:

Description

Several GitHub Actions workflows are responsible for performing tasks against pull requests in response to certain actions. However, because of how actions run, it's not easy to determine what was performed by each workflow run. This is compounded by the fact that events such as workflow_run and workflow_dispatch don't always list a branch, pull request, or commit as context.

A few examples:

  • The reusable-cleanup-pull-requests.yml workflow closes pull requests that mention a given ticket noted as Fixed in a commit message. The SVN changeset, ticket, and the pull requests closed on GitHub should be noted and linked.
  • The failed-workflow.yml workflow automatically reruns a workflow once to help rule out network-related failures. The workflow being rerun should be noted and linked to.
  • The props-bot.yml workflow collects props for a given pull request. The pull request should be noted and linked.
  • The commit-built-file-changes.yml workflow commits any missed changes to built files under version control back to a pull request. The pull request being updated should be noted and linked to.

Note: This list is not all inclusive. Each workflow should be examined for any details that could be helpful to output into each workflow run log.

Attachments (1)

GHA-workflow-runs-without-context.png​ (130.9 KB ) - added by desrosj 11 months ago.

Download all attachments as: .zip

Change History (11)

This ticket was mentioned in ​PR #10559 on ​WordPress/wordpress-develop by ​@roshniahuja14.


11 months ago
#1

  • Keywords has-patch added; needs-patch removed

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

## Summary
Adds logging output to GitHub Actions workflows to display relevant URLs in workflow run logs. This improves visibility into what each workflow is performing.

## Changes Made

  • reusable-cleanup-pull-requests.yml: Outputs SVN changeset URL, Trac ticket URLs, and pull request URLs being closed
  • failed-workflow.yml: Outputs the workflow run URL being rerun, along with branch and PR information
  • props-bot.yml: Outputs the pull request URL being processed
  • commit-built-file-changes.yml: Outputs the source workflow run URL and pull request/branch information

## Testing Instructions

  1. The workflow-lint action will automatically validate YAML syntax
  2. After merge, monitor workflow runs to see the new log outputs
  3. Example workflows to check:

#2 @desrosj
10 months ago

  • Keywords changes-requested added

This ticket was mentioned in ​PR #11223 on ​WordPress/wordpress-develop by ​@arkaprabhachowdhury.


7 months ago
#3

…#64299.

Trac ticket: [](https://core.trac.wordpress.org/ticket/64299)

## Use of AI Tools

​@desrosj commented on ​PR #11223:


7 months ago
#4

Assigning myself to take a look.

​@lancewillett commented on ​PR #11223:


5 weeks ago
#5

Thanks for this, and apologies that it has sat for so long. I took a fresh look today. Three 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 me and I will take another look.

​@arkaprabhachowdhury commented on ​PR #11223:


5 weeks ago
#6

Hi @lancewillett,

Thanks for the feedback.

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

​@arkaprabhachowdhury commented on ​PR #11223:


5 weeks ago
#7

Hi @adimoldovan,

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

I have addressed the issues.

Thanks!

#8 @lancewillett
5 weeks ago

  • Milestone Future Release → 7.2
  • Owner set to lancewillett
  • Status new → accepted

#9 @lancewillett
5 weeks ago

  • Resolution → fixed
  • Status accepted → closed

In 63583:

Build/Test Tools: Log relevant URLs in GitHub Actions.

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: ​https://github.com/WordPress/wordpress-develop/pull/11223

Props arkaprabhachowdhury, adrianmoldovanwp, desrosj.
Fixes #64299.

​@lancewillett commented on ​PR #11223:


5 weeks ago
#10

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.

Note: See TracTickets for help on using tickets.