feat(dagger): Allow to use enterprise CLI from Dagger OSS module#3147
Conversation
Add --enterprise and --cli-version optional parameters to the Dagger module constructor. When enterprise mode is enabled, the module uses ghcr.io/chainloop-dev/platform/cli instead of the OSS image. The bump script now fetches the platform version from the infoz endpoint. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: 8a5a6956-cc02-47f6-9366-bb732b59ecf7
Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: 8a5a6956-cc02-47f6-9366-bb732b59ecf7
AI Session Analysis
|
| Status | Attribution | File | Lines |
|---|---|---|---|
| modified | ai | extras/dagger/main.go |
+42 / -12 |
| modified | ai | .github/workflows/utils/bump-chart-and-dagger-version.sh |
+6 / -0 |
Policies (4)
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-8a5a69 |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-8a5a69 |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-8a5a69 |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-8a5a69 |
- |
Powered by Chainloop and Chainloop Trace
migmartri
left a comment
There was a problem hiding this comment.
Thanks
- I don't think we need to support configuring the version of the underlying image, we can't guarantee compatibility of the wrapping module and the underlying image if you can choose it. It's not how the current oss works either.
| ttl int, | ||
| ) *dagger.Container { | ||
| ctr := cliContainer(ttl, att.Token, att.Client.Instance, att.parentCIContext, att.githubEventFile) | ||
| ctr := cliContainer(ttl, att.Token, att.Client.Instance, att.parentCIContext, att.githubEventFile, att.Client.Enterprise, att.Client.CLIVersion) |
There was a problem hiding this comment.
Id not make the CLI version configurable
This pull request enhances the Dagger integration by introducing support for the Chainloop enterprise CLI, allowing users to select between the open-source and enterprise CLI images and to specify custom CLI versions. It also adds automation to keep the enterprise CLI version up-to-date and refactors the code to support these new options.
Enterprise CLI support and version management:
Added a new
platformVersionconstant inmain.goand updated the workflow script to automatically fetch the latest enterprise CLI version from the Chainloop API (.github/workflows/utils/bump-chart-and-dagger-version.sh,extras/dagger/main.go). [1] [2]Introduced
EnterpriseandCLIVersionfields to theChainloopstruct, and a newNewconstructor to allow users to select the enterprise CLI image and override the CLI version (extras/dagger/main.go).Refactoring and parameterization:
cliContainerfunction and all its call sites to acceptenterpriseandcliVersionOverrideparameters, enabling dynamic selection of the CLI image and version at runtime (extras/dagger/main.go). [1] [2] [3]