Remove legacy user generation label handling - #69335
Merged
Merged
Conversation
strideynet
changed the base branch from
master
to
strideynet/fix-delegated-bot-instance-missing
August 4, 2026 18:36
Contributor
|
Amplify deployment status
Preview links for changed docs pages |
strideynet
commented
Aug 4, 2026
Base automatically changed from
strideynet/fix-delegated-bot-instance-missing
to
master
August 5, 2026 10:35
strideynet
force-pushed
the
strideynet/remove-legacy-generation-label
branch
from
August 5, 2026 11:06
085a483 to
2412e14
Compare
strideynet
force-pushed
the
strideynet/remove-legacy-generation-label
branch
from
August 5, 2026 12:56
04a54c2 to
351c592
Compare
strideynet
force-pushed
the
strideynet/remove-legacy-generation-label
branch
from
August 5, 2026 14:48
351c592 to
e8cb1d2
Compare
strideynet
marked this pull request as ready for review
August 5, 2026 15:08
github-actions
Bot
requested review from
bernardjkim,
boxofrad,
hugoShaka,
mmcallister,
ptgott,
r0mant,
rodgtr1,
roraback,
tigrato,
timothyb89 and
zmb3
August 5, 2026 15:09
strideynet
removed request for
bernardjkim,
hugoShaka,
ptgott,
rodgtr1 and
zmb3
August 5, 2026 15:48
ptgott
approved these changes
Aug 6, 2026
timothyb89
approved these changes
Aug 6, 2026
timothyb89
left a comment
Contributor
There was a problem hiding this comment.
Nice to see the legacy counter gone!
strideynet
temporarily deployed
to
docs-amplify
August 10, 2026 09:21 — with
GitHub Actions
Inactive
strideynet
temporarily deployed
to
docs-amplify
August 10, 2026 11:59 — with
GitHub Actions
Inactive
tigrato
approved these changes
Aug 10, 2026
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.
Closes #64484
A long long time ago, we stored a generation counter on the Bot User as a label. Less long ago, we began to migrate to storing this generation counter on Bot Instances.
As part of this migration, we continued to write the legacy generation counter label (to support downgrade paths gracefully) and included logic which would create a Bot Instance, if one did not exist, from the bot user label. This migration began in #44583 - and began without an experiment flag in v17.0.0.
From this PR onwards:
I also took this opportunity to clean up the
updateBotInstancemethod - this had become very difficult to understand and had a number of branches. As the migration to Bot Instances took place long enough ago, we can now safely assume things like the Generation and BotInstanceID will be encoded in identities.Open question:
Is treating BotInstance not found as a generation mismatch (and hence a lock for Token/Bound Keypair joining) reasonable? Locking the join token is quite a drastic action and prevents self-recovery (for bound keypair). I went with this approach in the PR, since it most closely tracks the existing behaviour today.
As far as I can tell, there are two cases where we may expect the BotInstance to not be found:
It seems increasingly reasonable to me that we may wish to treat this as an error and reject the renewal without locking. This would allow self-recovery for Bound Keypair. However, I do believe this would be better explored in a separate PR as this would constitute a change in behaviour and security model. We would need to ensure that the Bound Keypair logic can handle the underlying layers changing the BotInstanceID. It doesn't necessarily resolve the problem either - since generation mismatch would be triggered if the BotInstance was rolled back to a prior counter value (and not non-existent).
Changelog:
Manual Test Plan
Test Environment
Local cluster
Test Cases
Agentic test plan: https://gist.github.com/strideynet/f2c237c0652cce84bab1b2d2a8303b9d