You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add ability to skip check section for a specific component (#437)
* feat: add ability to skip check section for a specific component
* Update docs/reference/overlays.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: remove commas from jsonschema descriptions and use single % for %check (#438)
* Initial plan
* fix: remove commas from jsonschema descriptions and use single % for %check
Co-authored-by: tobiasb_microsoft <115835401+tobiasb_microsoft@users.noreply.github.com>
* test: update snapshots for schema changes
Co-authored-by: tobiasb_microsoft <115835401+tobiasb_microsoft@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tobiasb_microsoft <115835401+tobiasb_microsoft@users.noreply.github.com>
* chore: rename reason to skip_reason for clarity and future-proofing
* fix: change wording and use skip_reason in overlays.md
* chore: move check config documentation into a new file because it is not an overlay
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tobiasb_microsoft <115835401+tobiasb_microsoft@users.noreply.github.com>
Copy file name to clipboardExpand all lines: internal/projectconfig/build.go
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,32 @@
3
3
4
4
package projectconfig
5
5
6
+
import (
7
+
"errors"
8
+
"fmt"
9
+
)
10
+
11
+
// CheckConfig encapsulates configuration for the %check section of a spec file.
12
+
typeCheckConfigstruct {
13
+
// Skip indicates whether the %check section should be disabled for this component.
14
+
Skipbool`toml:"skip,omitempty" json:"skip,omitempty" jsonschema:"title=Skip check,description=Disables the %check section by prepending 'exit 0' when set to true"`
15
+
// SkipReason provides a required justification when Skip is true.
16
+
SkipReasonstring`toml:"skip_reason,omitempty" json:"skipReason,omitempty" jsonschema:"title=Skip reason,description=Required justification for skipping the %check section"`
17
+
}
18
+
19
+
// Validate checks that required fields are set when Skip is true.
20
+
func (c*CheckConfig) Validate() error {
21
+
if!c.Skip {
22
+
returnnil
23
+
}
24
+
25
+
ifc.SkipReason=="" {
26
+
returnerrors.New("check.skip_reason is required when check.skip is true")
27
+
}
28
+
29
+
returnnil
30
+
}
31
+
6
32
// Encapsulates configuration for building a component. Configuration for how to acquire
7
33
// or prepare the sources for a component are out of scope.
8
34
typeComponentBuildConfigstruct {
@@ -12,4 +38,15 @@ type ComponentBuildConfig struct {
12
38
Without []string`toml:"without,omitempty" json:"without,omitempty" jsonschema:"title=Without options,description='without' options to pass to the builder."`
13
39
// Macro definitions.
14
40
Definesmap[string]string`toml:"defines,omitempty" json:"defines,omitempty" jsonschema:"title=Macro definitions,description=Macro definitions to pass to the builder."`
41
+
// Check section configuration.
42
+
CheckCheckConfig`toml:"check,omitempty" json:"check,omitempty" jsonschema:"title=Check configuration,description=Configuration for the %check section"`
43
+
}
44
+
45
+
// Validate checks that the build configuration is valid.
0 commit comments