Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ export async function runBuild(cwd: string, args: string[] = []): Promise<string
]);
const maxCodexAttempts = config.workflows.build.maxCodexAttempts ?? 3;

const buildVerificationCommands = provenance.buildVerificationCommands.source === "repo"
? []
: (config.workflows.build.verificationCommands ?? []);
const defaultVerificationCommands = provenance.defaultVerificationCommands.source === "repo"
? []
: (config.verification?.defaultCommands ?? []);
const verificationCommands = [
...(config.workflows.build.verificationCommands ?? []),
...((config.workflows.build.verificationCommands?.length ?? 0) > 0 ? [] : (config.verification?.defaultCommands ?? []))
...buildVerificationCommands,
...(buildVerificationCommands.length > 0 ? [] : defaultVerificationCommands)
];
const requestedMode = parsed.options.requestedMode ?? config.workflows.build.mode ?? "interactive";
const timeoutSeconds = config.workflows.build.timeoutSeconds;
Expand Down
8 changes: 8 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ function validateConfigDocument(source: string, value: unknown): void {
function createDefaultProvenance(): ConfigProvenance {
return {
codexSandbox: { source: "default" },
buildVerificationCommands: { source: "default" },
defaultVerificationCommands: { source: "default" },
workflowAllowDirty: {
build: { source: "default" },
ship: { source: "default" },
Expand All @@ -565,6 +567,12 @@ function updateProvenanceFromDocument(
if (hasConfigPath(parsed, ["codex", "sandbox"])) {
provenance.codexSandbox = { source: sourceKind, sourcePath };
}
if (hasConfigPath(parsed, ["workflows", "build", "verificationCommands"])) {
provenance.buildVerificationCommands = { source: sourceKind, sourcePath };
}
if (hasConfigPath(parsed, ["verification", "defaultCommands"])) {
provenance.defaultVerificationCommands = { source: sourceKind, sourcePath };
}
for (const workflowName of ["build", "ship", "deliver"] as const) {
if (hasConfigPath(parsed, ["workflows", workflowName, "allowDirty"])) {
provenance.workflowAllowDirty[workflowName] = { source: sourceKind, sourcePath };
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ export interface ConfigValueProvenance {

export interface ConfigProvenance {
codexSandbox: ConfigValueProvenance;
buildVerificationCommands: ConfigValueProvenance;
defaultVerificationCommands: ConfigValueProvenance;
workflowAllowDirty: {
build: ConfigValueProvenance;
ship: ConfigValueProvenance;
Expand Down
Loading