Skip to content

feat: support --set/--del on update trigger - #308

Merged
BlueLabelscotch merged 9 commits into
mainfrom
feat/trigger-update-set
Oct 20, 2026
Merged

BlueLabelscotch merged 9 commits into
mainfrom
feat/trigger-update-set

Conversation

@BlueLabelscotch

@BlueLabelscotch BlueLabelscotch commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Add yamlParse expr function; get-then-put now sends the mutated object as YAML when content_type is application/yaml.
  • update trigger supports --set/--add/--del on name, description and tags (-f still works).
  • update trigger:enable|disable reimplemented as endpoint commands (body_params); the Go workflow is removed.
  • Validator allows content_type on endpoints with an update_strategy.

Notes

  • Trigger YAML is re-encoded from a map: comments are dropped and keys are sorted. Enable/disable no longer short-circuit when the state is unchanged.

Test

go test ./pkg/... ./modules/pipeline/...

Resolves: #299

Drop the YAML-node toggle handler and its commands; they are re-added
as plain endpoint commands on the generic update flow.
Re-add update trigger:enable and trigger:disable as endpoint commands
that set trigger.enabled with body_params. Allow content_type on
endpoints with an update_strategy.
@augmentcode

augmentcode Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

CLI Grammar Review · session (Harness team members only) · cab8b4f

CLI grammar changes (beta) · Advisory only, FYI, not required changes.

  • 🟡 Changed harness update trigger <pipeline>/<trigger>: --set, --add, --del, -f (now optional)
    • enabled also gains a mutable_path, so --set enabled=... overlaps update trigger:enable|disable. Consider omitting it.
  • 🟢 Changed harness update trigger:enable <pipeline>/<trigger>: --preview-request (hidden flag now core)
  • 🟢 Changed harness update trigger:disable <pipeline>/<trigger>: --preview-request (hidden flag now core)

Overall: 🟡 Recommend manual review

@augmentcode augmentcode Bot left a comment

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.

Deep Code Review Agent🐛

Review completed with 3 suggestions.

Reviewed commit: 8572cb9

func YamlParse(s string) map[string]any {
var out map[string]any
if err := yaml.Unmarshal([]byte(s), &out); err != nil {
return nil

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.

Deep Code Review Agent🐛

YamlParse returns a typed nil map for invalid or empty YAML, which passes EvalExprAny's out == nil check and is copied as null by jsonCopyMap. Consequently, update trigger:enable can proceed to PUT a document containing only trigger.enabled instead of aborting when the GET response's YAML cannot be parsed.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

Comment thread pkg/registry/endpoint.go
contentType := resolveContentType(ep, method)
var updateBody any = body
if contentType == "application/yaml" {
out, err := yaml.Marshal(integralFloatsToInts(body))

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.

Deep Code Review Agent🐛

An untouched YAML integer such as 9007199254740993 has already been rounded to 9007199254740992 by jsonCopyMap before integralFloatsToInts runs, so this conversion cannot preserve the original value. An otherwise unrelated field edit can therefore silently change numeric configuration in the full YAML PUT.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

path: /pipeline/api/triggers/{{lastPart(ctx.id)}}
file_body: required
update_strategy: get-then-put
update_body_pick: yamlParse(it.data.yaml)

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.

Deep Code Review Agent🐛

This bundles the new core yamlParse/YAML-update feature with pipeline-module adoption and workflow removal, contrary to the root AGENTS.md “PR scope: core vs module” rule. These are new module behaviors rather than compatibility edits, so the stated exception does not apply and the required separate core/module review boundary is lost.

Severity: low


🤖 Was this useful? React with 👍 or 👎

@BlueLabelscotch

Copy link
Copy Markdown
Collaborator Author

cosmos review

@augmentcode augmentcode Bot left a comment

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.

Deep Code Review Agent🐛

Review completed with 0 suggestions.

Reviewed commit: cab8b4f

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.

update trigger --set , mutable fields need to be there. Get then put...

1 participant