Skip to content
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

Merged
merged 4 commits into from
Feb 13, 2025

Conversation

Nurdok
Copy link
Contributor

@Nurdok Nurdok commented Jan 29, 2025

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:

  • Breaking API change: The FetchResult type changed its configChanges parameter type from Plan to Change[]

User Notifications:
None

@coveralls
Copy link

coveralls commented Jan 29, 2025

Coverage Status

coverage: 93.636% (-0.005%) from 93.641%
when pulling 40c776d on Nurdok:feature/SALTO-7272
into 97855e4 on salto-io:main.

@Nurdok Nurdok force-pushed the feature/SALTO-7272 branch from 1694c5c to 6bd2b49 Compare February 5, 2025 07:48
Copy link
Contributor

@shir-reifenberg shir-reifenberg left a 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

Comment on lines +1011 to +1013
if (getSaltoFlagBool(WORKSPACE_FLAGS.replaceGetPlanWithCalculateDiff)) {
log.trace('Using calculateDiff instead of getPlan to compute config changes')
}
Copy link
Contributor

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

Copy link
Contributor Author

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.

}),
).toArray()
: [
...(
Copy link
Contributor

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -34,7 +33,7 @@ export type FetchResult = {
mergeErrors: MergeErrorWithElements[]
fetchErrors: SaltoError[]
success: boolean
configChanges?: Plan
configChanges?: Change[]
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the release notes.

Copy link
Contributor

@shir-reifenberg shir-reifenberg left a 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

@Nurdok Nurdok merged commit 8df6509 into salto-io:main Feb 13, 2025
56 checks passed
@Nurdok Nurdok deleted the feature/SALTO-7272 branch February 13, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants