Skip to content

fix: preserve trigger options field during automation import/export#206

Open
davhparry wants to merge 1 commit into
itential:mainfrom
davhparry:fix/lcm-import-missing-options
Open

fix: preserve trigger options field during automation import/export#206
davhparry wants to merge 1 commit into
itential:mainfrom
davhparry:fix/lcm-import-missing-options

Conversation

@davhparry

Copy link
Copy Markdown
Contributor

Description

Adds Options field to all trigger structs so LCM action configuration (actionId, chooseTargetAtRuntime) is no longer dropped during export/import. Also adds a default passthrough in transformTrigger and updateTriggers so unknown trigger types are preserved rather than erroring or being silently dropped.

Fixes #177

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Chore

Changes Made

  • Updates ManualTrigger.MarshalJSON to include Options when present
  • Replaces the error-returning default case in transformTrigger (export path) with a passthrough that preserves unknown trigger types as raw JSON
  • Adds the same passthrough default case to updateTriggers (import path) so unknown trigger types are no longer silently dropped

Testing

  • [ x] Export an automation with a resource_models componentType that has an LCM action trigger — verify options (actionId, chooseTargetAtRuntime) appears in the exported JSON
  • [x ] Re-import that exported file — verify the automation imports successfully with the trigger options intact
  • [x ] Verify existing automation export/import (workflow, compliance_plan types) still works correctly
  • [x ] Run make test — all tests pass

Checklist

  • [ x] Code follows the project's style guidelines
  • [ x] Self-review of code has been performed
  • [ x] Code has been commented where necessary
  • [ x] Tested with make setup or relevant profile
  • [ x] Commits follow conventional format (type: subject)
  • [ x] No secrets or credentials committed
  • [ x] Documentation has been updated accordingly
  • [ x] PR has been labeled appropriately (enhancement, bug, documentation, refactor, chore)

Adds Options field to all trigger structs so LCM action configuration
(actionId, chooseTargetAtRuntime) is no longer dropped during
export/import. Also adds a default passthrough in transformTrigger and
updateTriggers so unknown trigger types are preserved rather than
erroring or being silently dropped.

Fixes itential#177
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.

Lifecycle Operation Manager items are no imported correctly by IPCTL

1 participant