feat(actions): add --module flag to associate action modules - #1605
Open
developerkunal wants to merge 1 commit into
Open
feat(actions): add --module flag to associate action modules#1605developerkunal wants to merge 1 commit into
developerkunal wants to merge 1 commit into
Conversation
Add a repeatable --module flag to `auth0 actions create` and `auth0 actions update` for associating action modules. Each value is a comma-separated set of key=value pairs matching the Management API field names (module_id, module_version_id), both required. Also fix two pre-existing bugs in `auth0 actions update` that surfaced with non-code flag updates: the payload sent `name: null` (rejected with a 400) because Name was never seeded from the existing action, and answering "No" to the code save prompt discarded the entire update. The code editor and its save confirmation now only run when the update actually touches code.
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
Adds a repeatable
--module(-m) flag toauth0 actions createandauth0 actions updatefor associating action modules with an action.Each flag value is a comma-separated set of
key=valuepairs whose keys mirror the Management API field names, so agents and users can map directly from the API structure without translation:module_id(required) — the module UUIDmodule_version_id(required) — the UUID of the specific module version to attachThe flag can be passed multiple times to associate several modules. The associated modules render as a new
MODULESrow in the action's detail output (and in themodulesarray under--json).This PR also fixes two pre-existing bugs in
auth0 actions updatethat surfaced when running a flag-only (non-interactive) update:"name": nullbecauseNamewas never seeded from the existing action, and the SDK'sAction.Namefield has noomitempty. The API rejected this with400 ... Expected type string but found type null.Nameis now seeded from the existing action, so a partial update no longer blanks it.--module. The code editor and its save confirmation now run only when the update actually touches code (either--codeis passed, or the fully interactive no-flag path). This also applies to--name,--runtime,--secret, and--dependencyupdates, which previously hit the same issues.📚 References
🔬 Testing
TestActionsInputModulesToActionModulescovering the parser: single and multiple modules, empty input, malformed pairs, missingmodule_id, missingmodule_version_id, and unknown keys.TestActionsUpdateCmdasserting a module-only update carries the existing name forward and sends the correct modules payload.TestFormatActionModulescovering the display rendering (id only, name plus version, and multiple modules).MODULESrow renders and the association persists onactions show.📝 Checklist