Feat!: Differentiate between deployable and non-deployable snapshots during plan evaluation#1610
Merged
izeigerman merged 13 commits intomainfrom Oct 30, 2023
Merged
Conversation
632404f to
5420b20
Compare
tobymao
reviewed
Oct 25, 2023
tobymao
reviewed
Oct 25, 2023
5420b20 to
cfc0c71
Compare
eakmanrq
reviewed
Oct 26, 2023
d6ee840 to
12a86d0
Compare
tobymao
reviewed
Oct 27, 2023
tobymao
reviewed
Oct 27, 2023
tobymao
reviewed
Oct 27, 2023
tobymao
reviewed
Oct 27, 2023
tobymao
reviewed
Oct 27, 2023
tobymao
approved these changes
Oct 27, 2023
12a86d0 to
f80419f
Compare
…t plan application time
1b3e7e5 to
72fbb9b
Compare
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.
Previously we used the
is_devflag everywhere to determine the following:Using
is_devhad the following shortcomings:if is_dev and snapshot.is_paused and (snapshot.is_forward_only or snapshot.is_non_breaking)...had to be repeated all over the code base.In essence, during evaluation, each snapshot can be in 1 of 3 states:
FORWARD_ONLYorINDIRECT_NON_BREAKING), but since it's currently promoted in prod, we should refer to its prod table when computing intervals or determining the physical table mapping. Therefore, all deployable snapshots are also representative, but the opposite is not always true.To the best of my knowledge, these three states encompass all the use cases we're dealing with here.
To identify which state each snapshot is in, I created a new entity called
DeployabilityIndex. It is built once at the beginning of plan evaluation and then used unchanged throughout the process. It's constructed using the entire DAG which means that if a parent is non-deployable this property also propagates to its children.Thus,
DeployabilityIndexis now a single source of truth for whether or not a snapshot produces deployable results, while the clients no longer need to worry about the current snapshot state (eg. whether it's paused or not) or which target environment it is.Additionally,
DeployabilityIndexpresents an opportunity to inform a user at plan creation time about whether or not what they're about to build is going to be deployable. This, however, is out of scope of this PR.