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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user