-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SALTO-7272: Compute config changes with calculateDiff
instead of getPlan
#7187
Conversation
1694c5c
to
6bd2b49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I think this introduces a breaking API change, so probably worth discussing how we handle it
if (getSaltoFlagBool(WORKSPACE_FLAGS.replaceGetPlanWithCalculateDiff)) { | ||
log.trace('Using calculateDiff instead of getPlan to compute config changes') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this one is redundant as we're already printing the flags elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where? I couldn't find the flag name in the trace log.
packages/core/src/core/fetch.ts
Outdated
}), | ||
).toArray() | ||
: [ | ||
...( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use Array.from
instead? (same for line 1032)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
packages/core/src/types.ts
Outdated
@@ -34,7 +33,7 @@ export type FetchResult = { | |||
mergeErrors: MergeErrorWithElements[] | |||
fetchErrors: SaltoError[] | |||
success: boolean | |||
configChanges?: Plan | |||
configChanges?: Change[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a breaking change, right ? (FetchResult
in the return type of fetch
in api.ts)
We should update the release notes + probably communicate this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
Please make sure the FetchResult
change is communicated
Instead of computing a plan to identify config changes, use the new
calculateDiff
to get a simple list of changes instead.Additional context for reviewer:
I'm not sure this actually warrants a core flag, LMKWYT
Release Notes:
Core:
FetchResult
type changed itsconfigChanges
parameter type fromPlan
toChange[]
User Notifications:
None