fix: prevent dry-run crash on clientAuthCredentials handler - #1438
Draft
harshithRai wants to merge 5 commits into
Draft
fix: prevent dry-run crash on clientAuthCredentials handler#1438harshithRai wants to merge 5 commits into
harshithRai wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1438 +/- ##
==========================================
+ Coverage 80.25% 80.27% +0.01%
==========================================
Files 163 163
Lines 7553 7559 +6
Branches 1667 1668 +1
==========================================
+ Hits 6062 6068 +6
Misses 801 801
Partials 690 690 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
🔧 Changes
Fixes a crash during
import --dry_runthat aborted the entire dry-run preview withhandler.dryRunChanges is not a function.The
clientAuthCredentialsfeature added two handlers that were implemented for the deploy path only and did not define adryRunChanges()method. Because the dry-run engine callsdryRunChanges()on every registered handler, the run crashed as soon as it reached this resource - regardless of whether the tenant actually used client credentials.dryRunChanges()method toClientAuthCredentialsHandlerandClientAuthCredentialsPreHandler, each returning empty changes ({ del: [], create: [], conflicts: [], update: [] }) - the same no-op shape the base handler returns when there is nothing to do.import.dryRunChanges(with a warning) instead of crashing, so a future deploy-only handler can't reintroduce this failure.import(without--dry_run) was never affected.No changes to the YAML/JSON config shape - the
clientAuthCredentials/client_authentication_methodsstructure is unchanged. This only affects dry-run behavior.🔭 Future scope
🔬 Testing
Unit Test
dryRunChanges, so a non-conforming handler is caught at build time.Manual:
a0deploy import --input_file=./tenant.yaml --dry_runnow completes on a tenant with client credentials instead of crashing.📝 Checklist