Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveDeps ¶
ResolveDeps populates the Deps field on each workspace pack by looking up dependencies in the combined allPacks slice (workspace + bundle packs).
func Validate ¶ added in v0.1.1
func Validate(opts *ValidateOptions) error
Validate compares the result findings of two SARIF files. It is intended for use in bundle integration tests, where the actual analysis output is checked against a checked-in expected SARIF.
Comparison is restricted to the semantic findings (ruleId, message text, and physical locations) — telemetry, timestamps, tool versions, and absolute machine paths are intentionally ignored, as they vary between runs. Artifact URIs are compared by basename so that the same finding produced under different source-root prefixes (e.g. local vs. CI) still matches.
func ValidatePlatforms ¶
ValidatePlatforms checks that each platform is one of linux64/osx64/win64.
Types ¶
type CreateOptions ¶
type CreateOptions struct {
// BundlePath is the path to the base CodeQL bundle archive (.tar.gz).
BundlePath string
// WorkspaceDir is the CodeQL workspace containing the packs to add.
WorkspaceDir string
// Packs is the resolved set of workspace packs to include in the bundle.
Packs []*pack.Pack
// OutputPath is where the resulting bundle archive is written.
// If Platforms is non-empty, this is treated as a directory; otherwise as a file path.
OutputPath string
// Platforms restricts output to specific platforms ("linux64", "osx64", "win64").
// Empty means a single platform-agnostic bundle.
Platforms []string
// NoPrecompile skips pre-compilation when bundling packs.
NoPrecompile bool
// Minimal creates a minimal bundle with only the selected packs and no additional
// dependencies. Currently a no-op; reserved for future use.
Minimal bool
}
CreateOptions controls how the custom bundle is built.
func NewCreateOptions ¶
func NewCreateOptions(base, bundlePath, output string, noPrecompile, minimal bool, platforms []string) (*CreateOptions, error)
type CustomBundle ¶
type CustomBundle struct {
// contains filtered or unexported fields
}
func NewCustomBundle ¶
func NewCustomBundle(opts *CreateOptions, tmpDir string) *CustomBundle
func (*CustomBundle) Create ¶
func (ctx *CustomBundle) Create() error
Create builds a custom CodeQL bundle by extending the base bundle with the configured workspace packs. The flow is:
- Extract the base bundle into a temp directory.
- Clear the bundle's qlpacks/ directory (a clean slate; stdlib deps are restored in step 6).
- For each workspace pack, copy it under <tmp>/temp and run `codeql pack install --common-caches=<tmp>/common-caches` then `codeql pack create --output=<qlpacksDir> --common-caches=<tmp>/common-caches`.
- Copy <tmp>/common-caches/packages/* into <qlpacksDir> so the bundle contains every resolved dependency.
- Repack the modified bundle, either as a single archive or one per requested platform.
Customization packs are skipped with a warning (future work).
type PackProcessor ¶
PackProcessor encapsulates the build-time handling of a single workspace pack while assembling a custom CodeQL bundle. Each pack kind has its own implementation, selected once at pack-discovery time so the orchestrator loop in CustomBundle.Create can call Process without further dispatch.
type ValidateOptions ¶ added in v0.1.1
ValidateOptions configures Validate.