Skip to content

Commit 825d25e

Browse files
authored
Merge branch 'main' into jjasinsk/eval_summarization
2 parents f0419d8 + 7fa8abc commit 825d25e

35 files changed

Lines changed: 10602 additions & 38 deletions

.github/workflows/claude.yml

Lines changed: 71 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ on:
2727
types: [opened, ready_for_review]
2828
pull_request_review_comment:
2929
types: [created, edited]
30-
release:
31-
types: [created]
30+
workflow_run:
31+
workflows: ["PyPi"]
32+
types: [completed]
3233

3334
permissions:
3435
contents: write # Allows Claude to post suggested changes (requires write for GitHub API)
@@ -485,28 +486,67 @@ jobs:
485486
- Assume good intent
486487
- Welcome contributors
487488
488-
# Generate release notes when a new release is created
489+
# Generate release notes when PyPi workflow completes successfully on a tag
489490
release-notes:
490-
if: github.event_name == 'release'
491+
if: |
492+
github.event_name == 'workflow_run' &&
493+
github.event.workflow_run.conclusion == 'success' &&
494+
startsWith(github.event.workflow_run.head_branch, 'v')
491495
runs-on: ubuntu-latest
492496
permissions:
493497
contents: write # For committing release notes
494498
issues: write # For creating failure notification issue
495499
concurrency:
496-
group: claude-release-notes-${{ github.event.release.tag_name }}
500+
group: claude-release-notes-${{ github.event.workflow_run.head_branch }}
497501
cancel-in-progress: false
498502
steps:
503+
- name: Extract and validate tag name
504+
id: tag
505+
env:
506+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
507+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
508+
run: |
509+
TAG_NAME="$HEAD_BRANCH"
510+
echo "Candidate tag: $TAG_NAME"
511+
512+
# Validate semantic version format (vX.Y.Z)
513+
if [[ ! "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
514+
echo "❌ '$TAG_NAME' is not a valid semantic version tag (expected vX.Y.Z)"
515+
echo "SKIP=true" >> $GITHUB_OUTPUT
516+
exit 0
517+
fi
518+
519+
# Verify the GitHub release exists
520+
if ! gh release view "$TAG_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
521+
echo "❌ GitHub release for '$TAG_NAME' does not exist yet"
522+
echo "SKIP=true" >> $GITHUB_OUTPUT
523+
exit 0
524+
fi
525+
526+
echo "✅ Valid tag and release exists: $TAG_NAME"
527+
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
528+
echo "SKIP=false" >> $GITHUB_OUTPUT
529+
499530
- name: Checkout repository
531+
if: steps.tag.outputs.SKIP != 'true'
500532
uses: actions/checkout@v6
501533
with:
502534
ref: main # Checkout main branch (not tag) so we can commit
503535
fetch-depth: 0 # Full history for tag comparison
504536
token: ${{ secrets.RELEASE_PAT }} # PAT needed to push past branch protection
505537

538+
- name: Fetch all tags
539+
if: steps.tag.outputs.SKIP != 'true'
540+
run: |
541+
git fetch --tags --force
542+
echo "Tags available:"
543+
git tag -l | tail -10
544+
506545
- name: Generate release context
546+
if: steps.tag.outputs.SKIP != 'true'
507547
env:
508548
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
509-
CURRENT_TAG: ${{ github.event.release.tag_name }}
549+
CURRENT_TAG: ${{ steps.tag.outputs.TAG_NAME }}
510550
run: |
511551
echo "Generating release context for $CURRENT_TAG"
512552
@@ -602,6 +642,7 @@ jobs:
602642
ls -la release-diffs/ 2>/dev/null || echo "No diff files"
603643
604644
- name: Generate release notes with Claude
645+
if: steps.tag.outputs.SKIP != 'true'
605646
id: generate-notes
606647
uses: anthropics/claude-code-action@beta
607648
with:
@@ -610,7 +651,7 @@ jobs:
610651
max_turns: 30
611652
model: claude-opus-4-5-20251101
612653
prompt: |
613-
Generate comprehensive release notes for GAIA version ${{ github.event.release.tag_name }}.
654+
Generate comprehensive release notes for GAIA version ${{ steps.tag.outputs.TAG_NAME }}.
614655
615656
## FIRST ACTIONS
616657
1. Read release-context.txt - Contains commit log, contributors, PRs, and list of diff files
@@ -640,22 +681,22 @@ jobs:
640681
### 1. `RELEASE_NOTES.md` - For GitHub Release
641682
Plain markdown for the GitHub release page.
642683
643-
### 2. `docs/releases/${{ github.event.release.tag_name }}.mdx` - For Documentation Site
684+
### 2. `docs/releases/${{ steps.tag.outputs.TAG_NAME }}.mdx` - For Documentation Site
644685
MDX format with Mintlify frontmatter for the documentation website.
645686
646687
## Release Notes Format (use for BOTH files)
647688
648689
For the MDX file, add this frontmatter at the top:
649690
```
650691
---
651-
title: "${{ github.event.release.tag_name }}"
692+
title: "${{ steps.tag.outputs.TAG_NAME }}"
652693
description: "[One-line summary of this release]"
653694
---
654695
```
655696
656697
Then use this content structure for both files:
657698
658-
# GAIA ${{ github.event.release.tag_name }} Release Notes
699+
# GAIA ${{ steps.tag.outputs.TAG_NAME }} Release Notes
659700
660701
## Overview
661702
@@ -692,7 +733,7 @@ jobs:
692733
Key PRs:
693734
- #[number] - [PR title]
694735
695-
Full Changelog: [${{ env.PREVIOUS_TAG }}...${{ github.event.release.tag_name }}](https://github.com/amd/gaia/compare/${{ env.PREVIOUS_TAG }}...${{ github.event.release.tag_name }})
736+
Full Changelog: [${{ env.PREVIOUS_TAG }}...${{ steps.tag.outputs.TAG_NAME }}](https://github.com/amd/gaia/compare/${{ env.PREVIOUS_TAG }}...${{ steps.tag.outputs.TAG_NAME }})
696737
697738
## Guidelines
698739
@@ -712,7 +753,7 @@ jobs:
712753
713754
IMPORTANT: You MUST write BOTH files:
714755
1. `RELEASE_NOTES.md` (for GitHub release)
715-
2. `docs/releases/${{ github.event.release.tag_name }}.mdx` (for documentation site)
756+
2. `docs/releases/${{ steps.tag.outputs.TAG_NAME }}.mdx` (for documentation site)
716757
717758
## MANDATORY: Review Your Changes
718759
After writing the release notes files, you MUST:
@@ -725,8 +766,9 @@ jobs:
725766
Do NOT skip this review step - always verify your output before completing.
726767
727768
- name: Verify and validate release notes
769+
if: steps.tag.outputs.SKIP != 'true'
728770
env:
729-
TAG_NAME: ${{ github.event.release.tag_name }}
771+
TAG_NAME: ${{ steps.tag.outputs.TAG_NAME }}
730772
run: |
731773
echo "Checking for generated release notes..."
732774
@@ -746,8 +788,9 @@ jobs:
746788
python util/validate_release_notes.py "docs/releases/$TAG_NAME.mdx" --tag "$TAG_NAME"
747789
748790
- name: Update docs.json with new release
791+
if: steps.tag.outputs.SKIP != 'true'
749792
env:
750-
TAG_NAME: ${{ github.event.release.tag_name }}
793+
TAG_NAME: ${{ steps.tag.outputs.TAG_NAME }}
751794
run: |
752795
# Add the new release to docs.json navigation
753796
# Insert at the beginning of the releases array (newest first)
@@ -801,13 +844,15 @@ jobs:
801844
802845
with open(docs_json_path, 'w') as f:
803846
json.dump(docs, f, indent=2)
847+
f.write('\n') # Ensure trailing newline for linting
804848
805849
print(f"✅ Added {new_page} to docs.json")
806850
EOF
807851
808852
- name: Bump version.py to next patch version
853+
if: steps.tag.outputs.SKIP != 'true'
809854
env:
810-
TAG_NAME: ${{ github.event.release.tag_name }}
855+
TAG_NAME: ${{ steps.tag.outputs.TAG_NAME }}
811856
run: |
812857
# Extract version from tag (strip 'v' prefix if present)
813858
RELEASED_VERSION="${TAG_NAME#v}"
@@ -838,9 +883,10 @@ jobs:
838883
echo "✅ version.py bumped to $NEXT_VERSION"
839884
840885
- name: Commit release notes and version bump
886+
if: steps.tag.outputs.SKIP != 'true'
841887
env:
842888
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
843-
TAG_NAME: ${{ github.event.release.tag_name }}
889+
TAG_NAME: ${{ steps.tag.outputs.TAG_NAME }}
844890
NEXT_VERSION: ${{ env.NEXT_VERSION }}
845891
run: |
846892
git config user.name "github-actions[bot]"
@@ -858,20 +904,26 @@ jobs:
858904
fi
859905
860906
- name: Update GitHub Release
907+
if: steps.tag.outputs.SKIP != 'true'
861908
env:
862909
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
863-
TAG_NAME: ${{ github.event.release.tag_name }}
910+
TAG_NAME: ${{ steps.tag.outputs.TAG_NAME }}
864911
run: |
865912
echo "Updating GitHub release with generated notes..."
866913
gh release edit "$TAG_NAME" --notes-file RELEASE_NOTES.md
867914
echo "✅ GitHub release updated successfully"
868915
869916
- name: Notify on failure
870-
if: failure()
917+
if: failure() && steps.tag.outputs.SKIP != 'true'
871918
env:
872919
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
873-
TAG_NAME: ${{ github.event.release.tag_name }}
920+
TAG_NAME: ${{ steps.tag.outputs.TAG_NAME || github.event.workflow_run.head_branch }}
874921
run: |
922+
# Fallback if TAG_NAME is empty
923+
if [ -z "$TAG_NAME" ]; then
924+
TAG_NAME="unknown"
925+
fi
926+
875927
gh issue create \
876928
--title "⚠️ Release notes generation failed for $TAG_NAME" \
877929
--body "The automated release notes generation for **$TAG_NAME** failed.

.github/workflows/docs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
- 'docs/**'
1414
- '.github/workflows/docs.yml'
1515

16+
# Cancel in-progress runs when a new run is triggered
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
19+
cancel-in-progress: true
20+
1621
jobs:
1722
validate:
1823
runs-on: ubuntu-latest

.github/workflows/lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
merge_group:
1919
workflow_dispatch:
2020

21+
# Cancel in-progress runs when a new run is triggered
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
24+
cancel-in-progress: true
25+
2126
permissions:
2227
contents: read
2328

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
2+
# SPDX-License-Identifier: MIT
3+
4+
# Notifies PR authors when their PR fails in the merge queue
5+
# Watches for workflow completions triggered by merge_group events
6+
7+
name: Merge Queue Failure Notification
8+
9+
on:
10+
workflow_run:
11+
workflows:
12+
- "GAIA CLI Tests (All Platforms)"
13+
- "Code Quality (Lint)"
14+
- "Unit Tests"
15+
types:
16+
- completed
17+
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
actions: read
22+
23+
jobs:
24+
notify-on-failure:
25+
name: Notify on Merge Queue Failure
26+
runs-on: ubuntu-latest
27+
# Only run if the triggering workflow was from a merge_group and failed
28+
if: >
29+
github.event.workflow_run.event == 'merge_group' &&
30+
github.event.workflow_run.conclusion == 'failure'
31+
steps:
32+
- name: Post failure comment to PR
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
// Extract PR number from merge queue branch name (e.g., gh-readonly-queue/main/pr-254-...)
37+
const headBranch = context.payload.workflow_run.head_branch || '';
38+
const prMatch = headBranch.match(/pr-(\d+)/);
39+
40+
if (!prMatch) {
41+
console.log('Could not extract PR number from branch:', headBranch);
42+
console.log('This may not be a merge queue run');
43+
return;
44+
}
45+
46+
const prNumber = parseInt(prMatch[1], 10);
47+
const workflowRun = context.payload.workflow_run;
48+
const runUrl = workflowRun.html_url;
49+
const workflowName = workflowRun.name;
50+
51+
// Get the failed jobs for more detail
52+
const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
53+
owner: context.repo.owner,
54+
repo: context.repo.repo,
55+
run_id: workflowRun.id,
56+
});
57+
58+
const failedJobs = jobs.jobs.filter(job => job.conclusion === 'failure');
59+
const failedJobsList = failedJobs.length > 0
60+
? failedJobs.map(job => ` - [${job.name}](${job.html_url})`).join('\n')
61+
: ' - Check workflow run for details';
62+
63+
const body = `## Merge Queue Failure
64+
65+
Your PR was removed from the merge queue due to test failures in **${workflowName}**.
66+
67+
**Failed jobs:**
68+
${failedJobsList}
69+
70+
**Full workflow run:** [View logs](${runUrl})
71+
72+
<sub>This comment was automatically generated.</sub>`;
73+
74+
// Check if we already posted a comment for this run to avoid duplicates
75+
const { data: comments } = await github.rest.issues.listComments({
76+
owner: context.repo.owner,
77+
repo: context.repo.repo,
78+
issue_number: prNumber,
79+
});
80+
81+
const existingComment = comments.find(c =>
82+
c.body.includes('Merge Queue Failure') &&
83+
c.body.includes(runUrl)
84+
);
85+
86+
if (existingComment) {
87+
console.log('Comment already exists for this run, skipping');
88+
return;
89+
}
90+
91+
await github.rest.issues.createComment({
92+
owner: context.repo.owner,
93+
repo: context.repo.repo,
94+
issue_number: prNumber,
95+
body: body,
96+
});
97+
98+
console.log(`Posted failure notification to PR #${prNumber}`);

.github/workflows/test_agent_mcp_server.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ on:
1515
merge_group:
1616
workflow_dispatch:
1717

18+
# Cancel in-progress runs when a new run is triggered
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
21+
cancel-in-progress: true
22+
1823
jobs:
1924
test-mcp-agent:
2025
name: Test MCPAgent (${{ matrix.os }})
@@ -106,7 +111,10 @@ jobs:
106111
name: Test Summary
107112
needs: test-mcp-agent
108113
runs-on: ubuntu-latest
109-
if: always()
114+
# Run always except when workflow or dependency is cancelled
115+
if: >-
116+
${{ always() && !cancelled() &&
117+
needs.test-mcp-agent.result != 'cancelled' }}
110118
permissions: {}
111119

112120
steps:

.github/workflows/test_api.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
merge_group:
1717
workflow_dispatch:
1818

19+
# Cancel in-progress runs when a new run is triggered
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
22+
cancel-in-progress: true
23+
1924
permissions:
2025
contents: read
2126

.github/workflows/test_chat_agent.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
merge_group:
1717
workflow_dispatch:
1818

19+
# Cancel in-progress runs when a new run is triggered
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
22+
cancel-in-progress: true
23+
1924
permissions:
2025
contents: read
2126

0 commit comments

Comments
 (0)