Skip to content

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

Merged
ankita10119 merged 6 commits into
masterfrom
DXCDT-2072
Jul 30, 2026
Merged

fix: strip unresolved placeholders on deploy instead of throwing#1436
ankita10119 merged 6 commits 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

codecov-commenter commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.35%. Comparing base (0597694) to head (8ab47a3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1436      +/-   ##
==========================================
+ Coverage   80.23%   80.35%   +0.11%     
==========================================
  Files         163      163              
  Lines        7559     7568       +9     
  Branches     1668     1670       +2     
==========================================
+ Hits         6065     6081      +16     
+ Misses        801      794       -7     
  Partials      693      693              

☔ 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.

Comment thread src/tools/utils.ts Outdated
Comment on lines +336 to +339
`To use this value, define ${path
.split('.')
.pop()
?.toUpperCase()} in AUTH0_KEYWORD_REPLACE_MAPPINGS. The existing value on Auth0 will be preserved.`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the suggested key here might be slightly off. It's derived from the field name rather than the placeholder itself. For options.client_secret: ##CONNECTIONS_WAAD_SECRET##, it would tell the user to define CLIENT_SECRET, but the value they actually need to map is CONNECTIONS_WAAD_SECRET, so following the message as-is wouldn't quite work. Could we maybe pull the name from value instead (stripping the ##/@@)?

It's already available right there in the loop, so it might be a small change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed and updated

@ankita10119
ankita10119 merged commit 7c65237 into master Jul 30, 2026
9 checks passed
@ankita10119
ankita10119 deleted the DXCDT-2072 branch July 30, 2026 06:04
@ankita10119 ankita10119 mentioned this pull request Jul 30, 2026
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