Skip to content

feat: add deprecation warnings for external file path references in config handlers #1392

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

feat: add deprecation warnings for external file path references in config handlers #1392
ankita10119 wants to merge 1 commit into
masterfrom
DXCDT-1771

Conversation

@ankita10119
Copy link
Copy Markdown
Contributor

🔧 Changes

Added deprecation warnings across all config file loading paths to notify customers ahead of a planned breaking change (tracked in #1388) that will remove support for absolute paths and paths resolving outside the config root directory.

Affected locations:

  • src/context/directory/index.ts - loadFile fallback when relative path cannot be resolved
  • src/context/yaml/index.ts - same for YAML context
  • src/context/directory/handlers/actions.ts - action code path resolved via fs.existsSync as an absolute/external path
  • src/context/directory/handlers/actionModules.ts - same for action modules
  • src/context/directory/handlers/databases.ts - customScripts path resolving outside the config root

Existing behavior is fully preserved - files still load successfully. A warn-level log is emitted to prompt customers to migrate to relative paths before the breaking change lands.

📚 References

🔬 Testing

No new unit tests added as behavior is unchanged. Warnings can be verified manually by referencing a file outside the config directory in any of the affected asset types (actions, action modules, databases, pages) - a deprecation warn log is emitted and the file continues to load normally.

All 1231 existing tests pass with no regressions.

📝 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 May 21, 2026 10:45
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.85%. Comparing base (0326e38) to head (6e382c8).

Files with missing lines Patch % Lines
src/context/directory/handlers/databases.ts 66.66% 1 Missing and 1 partial ⚠️
src/context/directory/handlers/actionModules.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1392      +/-   ##
==========================================
- Coverage   79.86%   79.85%   -0.02%     
==========================================
  Files         153      153              
  Lines        7064     7072       +8     
  Branches     1550     1551       +1     
==========================================
+ Hits         5642     5647       +5     
- Misses        781      783       +2     
- Partials      641      642       +1     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@kushalshit27 kushalshit27 left a comment

Choose a reason for hiding this comment

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

Please keep it simple.

Support for absolute paths and paths outside the config root will be deprecated in a future version to improve the security of the tool.` 
+
`Please update your configuration to use paths relative to the config directory.`
+ 
"Current absolute paths used are [path1, path2]"

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