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

feat: update helm docs disable flag to cover enforcing doc generation

Just removing helm docs step is not enough to stop enforcement of helm doc generation. Add schema generation and check dirty steps as well for full coverage.

Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
This commit is contained in:
Oguz Kilcan
2026-01-30 08:46:59 +01:00
parent b12955ed04
commit 4879152364
3 changed files with 12 additions and 18 deletions

View File

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

View File

@@ -11,8 +11,6 @@ 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"
@@ -259,22 +257,18 @@ func (helm *Build) CompileGitHubWorkflow(output *ghworkflow.Output) error {
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
}
// Add steps for unit tests
jobSteps = append(jobSteps, []*ghworkflow.JobStep{unittestPluginInstallStep, unittestStep}...)
return true
})
// Add steps for schema generation and docs generation if enforced
if helm.meta.EnforceHelmDocs {
jobSteps = append(jobSteps, []*ghworkflow.JobStep{schemaStep, docsStep, checkDirtyStep}...)
}
// Add final steps
jobSteps = append(jobSteps, []*ghworkflow.JobStep{helmLoginStep, helmReleaseStep}...)
output.AddWorkflow("helm", &ghworkflow.Workflow{
Name: "helm",

View File

@@ -110,8 +110,8 @@ 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
// EnforceHelmDocs indicates whether usage of helm docs should be enforced.
EnforceHelmDocs bool
}
// Command defines Golang executable build configuration.