Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,13 @@ jobs:
)
& cmake --build build --config Release --parallel 2 --target $targets
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "HARMONY_FAT_NATIVE_TARGETS=$($targets.Count) SOURCE_SHA=$env:GITHUB_SHA"
# github.sha is the trusted workflow ref when dispatched from main,
# not the source commit of a long-lived candidate PR.
$sourceSha = (& git rev-parse HEAD).Trim()
if ($LASTEXITCODE -ne 0 -or $sourceSha -ne '${{ inputs.expected_sha }}') {
throw "HARMONY_FAT_SOURCE_SHA_MISMATCH expected=${{ inputs.expected_sha }} actual=$sourceSha"
}
Write-Host "HARMONY_FAT_NATIVE_TARGETS=$($targets.Count) SOURCE_SHA=$sourceSha"

- name: Build executable and native RT tests
if: ${{ env.FOCUSED_HARMONY_FAT != 'true' }}
Expand Down
7 changes: 6 additions & 1 deletion scripts/chat_ci_dispatch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,13 @@ export async function performMilestone({event,repo,api}) {
const inputs=target.lane==='ui'?{expected_sha:target.sha}:
{expected_sha:target.sha,package_fat:target.lane==='fat',
...(focusedHarmony?{focused_harmony_fat:true}:{})};
// An old, still-open PR may predate the new focused-FAT workflow input.
// Execute the reviewed latest workflow FROM main, but the native job
// checks out inputs.expected_sha and verifies its exact 40-hex identity.
// This avoids silently running stale all-target YAML from a long-lived PR.
const workflowRef=focusedHarmony?'main':target.branch;
await api('/actions/workflows/'+target.workflow+'/dispatches','POST',
{ref:target.branch,inputs});
{ref:workflowRef,inputs});
return {kind:'dispatched',target};
}
async function main(){
Expand Down
3 changes: 2 additions & 1 deletion tests/chat_ci_dispatch_contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ test('file-scoped Harmonice FAT is opt-in only with complete, isolated PR file p
});
assert.equal(eligible.kind,'dispatched');
assert.deepEqual(calls.at(-1),{
ref:harmonyPr.head.ref,
// The CI definition comes from main; the source still comes from SHA.
ref:'main',
inputs:{expected_sha:sha,package_fat:true,focused_harmony_fat:true}
});
await performMilestone({
Expand Down
5 changes: 5 additions & 0 deletions tests/ci_workflow_efficiency_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ test('Full native/release qualification retains all CTests; isolated Harmonice F
assert.match(native, /'ARMixCrackleWindowTests'/);
assert.match(native, /FOCUSED_FAT_MISSING_REQUIRED_TESTS/);
assert.match(native, /FULL_SUITE_NOT_CLAIMED/);
// An old PR can retain outdated workflow YAML; focused execution must
// use a trusted main workflow and still build the exact PR input SHA.
assert.match(read('scripts/chat_ci_dispatch.mjs'),
/workflowRef=focusedHarmony\?'main':target\.branch/);
assert.match(native, /HARMONY_FAT_SOURCE_SHA_MISMATCH/);
});

test('approved Pages to JUCE build seam is a native gate, never an unrelated CSS-only job', () => {
Expand Down
Loading