mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-16 16:22:37 +00:00
feat: add workflow_dispatch and self-trigger to stainless builds (#4361)
Some checks failed
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 0s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 0s
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 2s
Test External Providers Installed via Module / test-external-providers-from-module (venv) (push) Has been skipped
Integration Tests (Replay) / generate-matrix (push) Successful in 3s
API Conformance Tests / check-schema-compatibility (push) Successful in 12s
Python Package Build Test / build (3.12) (push) Successful in 15s
Python Package Build Test / build (3.13) (push) Successful in 17s
Test External API and Providers / test-external (venv) (push) Failing after 30s
Vector IO Integration Tests / test-matrix (push) Failing after 48s
UI Tests / ui-tests (22) (push) Successful in 1m36s
Unit Tests / unit-tests (3.13) (push) Failing after 1m43s
Unit Tests / unit-tests (3.12) (push) Failing after 1m54s
Integration Tests (Replay) / Integration Tests (, , , client=, ) (push) Failing after 3m24s
Pre-commit / pre-commit (22) (push) Successful in 4m22s
Some checks failed
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 0s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 0s
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 2s
Test External Providers Installed via Module / test-external-providers-from-module (venv) (push) Has been skipped
Integration Tests (Replay) / generate-matrix (push) Successful in 3s
API Conformance Tests / check-schema-compatibility (push) Successful in 12s
Python Package Build Test / build (3.12) (push) Successful in 15s
Python Package Build Test / build (3.13) (push) Successful in 17s
Test External API and Providers / test-external (venv) (push) Failing after 30s
Vector IO Integration Tests / test-matrix (push) Failing after 48s
UI Tests / ui-tests (22) (push) Successful in 1m36s
Unit Tests / unit-tests (3.13) (push) Failing after 1m43s
Unit Tests / unit-tests (3.12) (push) Failing after 1m54s
Integration Tests (Replay) / Integration Tests (, , , client=, ) (push) Failing after 3m24s
Pre-commit / pre-commit (22) (push) Successful in 4m22s
# What does this PR do? Currently impossible to test workflow changes (pull_request_target uses base branch definition) or manually trigger SDK builds. This adds both capabilities. - Add workflow_dispatch with pr_number input for manual testing - Add workflow file to path triggers for automatic testing - Fetch PR details via gh CLI for manual runs - Update jobs to use computed PR data for both trigger types ## Test Plan impossible to test until it merges unfortunately. I am doing this in a smaller PR so that I can use it immediately in a follow up. Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
parent
95b2948d11
commit
7308c8aef1
1 changed files with 59 additions and 16 deletions
75
.github/workflows/stainless-builds.yml
vendored
75
.github/workflows/stainless-builds.yml
vendored
|
|
@ -15,9 +15,16 @@ on:
|
||||||
- closed
|
- closed
|
||||||
paths:
|
paths:
|
||||||
- "client-sdks/stainless/**"
|
- "client-sdks/stainless/**"
|
||||||
|
- ".github/workflows/stainless-builds.yml" # this workflow
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
pr_number:
|
||||||
|
description: 'PR number to run Stainless build for'
|
||||||
|
required: true
|
||||||
|
type: number
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|
@ -49,14 +56,45 @@ jobs:
|
||||||
preview_branch: ${{ steps.compute.outputs.preview_branch }}
|
preview_branch: ${{ steps.compute.outputs.preview_branch }}
|
||||||
base_branch: ${{ steps.compute.outputs.base_branch }}
|
base_branch: ${{ steps.compute.outputs.base_branch }}
|
||||||
merge_branch: ${{ steps.compute.outputs.merge_branch }}
|
merge_branch: ${{ steps.compute.outputs.merge_branch }}
|
||||||
|
pr_head_repo: ${{ steps.compute.outputs.pr_head_repo }}
|
||||||
|
pr_head_ref: ${{ steps.compute.outputs.pr_head_ref }}
|
||||||
|
pr_head_sha: ${{ steps.compute.outputs.pr_head_sha }}
|
||||||
|
pr_base_sha: ${{ steps.compute.outputs.pr_base_sha }}
|
||||||
|
pr_base_ref: ${{ steps.compute.outputs.pr_base_ref }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Fetch PR details for workflow_dispatch
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
id: fetch-pr
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
PR_DATA=$(gh pr view ${{ inputs.pr_number }} --repo ${{ github.repository }} --json headRefName,headRepository,headRefOid,baseRefName,baseRefOid,headRepositoryOwner)
|
||||||
|
echo "pr_data=$PR_DATA" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Compute branch names
|
- name: Compute branch names
|
||||||
id: compute
|
id: compute
|
||||||
run: |
|
run: |
|
||||||
HEAD_REPO="${{ github.event.pull_request.head.repo.full_name }}"
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
# Extract from fetched PR data
|
||||||
|
PR_DATA='${{ steps.fetch-pr.outputs.pr_data }}'
|
||||||
|
FORK_OWNER=$(echo "$PR_DATA" | jq -r '.headRepositoryOwner.login')
|
||||||
|
REPO_NAME=$(echo "$PR_DATA" | jq -r '.headRepository.name')
|
||||||
|
HEAD_REPO="${FORK_OWNER}/${REPO_NAME}"
|
||||||
|
BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName')
|
||||||
|
HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')
|
||||||
|
BASE_SHA=$(echo "$PR_DATA" | jq -r '.baseRefOid')
|
||||||
|
BASE_REF=$(echo "$PR_DATA" | jq -r '.baseRefName')
|
||||||
|
else
|
||||||
|
# Use pull_request_target event data
|
||||||
|
HEAD_REPO="${{ github.event.pull_request.head.repo.full_name }}"
|
||||||
|
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
|
||||||
|
FORK_OWNER="${{ github.event.pull_request.head.repo.owner.login }}"
|
||||||
|
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
||||||
|
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
||||||
|
BASE_REF="${{ github.event.pull_request.base.ref }}"
|
||||||
|
fi
|
||||||
|
|
||||||
BASE_REPO="${{ github.repository }}"
|
BASE_REPO="${{ github.repository }}"
|
||||||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
|
|
||||||
FORK_OWNER="${{ github.event.pull_request.head.repo.owner.login }}"
|
|
||||||
|
|
||||||
if [ "$HEAD_REPO" != "$BASE_REPO" ]; then
|
if [ "$HEAD_REPO" != "$BASE_REPO" ]; then
|
||||||
# Fork PR: prefix with fork owner for isolation
|
# Fork PR: prefix with fork owner for isolation
|
||||||
|
|
@ -75,10 +113,15 @@ jobs:
|
||||||
echo "preview_branch=${PREVIEW_BRANCH}" >> $GITHUB_OUTPUT
|
echo "preview_branch=${PREVIEW_BRANCH}" >> $GITHUB_OUTPUT
|
||||||
echo "base_branch=${BASE_BRANCH}" >> $GITHUB_OUTPUT
|
echo "base_branch=${BASE_BRANCH}" >> $GITHUB_OUTPUT
|
||||||
echo "merge_branch=${PREVIEW_BRANCH}" >> $GITHUB_OUTPUT
|
echo "merge_branch=${PREVIEW_BRANCH}" >> $GITHUB_OUTPUT
|
||||||
|
echo "pr_head_repo=${HEAD_REPO}" >> $GITHUB_OUTPUT
|
||||||
|
echo "pr_head_ref=${BRANCH_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
echo "pr_head_sha=${HEAD_SHA}" >> $GITHUB_OUTPUT
|
||||||
|
echo "pr_base_sha=${BASE_SHA}" >> $GITHUB_OUTPUT
|
||||||
|
echo "pr_base_ref=${BASE_REF}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
preview:
|
preview:
|
||||||
needs: compute-branch
|
needs: compute-branch
|
||||||
if: github.event.action != 'closed'
|
if: github.event_name == 'workflow_dispatch' || github.event.action != 'closed'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -89,8 +132,8 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ needs.compute-branch.outputs.pr_head_repo }}
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Run preview builds
|
- name: Run preview builds
|
||||||
|
|
@ -102,15 +145,15 @@ jobs:
|
||||||
oas_path: ${{ env.OAS_PATH }}
|
oas_path: ${{ env.OAS_PATH }}
|
||||||
config_path: ${{ env.CONFIG_PATH }}
|
config_path: ${{ env.CONFIG_PATH }}
|
||||||
fail_on: ${{ env.FAIL_ON }}
|
fail_on: ${{ env.FAIL_ON }}
|
||||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
base_sha: ${{ needs.compute-branch.outputs.pr_base_sha }}
|
||||||
base_ref: ${{ github.event.pull_request.base.ref }}
|
base_ref: ${{ needs.compute-branch.outputs.pr_base_ref }}
|
||||||
head_sha: ${{ github.event.pull_request.head.sha }}
|
head_sha: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
||||||
branch: ${{ needs.compute-branch.outputs.preview_branch }}
|
branch: ${{ needs.compute-branch.outputs.preview_branch }}
|
||||||
base_branch: ${{ needs.compute-branch.outputs.base_branch }}
|
base_branch: ${{ needs.compute-branch.outputs.base_branch }}
|
||||||
|
|
||||||
merge:
|
merge:
|
||||||
needs: compute-branch
|
needs: compute-branch
|
||||||
if: github.event.action == 'closed' && github.event.pull_request.merged == true
|
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -121,8 +164,8 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ needs.compute-branch.outputs.pr_head_repo }}
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
# Note that this only merges in changes that happened on the last build on
|
# Note that this only merges in changes that happened on the last build on
|
||||||
|
|
@ -140,7 +183,7 @@ jobs:
|
||||||
oas_path: ${{ env.OAS_PATH }}
|
oas_path: ${{ env.OAS_PATH }}
|
||||||
config_path: ${{ env.CONFIG_PATH }}
|
config_path: ${{ env.CONFIG_PATH }}
|
||||||
fail_on: ${{ env.FAIL_ON }}
|
fail_on: ${{ env.FAIL_ON }}
|
||||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
base_sha: ${{ needs.compute-branch.outputs.pr_base_sha }}
|
||||||
base_ref: ${{ github.event.pull_request.base.ref }}
|
base_ref: ${{ needs.compute-branch.outputs.pr_base_ref }}
|
||||||
head_sha: ${{ github.event.pull_request.head.sha }}
|
head_sha: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
||||||
merge_branch: ${{ needs.compute-branch.outputs.merge_branch }}
|
merge_branch: ${{ needs.compute-branch.outputs.merge_branch }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue