Honor impersonation_chain in deferred Cloud Build tasks - #71644
Merged
potiuk merged 1 commit intoAug 27, 2026
Merged
Conversation
The trigger accepted, stored and serialized the impersonation chain but built its hook without it, so a task that deferred authenticated as the connection's service account instead of the impersonated one. The synchronous path was unaffected, which made the divergence hard to spot.
Contributor
Author
|
Gentle ping on this one, it's been open since 12 August with no review yet. It's a small change: the Cloud Build trigger builds its own hook on deferral and never receives the operator's Happy to rebase or split it differently if that would help review. |
potiuk
approved these changes
Aug 27, 2026
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
The trigger accepted, stored and serialized the impersonation chain but built its hook without it, so a task that deferred authenticated as the connection's service account instead of the impersonated one. The synchronous path was unaffected, which made the divergence hard to spot.
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.
CloudBuildCreateBuildTriggeraccepts animpersonation_chain, stores it, andserializes it — but built its hook without it:
So the value travels correctly from
CloudBuildCreateBuildOperatorall the way into thetriggerer and is then discarded at the point of use. Once a
CloudBuildCreateBuildOperatortask defers, its polling calls authenticate as the connection's service account rather than
the impersonated one.
Two ways this surfaces:
deferred poll fails with a 403 that does not mention impersonation;
the Dag author did not select.
The non-deferrable path is unaffected, so switching
deferrableoff appears to "fix" it.Worth noting for reviewers:
GoogleBaseHook.__init__falls back to the connection'simpersonation_chainextra when the argument is absent, so deployments that configureimpersonation on the connection were never affected. The bug is limited to impersonation
configured on the operator — which is the documented parameter on every Google operator.
No newsfragment: this is a provider change, and provider changelogs are regenerated from
git logby the release manager.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines