Repository navigation
fix: never leave pool members or images behind, and have sessions ready ahead of time - #43
Merged
Merged
Conversation
…dy ahead of time - Every session listing destroys pooled sessions nothing would claim (pool off or no image, dead, past the recycle age, fills that never parked) and bake instances whose bake died, across all repos. - Session images carry an owner tag and the cloud is their record: setup and creates adopt the newest image the config lost track of, and a bake deletes every older image of its repo. - A repo with .pier/bake.sh requires a session image: creates and pool fills refuse instead of launching the stock image, and setup bakes it without asking. - Pools fill right after setup and after every bake, not only after a create; pool counts show only claimable sessions. - pier bake returns once the image is being saved; a background finish waits for it, records it, deletes what it replaces and fills the pool. - The app's header tabs keep their positions when the reminder dot appears or the active tab changes.
Contributor
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Sessions got user.name and user.email only when set explicitly in git config and only in the one checkout, so a git that falls back to the OS account's full name produced sessions whose commits failed. The identity now comes from git var (fallbacks included) and becomes the session's global config, with portable settings like pull.rebase alongside; laptop-only settings stay behind, the prebuild scrub drops the global config, and a machine with no identity at all is refused at create.
Contributor
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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 does this PR do and why?
Pier's cleanup and readiness depended on local state and on the user taking the next step. When that state was missing or stale, pier left cloud resources billing, launched sessions that couldn't work, and waited for a create before doing work that could have happened earlier. This PR makes the cloud the record and has pier act without being asked:
.pier/bake.shcan't work on the stock image. Creates and pool fills now refuse instead of launching it and failing in setup, and setup bakes such a repo without asking.pier bakenow returns once saving starts. A background finish waits for the image, releases the bake instance, records the image, deletes what it replaces and fills the pool. On GCE the bake instance name is now unique, so a new bake doesn't collide with one still saving.user.name/user.emailonly when they were set explicitly in git config, and only in the one checkout. A git that falls back to the OS account's full name (macOS does) produced sessions whose commits failed. The identity now comes fromgit var GIT_AUTHOR_IDENT, fallbacks included, and becomes the session's global git config. Portable settings likepull.rebaseandpush.autoSetupRemotecome along. Credential helpers, includes and signing stay behind, and the prebuild scrub drops the global config. A machine with no identity at all is refused at create.Related issue
None.
Tests
TestSweepablecovers which sessions the listing sweep collects.TestGitConfigCarriesTheEffectiveIdentity: the fallback identity carries over, portable settings come along, laptop-only settings stay behind, and a missing name is rejected.TestFinishBakeReleasesTheBakeInstance: the bake instance is terminated once the image is available, and both are left alone while it is still saving.go test ./...,go vet ./...,gofmt -landmake buildall pass.Checklist
gofmt -l .produces no output andgo vet ./...passesmake buildsucceeds (if this touches supervisor/session code)