Repository navigation
v2.17.2
A forced push to a local build no longer fails with no reason. [build] repo is checked for its shape. A service with no token no longer names a credential helper that does not exist.
Fixed
- A
localbuild with the same repo URL and a replaced history (a forced push with an unrelated root commit) rangit pull, which stopped with exit 128 (fatal: Need to specify how to reconcile divergent branches). The failure was the generic "Webhook deploy failed" with no reason, and the circuit breaker counted it. The only way out was a manual full-build mark on the box. Alocalbuild now updates its checkout as aremotebuild does:git fetchof the deploy branch, thengit reset --hard FETCH_HEAD. The checkout is build-only, so any history moves it. A fetch that fails ends in the existing loud path ("Repo fetch failed", onebuild.failedalert with the likely cause), not in the ERR trap. rebuild.shnow asks after the reset whether the old head (the checkout's HEAD before the fetch, as the service saw it) is an ancestor of the new head (git merge-base --is-ancestor). When it is not, or when git cannot find the old commit, the history was rewritten: the build is a full build, with the mark of a new checkout (.git/bay-full-build/<container>). No config-only tag and no no-input-change tag use the old commit. The log sayshistory of <container> was rewritten (<old12> is not in <new12>), full build. When the old head is an ancestor, nothing changes. Aremotebuild did not fail on this, but it did not look either: it built because nothing used the old commit (the receiver writes no no-input-change marker for a force push, and the old commit stays in the checkout forgit diff). A trigger file with that marker, after a rewrite that kept the same tree, was a tag-only push of the old image. It now takes the same explicit full-build path.- A service with no token had
GIT_ASKPASSset to a helper file that Ansible writes only for a service with a token. A publichttps://repo that answered 401 or 404 made git run the missing file, and the failure reason readfatal: cannot exec '<...>/.git-askpass-<name>': No such file or directory.rebuild.shnow setsGIT_ASKPASSonly for a service with a token, in both strategies. A service with no token keepsGIT_TERMINAL_PROMPT=0, so git fails at once with its own message. The lines of a service with a token are unchanged.
Changed
bay toml validate,bay planandbay upnow refuse a[build] repothat is not a git URL or an absolute path. Accepted:https://,http://,ssh://,git://andfile://URLs with a host and a path,user@host:path, and an absolute local path. Refused: an empty value, a space inside, a bare word, a relative path. Message:build.repo: "<value>" is not a git URL or an absolute path; use for example git@github.com:org/repo.git or https://github.com/org/repo.git.- A URL with a password or a token inside (
https://user:secret@host/...,https://token@host/...) is refused too. The message shows the URL redacted and says to give the token inrepo_tokensinbay.fleet.tomlinstead. The secret is never printed. Thebay.lockrepois not checked: it is written by the CLI from the origin of a checkout, and a check there could stop abay upafter it touched a box. - Docs:
docs/build-pipeline.mdreplaces the "known limit" of a local build with a replaced history by what now happens (no manual step), and explains the ancestor rule and the no-token case.docs/bay-toml.mdnames the accepted forms at therepokey.
Upgrade notes
- The build script fixes reach a box with the next
bay up(orbay deploy), which rendersrebuild.shagain. The upgrade recreates no container:rebuild.shis a plain file that no container hash or handler reads. The container config hash, thecom.bay.receiver-hash(the receiver files) and thecom.bay.receiver-config-hash(the receiver config and the image map) read none of the files this release changes. - The next push after the upgrade is a normal one. A
localbuild moves fromgit pullto fetch and reset, with the same result for a push that adds commits. - Run
bay toml validatein a project beforebay up. A[build] repothat is a relative path or has a space in it was never usable by git on the box, andbay plannow stops on it. A token in a repo URL moves torepo_tokensinbay.fleet.toml.