[ MATTER-6188 MATTER-5457 ] : Split workflows to access PRs from forks#568
[ MATTER-6188 MATTER-5457 ] : Split workflows to access PRs from forks#568sarthak shaha (Sarthak-Shaha) wants to merge 14 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43298ec578
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df805a4628
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
|
Codex (@codex) review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback". |
| head-sha: ${{ inputs.head-sha }} | ||
| head-branch: ${{ inputs.head-branch }} |
There was a problem hiding this comment.
I don't know enough about the the Ci action flow at the moment to make an educated suggestion.
But head-sha: ${{ inputs.head-sha }} and head-branch: ${{ inputs.head-branch }}
Apply to the whole build flow. Is there not a common place we could set this rather than having 2 extra input in each job workflow?
This reverts commit 0f32920.
c83b61d to
a1570ca
Compare
Issue Link:
MATTER-6188
MATTER-5457
Description of Problem/Feature:
Fork PRs do not have access to repository secrets, which causes the Jenkins sanity workflow to fail for external contributors.
Description of Fix/Solution:
Split
dev-apps-builderandsqa-sanity-testsinto separate independent workflows.sqa-sanity-testsnow uses aworkflow_runtrigger instead ofworkflow_call. Workflows triggered byworkflow_runalways run on the base repository's default branch and have full access to repository secrets, regardless of whether the triggering build originated from a fork.Changes:
dev-apps-builder.yamlwait-for-test-resultsandbuild-sqa-appsjobs; these are now owned bysqa-sanity-tests.yamlcache-toolstodelete-cacheneeds soneeds.cache-tools.outputs.cache-keyresolves correctlysqa-sanity-tests.yamlworkflow_calltoworkflow_runonBuild Dev appsif: github.event.workflow_run.conclusion == 'success'to skip failed buildscontext.payload.workflow_run.head_sha(previously fell back to default branch SHA for non-PR events)cache-tools,build-sqa-apps,delete-cachejobs moved here, conditioned ongithub.event.workflow_run.head_branch(notgithub.ref_name, which is always the default branch inworkflow_runcontext)github.event.workflow_run.head_repository.full_name == github.repositoryguard tocache-tools,build-sqa-apps, anddelete-cacheto prevent fork PRs with a branch namedmainorrelease_*from executing privileged jobscache-toolscheckout usesref: github.event.workflow_run.head_shato build from the triggering commit, not the default branchbuild-sqa-appspasseshead-shaandhead-branchthrough the reusable workflow chain so source code is built from the triggering commit on non-default branches (e.g.release_*)deleteCacheById→deleteActionsCacheByKey(cache key is a string, not a numeric ID)always()todelete-cacheso cache is cleaned even ifbuild-sqa-appsfailssqa-apps-builder.yaml,platform-builder.yaml,builder.yamlhead-shaandhead-branchinputs, threaded through the full call chainbuilder.yamlcheckout usesref: inputs.head-sha || github.shabuilder.yamlasset creation condition usesinputs.head-branch || github.ref_nameinstead ofgithub.ref_namealonejenkins_integration/github/github_workflow.py_matches_pr_workflow: GitHub returns an emptypull_requestsarray for fork PRs; added fallback to match byhead_shainstead_get_pr_latest_sha: now returns(commit_sha, head_branch)so the SHA is available for the fallback matchTesting Done:
Test PR #566
#569