fix(#1356): tea login resolution fails closed on a declared git identity (#1361)
ci/woodpecker/push/publish Pipeline was canceled

Co-authored-by: fred <[email protected]>
This commit was merged in pull request #1361.
This commit is contained in:
2026-08-21 23:04:31 +00:00
committed by gate-merge-01
parent 24462f460e
commit 888a6ad29b
13 changed files with 519 additions and 19 deletions
@@ -76,7 +76,22 @@ exit 0
EOF
chmod +x "$MOCK_BIN/tea"
}
# #1356: login resolution is now identity-aware, so the tea-branch fixture must
# offer the login the RUNNER's identity resolves to; otherwise every case below
# fails closed before reaching the branch under test.
#
# This does NOT make the suite hermetic, and it is not trying to. The API-path
# cases (5-7) need a usable Gitea token, and with an identity set the token path
# reads that seat's credential file rather than the GITEA_TOKEN exported above.
# So this suite passes only where the runner owns a real credential for its own
# identity, and fails with no identity at all -- on this branch and on its base
# alike. That is a pre-existing hole in the fixture, filed separately; pinning a
# synthetic identity here would only convert it into a confident-looking green.
_LOGIN_IDENT="${MOSAIC_GIT_IDENTITY:-}"
LOGIN_JSON='[{"name":"git.mosaicstack.dev","url":"https://git.mosaicstack.dev"}]'
if [[ -n "$_LOGIN_IDENT" ]]; then
LOGIN_JSON='[{"name":"mosaicstack-'"$_LOGIN_IDENT"'","url":"https://git.mosaicstack.dev"},{"name":"git.mosaicstack.dev","url":"https://git.mosaicstack.dev"}]'
fi
# The mocks must be the ones that run. Without this, a failed setup silently falls through
# to the real tea/curl and the "test" mutates the real provider.