Skip to content

feat: extend extensions — install from Hub/zip, schema inspection, Ac…#158

Merged
discostu105 merged 4 commits intomainfrom
feat/extend_extensions_coverage_in_dtctl
Apr 20, 2026
Merged

feat: extend extensions — install from Hub/zip, schema inspection, Ac…#158
discostu105 merged 4 commits intomainfrom
feat/extend_extensions_coverage_in_dtctl

Conversation

@MaciejGrynda
Copy link
Copy Markdown
Collaborator

@MaciejGrynda MaciejGrynda commented Apr 17, 2026

feat: extend extensions — install from Hub/zip, schema inspection, ActiveGate groups

  • add dtctl create extension with --hub-extension and -f (zip upload) flags
  • add --monitoring-configuration-schema, --no-fluff, --active-gate-groups to describe extension
  • add extensions:definitions:write scope to all write-capable safety levels
  • add unit, integration, and golden tests for all new functionality

Description

Related Issues

Closes #143

Testing

  • [ X ] Tests pass (make test)
  • [ X ] Linting passes (make lint)
  • Manual tests

…tiveGate groups

- add `dtctl create extension` with --hub-extension and -f (zip upload) flags
- add --monitoring-configuration-schema, --no-fluff, --active-gate-groups to describe extension
- add extensions:definitions:write scope to all write-capable safety levels
- add unit, integration, and golden tests for all new functionality
@discostu105
Copy link
Copy Markdown
Collaborator

discostu105 commented Apr 20, 2026

Code review

Found 3 issues:

  1. printer.Print(groups) serializes *ActiveGateGroupList as {"items":[...]} in JSON/YAML/CSV output instead of the bare array [...]. Other list commands (e.g. get_hub_extensions.go) use printer.PrintList(list.Items). The fix is return printer.PrintList(groups.Items).

enrichAgent(printer, "describe", "extension")
return printer.Print(groups)
}

  1. docs/dev/IMPLEMENTATION_STATUS.md still shows create as - for extension, but this PR implements dtctl create extension. This was also a blocker in the review of the predecessor PR feat: Extend coverage of Extensions 2.0 functionality in dtctl #150.

| lookup ||||| - ||
| extension ||| - | - | - | - |
| extension-config ||| - | - | - ||
| intent ||| - | - | - | - |

  1. Both runUploadExtension and runInstallHubExtension embed name and version into the PrintSuccess string, rather than following the pattern used by other create commands (e.g. create_workflows.go L87-90) of calling PrintSuccess for the headline and then PrintInfo lines for ID/URL details. This was flagged as a blocker in PR feat: Extend coverage of Extensions 2.0 functionality in dtctl #150 and remains unaddressed.

}
output.PrintSuccess("Extension %q version %s uploaded successfully", result.ExtensionName, result.Version)
return nil
}

}
output.PrintSuccess("Hub extension %q version %s installed successfully", result.ExtensionName, result.Version)
return nil
}

discostu105
discostu105 previously approved these changes Apr 20, 2026
Signed-off-by: MaciejGrynda <85988949+MaciejGrynda@users.noreply.github.com>
- Return an explicit error when --version is passed with --file, instead
  of silently ignoring the flag as documented ("only for --hub-extension").
- When InstallFromHub returns 409 without a version specified, report
  "(latest version) is already installed" instead of version "".
- Add unit test coverage for the new validation and error branch.
@discostu105 discostu105 self-requested a review April 20, 2026 19:32
Copy link
Copy Markdown
Collaborator

@discostu105 discostu105 left a comment

Choose a reason for hiding this comment

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

Reviewed and tested locally — all tests pass, build and vet clean. Code looks solid: good flag validation, thorough error handling, comprehensive test coverage including golden tests. A few minor observations (non-blocking): StripSchemaFluff mutates the input map in-place, no file size guard on zip upload, and the ActiveGateEntry.Errors unmarshal error is silently swallowed in the table formatter. None of these are blockers. LGTM.

@discostu105 discostu105 merged commit e086176 into main Apr 20, 2026
14 checks passed
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.

Support for HUB Extensions

3 participants