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 json support to config dump --format (#405)
* add json support to config dump
* switch json marshalling to camelCase
* make config dump command work as root
* add comments explaining why we allow dump to be run as root
Copy file name to clipboardExpand all lines: internal/projectconfig/build.go
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ package projectconfig
7
7
// or prepare the sources for a component are out of scope.
8
8
typeComponentBuildConfigstruct {
9
9
// Which features should be enabled via `with` options to the builder.
10
-
With []string`toml:"with,omitempty" json:",omitempty" jsonschema:"title=With options,description='with' options to pass to the builder."`
10
+
With []string`toml:"with,omitempty" json:"with,omitempty" jsonschema:"title=With options,description='with' options to pass to the builder."`
11
11
// Which features should be disabled via `without` options to the builder.
12
-
Without []string`toml:"without,omitempty" json:",omitempty" jsonschema:"title=Without options,description='without' options to pass to the builder."`
12
+
Without []string`toml:"without,omitempty" json:"without,omitempty" jsonschema:"title=Without options,description='without' options to pass to the builder."`
13
13
// Macro definitions.
14
-
Definesmap[string]string`toml:"defines,omitempty" json:",omitempty" jsonschema:"title=Macro definitions,description=Macro definitions to pass to the builder."`
14
+
Definesmap[string]string`toml:"defines,omitempty" json:"defines,omitempty" jsonschema:"title=Macro definitions,description=Macro definitions to pass to the builder."`
// Defines a component group. Component groups are logical groupings of components (see [ComponentConfig]).
@@ -84,9 +84,9 @@ type SourceFileReference struct {
84
84
// component may belong to multiple groups, and components need not belong to any group.
85
85
typeComponentGroupConfigstruct {
86
86
// List of glob patterns specifying raw spec files that define components.
87
-
SpecPathPatterns []string`toml:"specs,omitempty" validate:"dive,required" jsonschema:"title=Spec path patterns,description=List of glob patterns identifying local specs for components in this group,example=SPECS/**/.spec"`
87
+
SpecPathPatterns []string`toml:"specs,omitempty" json:"specs,omitempty" validate:"dive,required" jsonschema:"title=Spec path patterns,description=List of glob patterns identifying local specs for components in this group,example=SPECS/**/.spec"`
88
88
// List of glob patterns specifying files to specifically ignore from spec selection.
89
-
ExcludedPathPatterns []string`toml:"excluded-paths,omitempty" jsonschema:"title=Excluded path patterns,description=List of glob patterns identifying local paths to exclude from spec selection,example=build/**"`
89
+
ExcludedPathPatterns []string`toml:"excluded-paths,omitempty" json:"excludedPaths,omitempty" jsonschema:"title=Excluded path patterns,description=List of glob patterns identifying local paths to exclude from spec selection,example=build/**"`
90
90
}
91
91
92
92
// Returns a copy of the component group config with relative file paths converted to absolute
SpecSpecSource`toml:"spec,omitempty" json:",omitempty" jsonschema:"title=Spec,description=Identifies where to find the spec for this component"`
124
+
SpecSpecSource`toml:"spec,omitempty" json:"spec,omitempty" jsonschema:"title=Spec,description=Identifies where to find the spec for this component"`
125
125
126
126
// Overlays to apply to sources after they've been acquired. May mutate the spec as well as sources.
127
-
Overlays []ComponentOverlay`toml:"overlays,omitempty" json:",omitempty" table:"-" jsonschema:"title=Overlays,description=Overlays to apply to this component's spec and/or sources"`
127
+
Overlays []ComponentOverlay`toml:"overlays,omitempty" json:"overlays,omitempty" table:"-" jsonschema:"title=Overlays,description=Overlays to apply to this component's spec and/or sources"`
128
128
129
129
// Configuration for building the component.
130
-
BuildComponentBuildConfig`toml:"build,omitempty" json:",omitempty" table:"-" jsonschema:"title=Build configuration,description=Configuration for building the component"`
130
+
BuildComponentBuildConfig`toml:"build,omitempty" json:"build,omitempty" table:"-" jsonschema:"title=Build configuration,description=Configuration for building the component"`
131
131
}
132
132
133
133
// Mutates the component config, updating it with overrides present in other.
// Optionally provides a default version to use for this distro when one is not explicitly specified.
41
-
DefaultVersionstring`toml:"default-version,omitempty" jsonschema:"title=Default version,description=Default version for this distro"`
41
+
DefaultVersionstring`toml:"default-version,omitempty" json:"defaultVersion,omitempty" jsonschema:"title=Default version,description=Default version for this distro"`
42
42
43
43
// The base URI of this distro's dist-git spec source repository.
44
-
DistGitBaseURIstring`toml:"dist-git-base-uri,omitempty" jsonschema:"format=uri,title=Dist-git base URI,description=Base URI for the dist-git repository for this distro"`
44
+
DistGitBaseURIstring`toml:"dist-git-base-uri,omitempty" json:"distGitBaseUri,omitempty" jsonschema:"format=uri,title=Dist-git base URI,description=Base URI for the dist-git repository for this distro"`
45
45
46
46
// The base URI of this distro's lookaside cache for source archives.
47
-
LookasideBaseURIstring`toml:"lookaside-base-uri,omitempty" jsonschema:"format=uri,title=Lookaside base URI,description=Base URI for lookaside cache for this distro"`
47
+
LookasideBaseURIstring`toml:"lookaside-base-uri,omitempty" json:"lookasideBaseUri,omitempty" jsonschema:"format=uri,title=Lookaside base URI,description=Base URI for lookaside cache for this distro"`
48
48
49
49
// Published artifact information
50
-
PackageRepositories []PackageRepository`toml:"repos,omitempty" jsonschema:"title=Package Repositories,description=List of package repository definitions"`
50
+
PackageRepositories []PackageRepository`toml:"repos,omitempty" json:"repos,omitempty" jsonschema:"title=Package Repositories,description=List of package repository definitions"`
51
51
52
52
// Versions: maps version => definition
53
-
Versionsmap[string]DistroVersionDefinition`toml:"versions,omitempty" jsonschema:"title=Versions,description=Mapping of distro version definitions"`
53
+
Versionsmap[string]DistroVersionDefinition`toml:"versions,omitempty" json:"versions,omitempty" jsonschema:"title=Versions,description=Mapping of distro version definitions"`
54
54
}
55
55
56
56
// Defines how to access the published repository for a distro.
57
57
typePackageRepositorystruct {
58
-
BaseURIstring`toml:"base-uri" jsonschema:"required,title=Base URI,description=Base URI for the repository"`
58
+
BaseURIstring`toml:"base-uri" json:"baseUri" jsonschema:"required,title=Base URI,description=Base URI for the repository"`
59
59
}
60
60
61
61
// Defines a specific version of a distro.
62
62
typeDistroVersionDefinitionstruct {
63
63
// Human-readable description of this version
64
-
Descriptionstring`toml:"description,omitempty" jsonschema:"title=Description,description=Human readable description of the distro version"`
64
+
Descriptionstring`toml:"description,omitempty" json:"description,omitempty" jsonschema:"title=Description,description=Human readable description of the distro version"`
// Dist-git branch for this version (if applicable)
70
-
DistGitBranchstring`toml:"dist-git-branch,omitempty" jsonschema:"title=Dist-git branch,description=Branch in the dist-git repository for this version"`
70
+
DistGitBranchstring`toml:"dist-git-branch,omitempty" json:"distGitBranch,omitempty" jsonschema:"title=Dist-git branch,description=Branch in the dist-git repository for this version"`
71
71
72
72
// Default config for components.
73
-
DefaultComponentConfigComponentConfig`toml:"default-component-config,omitempty" jsonschema:"title=Default component config,description=Default component config inherited by all components built for this distro"`
73
+
DefaultComponentConfigComponentConfig`toml:"default-component-config,omitempty" json:"defaultComponentConfig,omitempty" jsonschema:"title=Default component config,description=Default component config inherited by all components built for this distro"`
74
74
75
75
// Path to mock configuration file for this project (if one exists).
76
-
MockConfigPathstring`toml:"mock-config,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the mock config file for this version"`
77
-
MockConfigPathX86_64string`toml:"mock-config-x86_64,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the x86_64 mock config file for this version"`
78
-
MockConfigPathAarch64string`toml:"mock-config-aarch64,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the aarch64 mock config file for this version"`
76
+
MockConfigPathstring`toml:"mock-config,omitempty" json:"mockConfig,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the mock config file for this version"`
77
+
MockConfigPathX86_64string`toml:"mock-config-x86_64,omitempty" json:"mockConfigX8664,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the x86_64 mock config file for this version"`
78
+
MockConfigPathAarch64string`toml:"mock-config-aarch64,omitempty" json:"mockConfigAarch64,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the aarch64 mock config file for this version"`
79
79
}
80
80
81
81
// Returns a copy of the distro definition with relative file paths converted to absolute
0 commit comments