Skip to content

feat: Add support for Action Modules#1302

Open
kushalshit27 wants to merge 13 commits intomasterfrom
DXCDT-1346-action-modules
Open

feat: Add support for Action Modules#1302
kushalshit27 wants to merge 13 commits intomasterfrom
DXCDT-1346-action-modules

Conversation

@kushalshit27
Copy link
Contributor

@kushalshit27 kushalshit27 commented Feb 17, 2026

🔧 Changes

  • Added first-class support for the new actionModules asset type across the deploy pipeline so tenants can export/import reusable Action modules in both directory and YAML formats.
  • Extended action handling to support module attachments (actions[].modules) in schema validation, change detection, and export dumping so linked modules are preserved.

Examples

Examples Yaml format:

actionModules:
  - name: notification-helper
    code: ./action-modules/notification-helper/code.js
    dependencies:
      - name: uuid
        version: 9.0.0
    secrets:
      - name: NOTIFICATION_SECRET
        value: '##NOTIFICATION_SECRET##'

actions:
  - name: send-phone-message
    code: ./actions/send-phone-message/code.js
    supported_triggers:
      - id: send-phone-message
        version: v1
    modules:
      - module_name: notification-helper
        module_version_number: 1

⚙️ Configuration options:

{
  "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
    "NOTIFICATION_SECRET": "<your-notification-secret-key>"
  }
}

Examples JSON format:

{
  "name": "notification-helper",
  "code": "./action-modules/notification-helper/code.js",
  "dependencies": [
    {
      "name": "uuid",
      "version": "9.0.0"
    }
  ],
  "secrets": [
    {
      "name": "NOTIFICATION_SECRET",
      "value": "##NOTIFICATION_SECRET##"
    }
  ]
}

🔬 Testing

  • Unit coverage added for action module parsing/dumping in both contexts:
  • Action dump coverage added/updated to validate module serialization:
  • Run unit tests and confirm new/updated suites pass.
  • Run export in directory and YAML modes and confirm action-modules/*/code.js and actions[].modules are correctly persisted.
  • Run import with module-linked actions and verify module references resolve and deploy.

📝 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)

- src/context/directory/handlers/actionModules.ts: add action modules parsing and dumping logic
- src/context/directory/handlers/actions.ts: include modules in action mapping
- src/context/directory/handlers/index.ts: register actionModules handler
- src/context/yaml/handlers/actionModules.ts: add YAML support for action modules
- src/context/yaml/handlers/actions.ts: include modules in action mapping for YAML
- src/context/yaml/handlers/index.ts: register actionModules handler for YAML
- src/tools/auth0/handlers/actionModules.ts: create ActionModulesHandler for API interactions
- src/tools/auth0/handlers/actions.ts: log action data during update
- src/tools/auth0/handlers/index.ts: import actionModules handler
- src/tools/constants.ts: define ACTION_MODULES_DIRECTORY constant
- src/types.ts: extend Asset type to include actionModules
- test/utils.js: mock management client for action modules
- src/context/directory/handlers/actionModules.ts: add new fields for actions using module total, all changes published, and latest version number
- src/context/directory/handlers/actions.ts: include module details in action mapping
- src/context/yaml/handlers/actionModules.ts: add new fields for actions using module total, all changes published, and latest version number
- src/tools/auth0/handlers/actionModules.ts: update field names for consistency
- src/tools/auth0/handlers/actions.ts: enrich actions with module IDs and add modules schema
- src/context/directory/handlers/actions.ts: remove unnecessary line in mapToAction function
- src/tools/auth0/handlers/actionModules.ts: format imports and improve readability in schema definition
- src/context/yaml/handlers/actionModules.ts: update condition to check for empty actionModules
- test/context/directory/actions.test.js: add tests for dumping actions with modules
- test/context/yaml/actions.test.js: add tests for dumping actions with modules
- test/context/directory/actionModules.test.ts: new file for action modules tests
- test/context/yaml/actionModules.test.ts: new file for YAML context action modules tests
- test/tools/auth0/handlers/actionModules.tests.ts: new file for action modules handler tests
- package.json: update auth0 version to ^5.3.1
- package-lock.json: update auth0 version to 5.3.1
- src/tools/auth0/handlers/actionModules.ts: add all_changes_published field and implement publish logic
- src/tools/auth0/handlers/actions.ts: paginate to get all versions of the module
- src/tools/auth0/handlers/actionModules.ts: remove 'value' from required secrets
- src/tools/auth0/handlers/actionModules.ts: create updatableModule for updateModule method
…ons mock data

- test/tools/auth0/handlers/actions.tests.js: refactor promise resolution for versions list
@kushalshit27 kushalshit27 requested a review from a team as a code owner February 17, 2026 03:35
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 72.78107% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.17%. Comparing base (682cfca) to head (5a3959e).

Files with missing lines Patch % Lines
src/tools/auth0/handlers/actionModules.ts 68.62% 11 Missing and 5 partials ⚠️
src/tools/auth0/handlers/actions.ts 63.63% 7 Missing and 5 partials ⚠️
src/context/directory/handlers/actionModules.ts 78.26% 4 Missing and 6 partials ⚠️
src/context/yaml/handlers/actionModules.ts 76.47% 3 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1302      +/-   ##
==========================================
- Coverage   80.37%   80.17%   -0.20%     
==========================================
  Files         146      149       +3     
  Lines        5879     6048     +169     
  Branches     1208     1237      +29     
==========================================
+ Hits         4725     4849     +124     
- Misses        660      685      +25     
- Partials      494      514      +20     

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

- examples/directory/action-modules/auth-helper/code.js: use actions.secrets.JWT_SECRET instead of process.env.JWT_SECRET
- examples/yaml/action-modules/auth-helper/code.js: use actions.secrets.JWT_SECRET instead of process.env.JWT_SECRET

let modules: ActionModule[] | null = null;
try {
modules = await paginate<ActionModule>(this.client.actions.modules.list, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check with assets actions-modules

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ramya18101 updated

- Update assets destructuring to include actionModules
- Modify module retrieval logic to prioritize actionModules if available
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