fix(ci): rebase+retry push in deploy/staging workflows to avoid fetch-first rejection - #240
Merged
Merged
Conversation
…pe * The auth-types.gen generator hard-coded a 14-type re-export list from the auth plugin's auth-export, causing TS2724 errors when the auth plugin renamed or added types (e.g. GetOrganizationInput -> GetFullOrganizationInput, and AuthTeam was missing entirely). Replace the hard-coded list with 'export type * from auth-export' in all five locations (the main generator, the init scaffold, and the test stub). New types added to auth-export now flow through automatically. Updates the init and test stubs with the corrected GetFullOrganizationInput name and adds AuthTeam. Adds a regression test that verifies the generator produces export type * and would not reference a stale hard-coded name like GetOrganizationInput. See NEARBuilders/nearbuilders.org#206
…ype * Three duplicated copies of the auth-types.gen template (api-contract.ts x2, init.ts x1) plus two hard-coded stub type lists (init.ts, typecheck-utils.ts) are replaced with a single shared module: packages/everything-dev/src/auth-types-gen.ts. Also removes three unused derived types (AuthActiveMember, AuthBaseSession, AuthContractType) and all Raw* aliases from the generated content. Adds export type * to host/src/lib/auth.ts, ui/src/lib/auth.ts, and api/src/lib/auth.ts so new auth types propagate automatically — no manual re-export list to maintain when upstream auth-export changes. Deletes the flaky init.typecheck.test.ts which attempted to skip the network fetch. init.full.test.ts already covers the full init + types:gen + typecheck flow in CI. See NEARBuilders/nearbuilders.org/issues/206
…-first rejection The final push step in `Deploy` and `Staging` workflows ran unconditionally on a local checkout from the start of the run. Any commit landing on the target branch during the 10-20 minute deploy window (Release's auto-merged `chore: version packages` PR, manual `workflow_dispatch`, Renovate, or human commits) made the push non-fast-forward and Git rejected it with `! [rejected] main -> main (fetch first)`. Replace the push with a fetch + rebase + retry loop: - git fetch origin $TARGET_BRANCH - git rebase origin/$TARGET_BRANCH (clean conflicts fail loudly) - git add bos.config.json - exit 0 if no staged changes after rebase - git push origin $TARGET_BRANCH, retry up to 5x with 5/10/15/20/25s backoff Applied to both the live workflows and the templates that ship to child projects via `bos sync`. `cancel-in-progress` left as-is to preserve the existing 'don't kill in-flight deploy' semantics.
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.
Replace the unconditional
git pushinDeployandStagingworkflows with a fetch + rebase + retry loop. Eliminates! [rejected] main -> main (fetch first)failures when remote advances during the 10-20 min deploy window (Release PR merges, manualworkflow_dispatch, Renovate, human commits).Changes
.github/workflows/deploy.yml— live parent Deploy.github/templates/workflows/deploy.yml— template for child projects.github/workflows/staging.yml— live parent Staging.github/templates/workflows/staging.yml— template for child projects.changeset/fix-deploy-push-fetch-first.md— patch changesetLoop semantics
git fetch origin $TARGET_BRANCHrefreshes the remote-tracking refgit rebase origin/$TARGET_BRANCHreplays local commit on top of remote tipgit add bos.config.json+git diff --cached --quietexits 0 if nothing to pushgit pushretried up to 5 times with 5/10/15/20/25s backoffNot changed
concurrency.cancel-in-progress: falsepreserved — rebase fix already handles every race; existing semantics ("don't kill in-flight deploy") kept.