Repository navigation
ci(format): check every commit on dispatch runs; gersemi checks the full tree - #14
Merged
Merged
Conversation
…ull tree check-changes compared workflow_dispatch (and schedule) runs against HEAD~1, so only the branch's last commit was format-checked. The Pull run dispatched for PR #10 (into grind/meta-4-7c2e) ran on a commit that touched only rust-unexports-macos.txt, so gersemi was skipped while libobs/cmake/rust.cmake was unformatted. Such runs now compare against the merge-base with origin/<default branch>. gersemi checks the whole tree in about a second, so run-gersemi no longer depends on the changed-files list at all. Also fix the `>> GITHUB_OUTPUT` typo (missing $) in check-changes, and format rust.cmake (same hunk as PR #12). Refs #13
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 1 of #13: why
Format / gersemipassed whilelibobs/cmake/rust.cmakewas unformatted, and the fix.Root cause
rust.cmakewas last changed in ae123c3 (PR #10, basegrind/meta-4-7c2e).pr-pull.yamlonly firespull_requestformaster, so PR #10's CI came fromworkflow_dispatchruns ofPull. In.github/actions/check-changes, any event other thanpull_request/pushusedHEAD~1as the base. Only the branch's last commit was checked.In the final dispatch run (37864081724, job
Format / gersemi, green), HEAD was 093b539, which touched onlyrust-unexports-macos.txt. The log showsGIT_BASE_REF:empty,hasChangedFiles=false, and the install and run steps skipped. PR #9 (meta → master) did run gersemi on the right diff, and it failed onrust.cmake(job 113611353780).run-clang-formatuses the samecheck-changesaction, so it had the same gap. This PR fixes that too.Unrelated bug in the same file: the no-changes branch wrote
changedFiles=[]to a file literally namedGITHUB_OUTPUT(the$was missing).Fix
check-changes: forworkflow_dispatch,scheduleand similar events, diff againstgit merge-base HEAD origin/<default branch>(fromgithub.event.repository.default_branch).HEAD~1is still the fallback when HEAD is on the default branch or the ref is missing. Every commit a dispatched branch adds is now checked, by clang-format too. Also fixed the$GITHUB_OUTPUTtypo.run-gersemi: no changed-files list. It runsbuild-aux/run-gersemi --checkover the full tree, which takes about 1 s for 198 files locally. A wrong base can no longer hide an unformatted CMake file. clang-format keeps the changed-files list because a full-tree serial check takes about 2m40s; the base fix covers it.libobs/cmake/rust.cmake: formatted. The hunk is identical to PR ci: local gate + attestation skips, quick gate for full builds, ccache for Tier 2 #12's, so the two merge cleanly. Without it, the now full-tree gersemi check would fail on master.RED → GREEN
Repro harness (below). It runs the
run:script ofcheck-changes/action.yamlin a scratch clone set up like the dispatch run: HEAD=093b539f7,origin/master=e18bd465b (master before #9),GITHUB_EVENT_NAME=workflow_dispatch, glob'*.cmake' '*CMakeLists.txt'.RED (origin/master action):
GREEN (this branch):
Full-tree
./build-aux/run-gersemi --fail-error --check(gersemi 0.25.0), as the action now runs it:✖︎ libobs/cmake/rust.cmake requires formatting changes.exit 2repro_check_changes.py
./lint,./unittestandlocal-gate.tomldo not exist on master yet (they come with PR #12), so the local gate was not run. The change is CI-only, plus the one formatting hunk inrust.cmake.Refs #13