Skip to content

fix: strip unresolved placeholders on deploy instead of throwing - #1436

Open
ankita10119 wants to merge 1 commit into
masterfrom
DXCDT-2072
Open

fix: strip unresolved placeholders on deploy instead of throwing#1436
ankita10119 wants to merge 1 commit into
masterfrom
DXCDT-2072

Conversation

@ankita10119

Copy link
Copy Markdown
Contributor

🔧 Changes

Previously, deploying a resource with an unresolved ##...## or @@...@@ placeholder would throw an error and abort the deploy. This caused the export→import round-trip to fail for connections and other resources where the CLI auto-generates secret placeholders on export (e.g. ##CONNECTIONS_WAAD_SECRET##), since Auth0 does not expose the actual secret value, making it impossible for users to provide the keyword mapping.

Change: Instead of throwing, unresolved placeholders are now stripped from the payload before the API call, with a warn log per field. Auth0 preserves its existing value for any stripped field.

  • Added stripUnresolvedPlaceholders utility in src/tools/utils.ts
  • APIHandler.processChanges (create, update, conflict paths) now calls stripUnresolvedPlaceholders in place of validateNoUnresolvedPlaceholders

📚 References

🔬 Testing

  • Unit tests updated in test/tools/utils.test.js and test/tools/auth0/handlers/default.tests.ts
  • Tested against real tenant: exported a WAAD connection (producing ##CONNECTIONS_WAAD_SECRET##), ran import without defining the mapping, field was stripped with a warning and the connection updated successfully

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ankita10119
ankita10119 requested a review from a team as a code owner July 27, 2026 18:51
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@52b338f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/tools/auth0/handlers/default.ts 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1436   +/-   ##
=========================================
  Coverage          ?   80.24%           
=========================================
  Files             ?      163           
  Lines             ?     7542           
  Branches          ?     1665           
=========================================
  Hits              ?     6052           
  Misses            ?      801           
  Partials          ?      689           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants