Only manage allowed tenant flags #797
Merged
+5,277
−3,795
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.
🔧 Changes
There has been a recent uptick in incompatible tenant flags resulting in errors that resemble the following (source):
The above example specifically calls out the new_universal_login_experience_enabled flag but this issue could occur for a handful of other properties too.
The issue here is that deprecations occur over time and sometimes these deprecations have a lag of rollout between environments and regions. What this means is that it is very possible for customers to have old config that successfully applies for one tenant but does not apply for another. The vast majority of the time, customers do not need to concern themselves with these tenant flags, they primarily exist to facilitate work behind the scenes.
This PR establishes an allow list of tenant flags that can be configured. This list is based off which flags are publicly exposed in the API docs. This PR simplifies the logic here, removing the concept of "migration" flags and simply checks against the list of allowed values. If an unallowed feature flag is present, it is removed from the payload. Additionally, logging has been added to educate and aid in understanding any edge-cases that may be missed. We very well need to tune this list as time goes on.
IMO, this is a medium-term fix. This list should remain largely static, should be backwards compatible and fix the immediate problems at hand. However, there is a broader problem of which flags can and should be considered configurable in the context of Deploy CLI. And if some of those are not publicly visible, how can we smooth over any breaking changes that can occur in the future? These are issues that cannot be addressed now but will discussed internally.
📚 References
🔬 Testing
Adding unit tests and re-recording E2E tests.
📝 Checklist