Skip to content

Commit eb0a0ae

Browse files
chongchongheclaude
andauthored
fix(ci): use merge base in quick pipelines to detect changed problems (#1994)
### Description Fix the "Detect changed problems" step in the quick CI pipelines to diff against the merge base rather than the tip of the target branch. Previously, `git diff --name-only FETCH_HEAD HEAD` compared the PR's HEAD to the current tip of `development`. Because most PRs branch off an older commit, any problem files merged into `development` after the branch point also appeared as "changed" — causing the quick pipeline to build and test far more problems than the PR actually touched. The fix fetches enough history (`--deepen=100`) and uses `git merge-base FETCH_HEAD HEAD` to find the true common ancestor, then diffs only from that point to HEAD. ### Related issues N/A ### Checklist _Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an `x` inside the square brackets `[ ]` in the Markdown source below:_ - [x] I have added a description (see above). - [x] I have added a link to any related issues (if applicable; see above). - [x] I have read the [Contributing Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md). - [x] I have added tests for any new physics that this PR adds to the code. - [x] *(For quokka-astro org members)* I have manually triggered the GPU tests with the magic comment `/azp run`. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f4323d0 commit eb0a0ae

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.ci/azure-pipelines-quick-amdgpu.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ jobs:
4040
- script: |
4141
TARGET_BRANCH=$(echo "$(System.PullRequest.TargetBranch)" | sed 's|refs/heads/||')
4242
[ -z "$TARGET_BRANCH" ] && TARGET_BRANCH="development"
43-
git fetch --deepen=1 origin "$TARGET_BRANCH"
44-
CHANGED=$(git diff --name-only FETCH_HEAD HEAD)
43+
git fetch --deepen=100 origin "$TARGET_BRANCH"
44+
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
45+
CHANGED=$(git diff --name-only "$MERGE_BASE" HEAD)
4546
PROBLEMS=$(echo "$CHANGED" | grep '^src/problems/' | awk -F'/' '{print $3}' | sort -u | grep -v '^$')
4647
if [ -z "$PROBLEMS" ]; then
4748
echo "##[section]No src/problems/ files changed in this PR."

.ci/azure-pipelines-quick.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ jobs:
4040
- script: |
4141
TARGET_BRANCH=$(echo "$(System.PullRequest.TargetBranch)" | sed 's|refs/heads/||')
4242
[ -z "$TARGET_BRANCH" ] && TARGET_BRANCH="development"
43-
git fetch --deepen=1 origin "$TARGET_BRANCH"
44-
CHANGED=$(git diff --name-only FETCH_HEAD HEAD)
43+
git fetch --deepen=100 origin "$TARGET_BRANCH"
44+
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
45+
CHANGED=$(git diff --name-only "$MERGE_BASE" HEAD)
4546
PROBLEMS=$(echo "$CHANGED" | grep '^src/problems/' | awk -F'/' '{print $3}' | sort -u | grep -v '^$')
4647
if [ -z "$PROBLEMS" ]; then
4748
echo "##[section]No src/problems/ files changed in this PR."

0 commit comments

Comments
 (0)