Skip to content

Test Label Trigger - #843

Open
oxve wants to merge 8 commits into
mainfrom
reuse-build-artifacts_sandbox
Open

Test Label Trigger#843
oxve wants to merge 8 commits into
mainfrom
reuse-build-artifacts_sandbox

Conversation

@oxve

@oxve oxve commented Apr 17, 2026

Copy link
Copy Markdown
Member

Testing label trigger and artifact reuse.

@oxve oxve added the runtest label Apr 17, 2026
@github-actions github-actions Bot removed the runtest label Apr 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


ci: Update workflow dispatcher expensive list

Update the list of expensive GitHub Actions workflows to include
Linux and tvOS platforms. This ensures that these platform builds
are correctly subjected to label-based triggering mechanisms
within the CI pipeline.

Also, correct a missing trailing slash in the artifact path for
the print_logs action, improving robustness for artifact reuse.

Bug: 843

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a syntax error in the print_logs action by adding a missing closing quote to a file path. A review comment identifies a potential logic issue where the source GCS path lacks the matrix configuration variable present in the destination path, which could cause the copy command to fail.

Comment thread .github/actions/print_logs/action.yaml Outdated
run: |
gcloud storage cp "gs://${{ steps.gcs-project.outputs.name }}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{matrix.platform}}/symbols/*" \
"${GITHUB_WORKSPACE}/out/${{ matrix.platform }}_${{ matrix.config }}/lib.unstripped/
"${GITHUB_WORKSPACE}/out/${{ matrix.platform }}_${{ matrix.config }}/lib.unstripped/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The destination path includes ${{ matrix.config }}, but the source GCS path on line 32 only uses ${{matrix.platform}}. This inconsistency will likely cause the command to fail if the artifacts in the GCS bucket are organized by both platform and configuration, which is the standard practice for build symbols.

@oxve
oxve requested review from a team as code owners April 17, 2026 06:54
@oxve
oxve requested review from briantting and removed request for a team April 17, 2026 06:54
@copybara-service
copybara-service Bot force-pushed the main branch 2 times, most recently from 6367de0 to 239d465 Compare April 23, 2026 11:19
@oxve
oxve removed request for a team June 11, 2026 16:39
oxve added 4 commits August 12, 2026 21:51
Problem:
Applying any label to a PR currently retriggers all workflows, causing
unnecessary resource consumption and noise in PR checks.

Solution:
1.  **Remove static labeled triggers**: Removed the 'labeled' event from
    the 'on.pull_request.types' list in android.yaml, aosp.yaml,
    evergreen.yaml, and tvos.yaml.
2.  **Central Dispatcher**: Added .github/workflows/workflow_dispatcher.yaml
    running on 'pull_request_target' 'labeled' events.
    -   It dynamically scans the .github/workflows directory for any
        workflows calling the shared main.yaml workflow.
    -   If the triggering label is 'runtest' or 'yts_playback_test', it
        reruns the latest run of these detected workflows.
    -   It handles 'kokoro:run' and 'kokoro:force-run' as a special case,
        triggering tvos.yaml (which does not use main.yaml).
3.  **Dynamic Label Detection**: Since GHA reruns use the original event
    payload (which doesn't have the new label), updated main.yaml to
    fetch the current labels dynamically using 'gh pr view' in the
    'initialize' job.
4.  **Updated Job Conditions**: Updated main.yaml test jobs (e2e-test,
    yts-test, yts-playback-test) to use these dynamically fetched
    labels to decide if they should run.

This ensures workflows are only rerun when relevant labels are added,
and new workflows using main.yaml are automatically supported without
hardcoding.

TAG=agy
CONV=96b1fa9b-61e9-4116-a9a9-aa7eea25554c
…anup

- Cancel active/queued workflow runs before rerunning to ensure GitHub
  Actions rerun requests succeed.
- Defer label cleanup to validate-test-result in main.yaml so parallel
  workflows can read the label in initialize without race conditions.

Bug: 546243560
@oxve
oxve force-pushed the reuse-build-artifacts_sandbox branch from 97286ea to d01f125 Compare August 14, 2026 17:01
@oxve
oxve requested review from a team as code owners August 14, 2026 17:01
@oxve
oxve requested a review from jellefoks August 14, 2026 17:01
@oxve oxve added the runtest label Aug 14, 2026
@oxve oxve added runtest and removed runtest labels Aug 14, 2026
@oxve oxve added runtest and removed runtest labels Aug 14, 2026
GIT_COMMITTER_NAME: "cobalt-github-releaser-bot"
GIT_COMMITTER_EMAIL: "cobalt-github-releaser-bot@google.com"
permissions:
contents: write
Comment thread .github/workflows/workflow_debug.yaml Fixed
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'runtest' || github.event.label.name == 'yts_playback_test' || github.event.label.name == 'kokoro:run' || github.event.label.name == 'kokoro:force-run'
runs-on: ubuntu-latest
permissions:
actions: write
]
steps:
- name: Checkout code
uses: actions/checkout@v4
Comment thread .github/workflows/workflow_debug.yaml Fixed
pull-requests: write
steps:
- name: Check label and trigger PR jobs
uses: actions/github-script@v8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants