Commit 0de0440
fix(ci): use three-dot diff to detect only PR changes in build workflow (opendatahub-io#2876)
* fix(tests): update test_get_build_directory to expect Python 3.12
The test was checking for ubi9-python-3.11 but the actual directory uses
ubi9-python-3.12. Update the assertion to match the current codebase state.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ci): use three-dot diff to detect only PR changes in build workflow
The build workflow was using a two-dot git diff which compares the complete
state of two commits. When main advances with new commits after a PR branch
is created, the two-dot diff shows ALL differences between the branches,
including files that changed in main but not in the PR.
This caused false positive build triggers. For example, PR opendatahub-io#2874 only changed
scripts/README.md and scripts/sbom_analyze.py, but the CI detected 20 changed
files (including all pylock.toml files that were updated in main by PR opendatahub-io#2873
after PR opendatahub-io#2874 was created), triggering unnecessary builds for all workbench
images.
Fix: Change from two-dot diff (A B) to three-dot diff (A...B) which shows
changes from the merge-base of A and B to commit B. This correctly identifies
only the changes introduced by the PR, regardless of how much main has
advanced.
Fixes: opendatahub-io#2875
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent cc43ca9 commit 0de0440
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | | - | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
160 | | - | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
0 commit comments