fix(tia): persist state on detached HEAD - #1844
Closed
calebdw wants to merge 2 commits into
Closed
Conversation
calebdw
force-pushed
the
calebdw/push-owkpumrmwusw
branch
3 times, most recently
from
August 17, 2026 22:26
b794a6b to
63427c7
Compare
Contributor
Author
|
@nunomaduro, I came across this while testing the GitLab tia work---this is needed to support recording tia in gitlab ci |
2 tasks
calebdw
force-pushed
the
calebdw/push-owkpumrmwusw
branch
2 times, most recently
from
August 25, 2026 20:34
d8bd0f8 to
b373978
Compare
Contributor
Author
|
@MrPunyapal, can you please take a look at this? This is a blocker to be able to properly support Gitlab (#1841) |
Contributor
Author
|
Nice, let me fix the tests |
Consolidate duplicated CI environment detection logic from Snapshot and BaselineSync into a shared Pest\Support\Ci class. This reduces duplication and provides a single source of truth for CI detection, including comprehensive environment variable checks for all major CI providers.
Allow detached checkouts to write, delete, and rebuild TIA state so baseline publishers and local detached workflows produce a usable graph. Resolve the writable baseline from the Git branch, CI branch metadata, or a stable workspace key. Keep the default branch as the read fallback so local workspaces can use a published baseline without changing it.
calebdw
force-pushed
the
calebdw/push-owkpumrmwusw
branch
from
August 26, 2026 15:55
b373978 to
0760b4e
Compare
Contributor
Author
|
@MrPunyapal, can you run ci again please? |
Collaborator
|
MrPunyapal
approved these changes
Aug 26, 2026
Contributor
Author
|
I guess ci is down again lol |
Collaborator
|
Can you try doing a new PR? |
2 tasks
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.

What:
Description:
This allows TIA to persist its dependency graph and related state when Git HEAD is detached.
Detached HEAD is a normal checkout state for GitLab CI and for local workflows that use jj with a colocated Git repository. TIA previously suppressed graph writes, state deletion, structural rebuilds, and
--freshpurges in this state. A run could therefore pass without producing the graph required by a baseline artifact or a later local run.TIA now permits the same state operations for attached and detached checkouts. It resolves the writable baseline identity in this order:
@workspace:<hash>key for jj and other detached workspaces.The default branch remains the read fallback. A local detached workspace can download a baseline recorded on the default branch, calculate changes from that baseline, and store its own SHA, tree, and test results under its workspace key. This prevents an unknown detached checkout from changing the published default-branch baseline.
The TIA CI abstraction now resolves both current and default branches, so each provider owns its environment-variable handling. Workspace baselines survive Git branch reclamation and do not participate in default-branch inference.
The tests cover sequential and parallel detached runs, structural rebuilds,
--fresh, unreadable graph replacement, branch reclamation, default-baseline isolation, and detached GitLab and GitHub branch detection. The fixture process also removes inherited CI variables so local-behavior tests remain local when the Pest suite itself runs in CI.Thanks!