Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/mutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The difference between **omitted** and **explicitly written** matters for merge-
## File input, GET YAML, and current limits

- If an endpoint accepts `-f`, supplying a file takes precedence over GET-then-update. The supplied body is sent as a write document (with the endpoint's file-body wrapping behavior); it is **not** run through the field handlers or the flag-built sparse PATCH path. `body_params` from the automatic mutation path are not merged into it. A full write-ready PATCH file is allowed, but inspect its shape before sending it.
- When the API stores the resource as a YAML string inside a JSON response (for example `data.yaml` on triggers), pick it with `update_body_pick: yamlParse(it.data.yaml)` and set `content_type: application/yaml`. The mutated object is then re-encoded as the YAML request body, so comments are dropped and keys are written sorted.
- `get --format yaml` still uses the **get command's separate `yaml_pick_expr` / `yaml_exclude`**, not `update_body_pick` or custom field handlers. FME's current YAML output is not automatically write-ready for tags/owners; do not promise a GET-YAML-to-`-f` round trip until its specs and conversion path are addressed.
- There is no `patch_always_fields` facility yet. PATCH does not copy unchanged picked IDs or other required fields automatically. If an API requires one, establish that requirement before changing the spec/core; an explicit `body_params` value may suffice when it is available independently of GET.
- Core does not look up owner emails or reconstruct missing API identifiers. FME currently returns a group name without the identifier needed to write that group back; that requires a server-side round-trip fix before mixed-owner edits can be reliable.
Expand Down
6 changes: 3 additions & 3 deletions modules/har/pkg/har/push_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func pushGenericArtifact(ctx *cmdctx.Ctx) error {

includeHidden := cmdctx.GetBool(ctx.FlagValues, "include-hidden")

maxConcurrentFiles := cmdctx.GetInt(ctx.FlagValues, "max-concurrent-uploads")
if maxConcurrentFiles <= 0 {
maxConcurrentFiles = defaultMaxConcurrentUploads
maxConcurrentFiles, err := maxConcurrentUploadsFlag(ctx)
if err != nil {
return err
}
maxConcurrentParts := cmdctx.GetInt(ctx.FlagValues, "max-concurrent-parts")
if maxConcurrentParts <= 0 {
Expand Down
17 changes: 13 additions & 4 deletions modules/har/pkg/har/push_maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ import (
"github.com/harness/cli/v3/pkg/cmdctx"
)

const defaultMaxConcurrentUploads = 4
const defaultMaxConcurrentUploads = 5

// maxConcurrentUploadsFlag returns the validated --max-concurrent-uploads value.
func maxConcurrentUploadsFlag(ctx *cmdctx.Ctx) (int, error) {
n := cmdctx.GetInt(ctx.FlagValues, "max-concurrent-uploads")
if n < 1 {
return 0, fmt.Errorf("--max-concurrent-uploads must be at least 1, got %d", n)
}
return n, nil
}

// pomXML is a minimal representation of a Maven POM file used for coordinate extraction.
type pomXML struct {
Expand Down Expand Up @@ -130,9 +139,9 @@ func pushMavenArtifact(ctx *cmdctx.Ctx) error {
return fmt.Errorf("SNAPSHOT version upload is not supported")
}

maxConcurrent := cmdctx.GetInt(ctx.FlagValues, "max-concurrent-uploads")
if maxConcurrent <= 0 {
maxConcurrent = defaultMaxConcurrentUploads
maxConcurrent, err := maxConcurrentUploadsFlag(ctx)
if err != nil {
return err
}

groupPath := strings.ReplaceAll(coords.GroupID, ".", "/")
Expand Down
6 changes: 3 additions & 3 deletions modules/har/pkg/har/push_python.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ func pushPythonArtifact(ctx *cmdctx.Ctx) error {
files = []string{localPath}
}

maxConcurrent := cmdctx.GetInt(ctx.FlagValues, "max-concurrent-uploads")
if maxConcurrent <= 0 {
maxConcurrent = defaultMaxConcurrentUploads
maxConcurrent, err := maxConcurrentUploadsFlag(ctx)
if err != nil {
return err
}

sem := make(chan struct{}, maxConcurrent)
Expand Down
2 changes: 0 additions & 2 deletions modules/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
func ModuleInit(reg registry.ModuleRegistrar) {
reg.RegisterFetchFn(listExecutionLogsFetchFnID, listExecutionLogsFetchFn)
reg.RegisterWorkflow(getPipelineLogHandlerID, getPipelineLogHandler)
reg.RegisterWorkflow(updateTriggerEnableHandlerID, updateTriggerEnableHandler)
reg.RegisterWorkflow(updateTriggerDisableHandlerID, updateTriggerDisableHandler)
reg.RegisterBodyFn(executePipelineBodyFnID, executePipelineBody)
reg.RegisterBodyFn(executeInputSetBodyFnID, executeInputSetBody)
reg.RegisterBodyFn(executeDynamicBodyFnID, executeDynamicBody)
Expand Down
142 changes: 0 additions & 142 deletions modules/pipeline/trigger_toggle.go

This file was deleted.

Loading
Loading