1
0
mirror of https://github.com/siderolabs/kres.git synced 2026-02-05 09:45:35 +01:00

feat: allow disabling helm docs step on gh workflows

Add configuration setting `docsDisabled` to `auto.Helm` kres definition to disable creation of helm docs on GitHub Workflows.

Normally creation of helm docs step goes hand in hand with `Check dirty` step to ensure helm docs were created beforehand. However, there is an issue with this step, causing CI to hang.

Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
This commit is contained in:
Oguz Kilcan
2026-01-29 23:34:52 +01:00
parent 1b0dcb3913
commit b12955ed04
4 changed files with 41 additions and 24 deletions

View File

@@ -43,10 +43,11 @@ type CI struct {
// Helm defines helm settings.
type Helm struct {
ChartDir string `yaml:"chartDir"`
E2EDir string `yaml:"e2eDir"`
Template HelmTemplate `yaml:"template"`
Enabled bool `yaml:"enabled"`
ChartDir string `yaml:"chartDir"`
E2EDir string `yaml:"e2eDir"`
Template HelmTemplate `yaml:"template"`
Enabled bool `yaml:"enabled"`
DocsDisabled bool `yaml:"docsDisabled"`
}
// HelmTemplate defines helm template settings.

View File

@@ -64,6 +64,7 @@ func (builder *builder) DetectHelm() (bool, error) {
}
builder.meta.HelmTemplateFlags = flags
builder.meta.HelmDocsDisabled = helm.DocsDisabled
return true, nil
}

View File

@@ -11,6 +11,8 @@ import (
"slices"
"strings"
"github.com/siderolabs/gen/xslices"
"github.com/siderolabs/kres/internal/config"
"github.com/siderolabs/kres/internal/dag"
"github.com/siderolabs/kres/internal/output/dockerfile"
@@ -245,6 +247,35 @@ func (helm *Build) CompileGitHubWorkflow(output *ghworkflow.Output) error {
jobPermissions := ghworkflow.DefaultJobPermissions()
jobPermissions["id-token"] = "write"
jobSteps := []*ghworkflow.JobStep{
{
Name: "Install Helm",
Uses: ghworkflow.ActionRef{
Image: fmt.Sprintf("azure/setup-helm@%s", config.HelmSetupActionRef),
Comment: "version: " + config.HelmSetupActionVersion,
},
},
cosignInstallStep,
loginStep,
lintStep,
templateStep,
unittestPluginInstallStep,
unittestStep,
schemaStep,
docsStep,
checkDirtyStep,
helmLoginStep,
helmReleaseStep,
}
jobSteps = xslices.Filter(jobSteps, func(step *ghworkflow.JobStep) bool {
if helm.meta.HelmDocsDisabled && step.Name == "Generate docs" {
return false
}
return true
})
output.AddWorkflow("helm", &ghworkflow.Workflow{
Name: "helm",
Concurrency: ghworkflow.Concurrency{
@@ -269,26 +300,7 @@ func (helm *Build) CompileGitHubWorkflow(output *ghworkflow.Output) error {
RunsOn: ghworkflow.NewRunsOnGroupLabel(ghworkflow.GenericRunner, ""),
Steps: slices.Concat(
ghworkflow.CommonSteps(),
[]*ghworkflow.JobStep{
{
Name: "Install Helm",
Uses: ghworkflow.ActionRef{
Image: fmt.Sprintf("azure/setup-helm@%s", config.HelmSetupActionRef),
Comment: "version: " + config.HelmSetupActionVersion,
},
},
cosignInstallStep,
loginStep,
lintStep,
templateStep,
unittestPluginInstallStep,
unittestStep,
schemaStep,
docsStep,
checkDirtyStep,
helmLoginStep,
helmReleaseStep,
},
jobSteps,
),
},
},

View File

@@ -109,6 +109,9 @@ type Options struct { //nolint:govet
// SOPSEnabled indicates whether SOPS is enabled for the project.
SOPSEnabled bool
// HelmDocsDisabled indicates whether Helm docs should be disabled.
HelmDocsDisabled bool
}
// Command defines Golang executable build configuration.