@patronage/factory-ci 1.0.0-alpha.18 → 1.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +29 -1
- package/dist/index.js +49 -1
- package/package.json +1 -1
- package/src/index.ts +11 -0
- package/src/pr-status-hud-workflow.ts +79 -0
package/dist/index.d.ts
CHANGED
|
@@ -904,6 +904,34 @@ interface FactoryLifecycleContractLane {
|
|
|
904
904
|
*/
|
|
905
905
|
declare const factoryLifecycleContractLane: (declaration?: FactoryLifecycleContractLaneOptions) => FactoryLifecycleContractLane | undefined;
|
|
906
906
|
//#endregion
|
|
907
|
+
//#region src/pr-status-hud-workflow.d.ts
|
|
908
|
+
declare const FACTORY_PR_STATUS_HUD_JOB_ID = "status-hud";
|
|
909
|
+
declare const FACTORY_PR_STATUS_HUD_JOB_NAME = "Present PR status HUD";
|
|
910
|
+
declare const FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID = "factory-app-token";
|
|
911
|
+
declare const FACTORY_PR_STATUS_HUD_PLAN_PATH = ".factory-memory/preview-plan.json";
|
|
912
|
+
/**
|
|
913
|
+
* Presentation is independent of deploy demand. Callers who `needs` the jobs
|
|
914
|
+
* that settle HUD sources (verify, deploy) must keep this `always()` so a
|
|
915
|
+
* skipped or withdrawn deploy still publishes Skipped rows.
|
|
916
|
+
*/
|
|
917
|
+
declare const FACTORY_PR_STATUS_HUD_IF = "always() && github.event_name == 'pull_request' && github.event.pull_request.draft != true";
|
|
918
|
+
interface FactoryPrStatusHudWorkflowOptions {
|
|
919
|
+
readonly cli?: string;
|
|
920
|
+
readonly createGithubAppToken: PinnedAction;
|
|
921
|
+
}
|
|
922
|
+
declare const FACTORY_PR_STATUS_HUD_CONCURRENCY: Readonly<{
|
|
923
|
+
cancelInProgress: false;
|
|
924
|
+
group: "status-hud-${{ github.repository }}-${{ github.event.pull_request.number }}";
|
|
925
|
+
}>;
|
|
926
|
+
interface FactoryPrStatusHudWorkflow {
|
|
927
|
+
readonly concurrency: typeof FACTORY_PR_STATUS_HUD_CONCURRENCY;
|
|
928
|
+
readonly if: typeof FACTORY_PR_STATUS_HUD_IF;
|
|
929
|
+
readonly jobId: typeof FACTORY_PR_STATUS_HUD_JOB_ID;
|
|
930
|
+
readonly jobName: typeof FACTORY_PR_STATUS_HUD_JOB_NAME;
|
|
931
|
+
readonly presentSteps: readonly WorkflowStep[];
|
|
932
|
+
}
|
|
933
|
+
declare const factoryPrStatusHudWorkflow: (options: FactoryPrStatusHudWorkflowOptions) => FactoryPrStatusHudWorkflow;
|
|
934
|
+
//#endregion
|
|
907
935
|
//#region src/preview-cleanup-topology.d.ts
|
|
908
936
|
declare const FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID = "stage-residue-audit";
|
|
909
937
|
declare const FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME = "Stage residue audit";
|
|
@@ -1301,4 +1329,4 @@ declare const assertWorkflowShellParses: (yaml: string, options: {
|
|
|
1301
1329
|
readonly source: string;
|
|
1302
1330
|
}) => void;
|
|
1303
1331
|
//#endregion
|
|
1304
|
-
export { type BundleAlchemyEntryOptions, type CheckoutStepOptions, EXECUTE_ALCHEMY_ENTRY_MAX_BUFFER, type ExecuteAlchemyEntryOptions, type ExecuteAlchemyEntryResult, FACTORY_CANDIDATE_IMPACT_BASIS_OUTPUT, FACTORY_CANDIDATE_IMPACT_DECISION_OUTPUT, FACTORY_CANDIDATE_IMPACT_INERT_OUTPUT, FACTORY_CANDIDATE_IMPACT_STEP_ID, FACTORY_CANDIDATE_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_CANDIDATE_PULL_REQUEST_TYPES, FACTORY_LIFECYCLE_CONTRACT_JOB_ID, FACTORY_LIFECYCLE_CONTRACT_JOB_NAME, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME, FACTORY_PRODUCTION_IMPACT_BASIS_OUTPUT, FACTORY_PRODUCTION_IMPACT_DECISION_OUTPUT, FACTORY_PRODUCTION_IMPACT_STEP_ID, FACTORY_PRODUCTION_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_PROOF_GATE_APP_ID, FACTORY_PROOF_GATE_CHECK_NAME, FACTORY_PROOF_GATE_GUARD, FACTORY_PROOF_GATE_IF, FACTORY_PROOF_GATE_MODE_OUTPUT, FACTORY_PROOF_GATE_OUTPUT, FACTORY_PROOF_GATE_REASONS, FACTORY_PROOF_GATE_REASON_OUTPUT, FACTORY_PROOF_GATE_SHELL, FACTORY_PROOF_GATE_SOURCE_URL_OUTPUT, FACTORY_PROOF_GATE_STEP_ID, FACTORY_PROOF_GATE_STEP_NAME, FACTORY_PUSH_IDENTITY_SCHEMA_VERSION, type FactoryCandidateImpactWorkflow, type FactoryCandidateImpactWorkflowOptions, type FactoryLifecycleContractLane, type FactoryLifecycleContractLaneOptions, type FactoryPreviewCleanupAuditJob, type FactoryPreviewCleanupDestroyJob, type FactoryPreviewCleanupTopology, type FactoryPreviewCleanupTopologyOptions, type FactoryProductionImpactWorkflow, type FactoryProductionImpactWorkflowOptions, type FactoryProofGateOptions, type FactoryProofGateReason, type FactoryProofGateStep, type FactoryProofReusePresentationOptions, type FactoryProofReuseSummaryStep, type FactoryProofTimingStartStep, type FactoryPushIdentityConsumer, type FactoryPushIdentityConsumerOptions, type FactoryPushIdentityDisposition, type FactoryPushIdentityEnvelope, type FactoryPushIdentityProducer, type FactoryPushIdentityProducerOptions, type FactoryWorkflowArtifact, type FactoryWorkflowOptions, type FactoryWorkflowSetupOptions, GitHubApiError, type GithubAppCredentials, type GithubAppTokenOptions, type InstallStepOptions, type LocalPreviewStage, type LocalPreviewStageOptions, NODE_PNPM_ACTION_FAMILY_NODE24, type NodePnpmActionFamily, PREVIEW_PROOF_INVENTORY_CHECK_NAME, type ParseLocalPreviewStageExpected, type ParsedLocalPreviewStage, type PinnedAction, type PreviewProofCandidate, type PreviewProofCleanupOutcome, type PreviewProofCleanupStatus, type PreviewProofEnvelopeEvidence, type PreviewProofInventoryAccess, type PreviewProofInventoryCleanupInput, type PreviewProofInventoryListInput, type PreviewProofInventoryPersistInput, type PreviewProofInventoryStore, type PreviewProofInventoryTransport, type PreviewProofLifecycleEvent, type PreviewProofLifecycleState, type PreviewProofRegistration, type PreviewProofResolveQuery, type ProofReuseCommand, type ProofReuseCoverageInput, type ProofReuseCoverageReport, type SetupNodeStepOptions, VITEST_PROFILE_SCHEMA_VERSION, VITEST_PROFILE_TOOL, type VitestJsonReport, type VitestProfile, type VitestProfileDependencies, type VitestProfileDurationSummary, type VitestProfileEnvironment, VitestProfileError, type VitestProfileOptions, type VitestProfileReadResult, type VitestProfileSample, type VitestProfileSampleExecution, type VitestTestStatus, type WorkflowShellParseFailure, type WorkflowStep, assertProofReuseCoverage, assertWorkflowShellParses, bundleAlchemyEntry, captureVitestProfileEnvironment, executeAlchemyEntry, factoryCandidateImpactWorkflow, factoryCandidateOrPushCondition, factoryLifecycleContractLane, factoryPreviewCleanupTopology, factoryProductionImpactWorkflow, factoryProofGateScript, factoryProofGateStep, factoryProofReuseSummaryStep, factoryProofTimingStartStep, factoryPushIdentityConsumer, factoryPushIdentityProducer, factoryWorkflow, githubAppJwt, isLocalPreviewStage, localPreviewStage, mintInstallationToken, normalizeVitestProfileSample, parseLocalPreviewStage, previewCleanupDestroyJobId, previewProofInventory, previewProofLifecycle, productionImpactTargetOutput, proofReuseCoverage, proofReuseRequiredCommands, readVitestProfileDocument, resolveProofReuseCommands, runVitestProfile, workflowRunBlocks, workflowShellParseFailures, writeVitestProfile };
|
|
1332
|
+
export { type BundleAlchemyEntryOptions, type CheckoutStepOptions, EXECUTE_ALCHEMY_ENTRY_MAX_BUFFER, type ExecuteAlchemyEntryOptions, type ExecuteAlchemyEntryResult, FACTORY_CANDIDATE_IMPACT_BASIS_OUTPUT, FACTORY_CANDIDATE_IMPACT_DECISION_OUTPUT, FACTORY_CANDIDATE_IMPACT_INERT_OUTPUT, FACTORY_CANDIDATE_IMPACT_STEP_ID, FACTORY_CANDIDATE_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_CANDIDATE_PULL_REQUEST_TYPES, FACTORY_LIFECYCLE_CONTRACT_JOB_ID, FACTORY_LIFECYCLE_CONTRACT_JOB_NAME, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME, FACTORY_PRODUCTION_IMPACT_BASIS_OUTPUT, FACTORY_PRODUCTION_IMPACT_DECISION_OUTPUT, FACTORY_PRODUCTION_IMPACT_STEP_ID, FACTORY_PRODUCTION_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_PROOF_GATE_APP_ID, FACTORY_PROOF_GATE_CHECK_NAME, FACTORY_PROOF_GATE_GUARD, FACTORY_PROOF_GATE_IF, FACTORY_PROOF_GATE_MODE_OUTPUT, FACTORY_PROOF_GATE_OUTPUT, FACTORY_PROOF_GATE_REASONS, FACTORY_PROOF_GATE_REASON_OUTPUT, FACTORY_PROOF_GATE_SHELL, FACTORY_PROOF_GATE_SOURCE_URL_OUTPUT, FACTORY_PROOF_GATE_STEP_ID, FACTORY_PROOF_GATE_STEP_NAME, FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID, FACTORY_PR_STATUS_HUD_CONCURRENCY, FACTORY_PR_STATUS_HUD_IF, FACTORY_PR_STATUS_HUD_JOB_ID, FACTORY_PR_STATUS_HUD_JOB_NAME, FACTORY_PR_STATUS_HUD_PLAN_PATH, FACTORY_PUSH_IDENTITY_SCHEMA_VERSION, type FactoryCandidateImpactWorkflow, type FactoryCandidateImpactWorkflowOptions, type FactoryLifecycleContractLane, type FactoryLifecycleContractLaneOptions, type FactoryPrStatusHudWorkflow, type FactoryPrStatusHudWorkflowOptions, type FactoryPreviewCleanupAuditJob, type FactoryPreviewCleanupDestroyJob, type FactoryPreviewCleanupTopology, type FactoryPreviewCleanupTopologyOptions, type FactoryProductionImpactWorkflow, type FactoryProductionImpactWorkflowOptions, type FactoryProofGateOptions, type FactoryProofGateReason, type FactoryProofGateStep, type FactoryProofReusePresentationOptions, type FactoryProofReuseSummaryStep, type FactoryProofTimingStartStep, type FactoryPushIdentityConsumer, type FactoryPushIdentityConsumerOptions, type FactoryPushIdentityDisposition, type FactoryPushIdentityEnvelope, type FactoryPushIdentityProducer, type FactoryPushIdentityProducerOptions, type FactoryWorkflowArtifact, type FactoryWorkflowOptions, type FactoryWorkflowSetupOptions, GitHubApiError, type GithubAppCredentials, type GithubAppTokenOptions, type InstallStepOptions, type LocalPreviewStage, type LocalPreviewStageOptions, NODE_PNPM_ACTION_FAMILY_NODE24, type NodePnpmActionFamily, PREVIEW_PROOF_INVENTORY_CHECK_NAME, type ParseLocalPreviewStageExpected, type ParsedLocalPreviewStage, type PinnedAction, type PreviewProofCandidate, type PreviewProofCleanupOutcome, type PreviewProofCleanupStatus, type PreviewProofEnvelopeEvidence, type PreviewProofInventoryAccess, type PreviewProofInventoryCleanupInput, type PreviewProofInventoryListInput, type PreviewProofInventoryPersistInput, type PreviewProofInventoryStore, type PreviewProofInventoryTransport, type PreviewProofLifecycleEvent, type PreviewProofLifecycleState, type PreviewProofRegistration, type PreviewProofResolveQuery, type ProofReuseCommand, type ProofReuseCoverageInput, type ProofReuseCoverageReport, type SetupNodeStepOptions, VITEST_PROFILE_SCHEMA_VERSION, VITEST_PROFILE_TOOL, type VitestJsonReport, type VitestProfile, type VitestProfileDependencies, type VitestProfileDurationSummary, type VitestProfileEnvironment, VitestProfileError, type VitestProfileOptions, type VitestProfileReadResult, type VitestProfileSample, type VitestProfileSampleExecution, type VitestTestStatus, type WorkflowShellParseFailure, type WorkflowStep, assertProofReuseCoverage, assertWorkflowShellParses, bundleAlchemyEntry, captureVitestProfileEnvironment, executeAlchemyEntry, factoryCandidateImpactWorkflow, factoryCandidateOrPushCondition, factoryLifecycleContractLane, factoryPrStatusHudWorkflow, factoryPreviewCleanupTopology, factoryProductionImpactWorkflow, factoryProofGateScript, factoryProofGateStep, factoryProofReuseSummaryStep, factoryProofTimingStartStep, factoryPushIdentityConsumer, factoryPushIdentityProducer, factoryWorkflow, githubAppJwt, isLocalPreviewStage, localPreviewStage, mintInstallationToken, normalizeVitestProfileSample, parseLocalPreviewStage, previewCleanupDestroyJobId, previewProofInventory, previewProofLifecycle, productionImpactTargetOutput, proofReuseCoverage, proofReuseRequiredCommands, readVitestProfileDocument, resolveProofReuseCommands, runVitestProfile, workflowRunBlocks, workflowShellParseFailures, writeVitestProfile };
|
package/dist/index.js
CHANGED
|
@@ -2006,6 +2006,54 @@ const factoryLifecycleContractLane = (declaration) => {
|
|
|
2006
2006
|
});
|
|
2007
2007
|
};
|
|
2008
2008
|
//#endregion
|
|
2009
|
+
//#region src/pr-status-hud-workflow.ts
|
|
2010
|
+
const FACTORY_PR_STATUS_HUD_JOB_ID = "status-hud";
|
|
2011
|
+
const FACTORY_PR_STATUS_HUD_JOB_NAME = "Present PR status HUD";
|
|
2012
|
+
const FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID = "factory-app-token";
|
|
2013
|
+
const FACTORY_PR_STATUS_HUD_PLAN_PATH = ".factory-memory/preview-plan.json";
|
|
2014
|
+
/**
|
|
2015
|
+
* Presentation is independent of deploy demand. Callers who `needs` the jobs
|
|
2016
|
+
* that settle HUD sources (verify, deploy) must keep this `always()` so a
|
|
2017
|
+
* skipped or withdrawn deploy still publishes Skipped rows.
|
|
2018
|
+
*/
|
|
2019
|
+
const FACTORY_PR_STATUS_HUD_IF = "always() && github.event_name == 'pull_request' && github.event.pull_request.draft != true";
|
|
2020
|
+
const FACTORY_PR_STATUS_HUD_CONCURRENCY = Object.freeze({
|
|
2021
|
+
cancelInProgress: false,
|
|
2022
|
+
group: `status-hud-\${{ github.repository }}-\${{ github.event.pull_request.number }}`
|
|
2023
|
+
});
|
|
2024
|
+
const defaultCli = "psf";
|
|
2025
|
+
const factoryPrStatusHudWorkflow = (options) => {
|
|
2026
|
+
assertPinnedAction("createGithubAppToken", options.createGithubAppToken, "actions/create-github-app-token");
|
|
2027
|
+
const cli = options.cli || defaultCli;
|
|
2028
|
+
const mintStep = Object.freeze({
|
|
2029
|
+
id: FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID,
|
|
2030
|
+
name: "Mint the factory App token",
|
|
2031
|
+
uses: options.createGithubAppToken.uses,
|
|
2032
|
+
with: Object.freeze({
|
|
2033
|
+
"client-id": FACTORY_PROOF_GATE_APP_ID,
|
|
2034
|
+
"private-key": `\${{ secrets.FACTORY_GITHUB_APP_PRIVATE_KEY }}`
|
|
2035
|
+
})
|
|
2036
|
+
});
|
|
2037
|
+
const presentStep = Object.freeze({
|
|
2038
|
+
env: Object.freeze({
|
|
2039
|
+
FACTORY_GITHUB_APP_TOKEN: `\${{ steps.${FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID}.outputs.token }}`,
|
|
2040
|
+
FACTORY_HEAD_SHA: `\${{ github.event.pull_request.head.sha }}`,
|
|
2041
|
+
FACTORY_OWNER: `\${{ github.repository_owner }}`,
|
|
2042
|
+
FACTORY_PR: `\${{ github.event.pull_request.number }}`,
|
|
2043
|
+
FACTORY_REPO: `\${{ github.event.repository.name }}`
|
|
2044
|
+
}),
|
|
2045
|
+
name: "Present the PR status HUD",
|
|
2046
|
+
run: `${cli} pr:status-hud --head "$FACTORY_HEAD_SHA" --owner "$FACTORY_OWNER" --repo "$FACTORY_REPO" --pr "$FACTORY_PR"`
|
|
2047
|
+
});
|
|
2048
|
+
return Object.freeze({
|
|
2049
|
+
concurrency: FACTORY_PR_STATUS_HUD_CONCURRENCY,
|
|
2050
|
+
if: FACTORY_PR_STATUS_HUD_IF,
|
|
2051
|
+
jobId: FACTORY_PR_STATUS_HUD_JOB_ID,
|
|
2052
|
+
jobName: FACTORY_PR_STATUS_HUD_JOB_NAME,
|
|
2053
|
+
presentSteps: Object.freeze([mintStep, presentStep])
|
|
2054
|
+
});
|
|
2055
|
+
};
|
|
2056
|
+
//#endregion
|
|
2009
2057
|
//#region src/preview-cleanup-topology.ts
|
|
2010
2058
|
const FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID = "stage-residue-audit";
|
|
2011
2059
|
const FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME = "Stage residue audit";
|
|
@@ -3126,4 +3174,4 @@ const assertWorkflowShellParses = (yaml, options) => {
|
|
|
3126
3174
|
throw new Error(`${options.source} emits shell bash cannot parse; the runner would treat it as a no-op:\n${detail}`);
|
|
3127
3175
|
};
|
|
3128
3176
|
//#endregion
|
|
3129
|
-
export { EXECUTE_ALCHEMY_ENTRY_MAX_BUFFER, FACTORY_CANDIDATE_IMPACT_BASIS_OUTPUT, FACTORY_CANDIDATE_IMPACT_DECISION_OUTPUT, FACTORY_CANDIDATE_IMPACT_INERT_OUTPUT, FACTORY_CANDIDATE_IMPACT_STEP_ID, FACTORY_CANDIDATE_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_CANDIDATE_PULL_REQUEST_TYPES, FACTORY_LIFECYCLE_CONTRACT_JOB_ID, FACTORY_LIFECYCLE_CONTRACT_JOB_NAME, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME, FACTORY_PRODUCTION_IMPACT_BASIS_OUTPUT, FACTORY_PRODUCTION_IMPACT_DECISION_OUTPUT, FACTORY_PRODUCTION_IMPACT_STEP_ID, FACTORY_PRODUCTION_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_PROOF_GATE_APP_ID, FACTORY_PROOF_GATE_CHECK_NAME, FACTORY_PROOF_GATE_GUARD, FACTORY_PROOF_GATE_IF, FACTORY_PROOF_GATE_MODE_OUTPUT, FACTORY_PROOF_GATE_OUTPUT, FACTORY_PROOF_GATE_REASONS, FACTORY_PROOF_GATE_REASON_OUTPUT, FACTORY_PROOF_GATE_SHELL, FACTORY_PROOF_GATE_SOURCE_URL_OUTPUT, FACTORY_PROOF_GATE_STEP_ID, FACTORY_PROOF_GATE_STEP_NAME, FACTORY_PUSH_IDENTITY_SCHEMA_VERSION, GitHubApiError, NODE_PNPM_ACTION_FAMILY_NODE24, PREVIEW_PROOF_INVENTORY_CHECK_NAME, VITEST_PROFILE_SCHEMA_VERSION, VITEST_PROFILE_TOOL, VitestProfileError, assertProofReuseCoverage, assertWorkflowShellParses, bundleAlchemyEntry, captureVitestProfileEnvironment, executeAlchemyEntry, factoryCandidateImpactWorkflow, factoryCandidateOrPushCondition, factoryLifecycleContractLane, factoryPreviewCleanupTopology, factoryProductionImpactWorkflow, factoryProofGateScript, factoryProofGateStep, factoryProofReuseSummaryStep, factoryProofTimingStartStep, factoryPushIdentityConsumer, factoryPushIdentityProducer, factoryWorkflow, githubAppJwt, isLocalPreviewStage, localPreviewStage, mintInstallationToken, normalizeVitestProfileSample, parseLocalPreviewStage, previewCleanupDestroyJobId, previewProofInventory, previewProofLifecycle, productionImpactTargetOutput, proofReuseCoverage, proofReuseRequiredCommands, readVitestProfileDocument, resolveProofReuseCommands, runVitestProfile, workflowRunBlocks, workflowShellParseFailures, writeVitestProfile };
|
|
3177
|
+
export { EXECUTE_ALCHEMY_ENTRY_MAX_BUFFER, FACTORY_CANDIDATE_IMPACT_BASIS_OUTPUT, FACTORY_CANDIDATE_IMPACT_DECISION_OUTPUT, FACTORY_CANDIDATE_IMPACT_INERT_OUTPUT, FACTORY_CANDIDATE_IMPACT_STEP_ID, FACTORY_CANDIDATE_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_CANDIDATE_PULL_REQUEST_TYPES, FACTORY_LIFECYCLE_CONTRACT_JOB_ID, FACTORY_LIFECYCLE_CONTRACT_JOB_NAME, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID, FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME, FACTORY_PRODUCTION_IMPACT_BASIS_OUTPUT, FACTORY_PRODUCTION_IMPACT_DECISION_OUTPUT, FACTORY_PRODUCTION_IMPACT_STEP_ID, FACTORY_PRODUCTION_IMPACT_UNSUBSCRIBED_OUTPUT, FACTORY_PROOF_GATE_APP_ID, FACTORY_PROOF_GATE_CHECK_NAME, FACTORY_PROOF_GATE_GUARD, FACTORY_PROOF_GATE_IF, FACTORY_PROOF_GATE_MODE_OUTPUT, FACTORY_PROOF_GATE_OUTPUT, FACTORY_PROOF_GATE_REASONS, FACTORY_PROOF_GATE_REASON_OUTPUT, FACTORY_PROOF_GATE_SHELL, FACTORY_PROOF_GATE_SOURCE_URL_OUTPUT, FACTORY_PROOF_GATE_STEP_ID, FACTORY_PROOF_GATE_STEP_NAME, FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID, FACTORY_PR_STATUS_HUD_CONCURRENCY, FACTORY_PR_STATUS_HUD_IF, FACTORY_PR_STATUS_HUD_JOB_ID, FACTORY_PR_STATUS_HUD_JOB_NAME, FACTORY_PR_STATUS_HUD_PLAN_PATH, FACTORY_PUSH_IDENTITY_SCHEMA_VERSION, GitHubApiError, NODE_PNPM_ACTION_FAMILY_NODE24, PREVIEW_PROOF_INVENTORY_CHECK_NAME, VITEST_PROFILE_SCHEMA_VERSION, VITEST_PROFILE_TOOL, VitestProfileError, assertProofReuseCoverage, assertWorkflowShellParses, bundleAlchemyEntry, captureVitestProfileEnvironment, executeAlchemyEntry, factoryCandidateImpactWorkflow, factoryCandidateOrPushCondition, factoryLifecycleContractLane, factoryPrStatusHudWorkflow, factoryPreviewCleanupTopology, factoryProductionImpactWorkflow, factoryProofGateScript, factoryProofGateStep, factoryProofReuseSummaryStep, factoryProofTimingStartStep, factoryPushIdentityConsumer, factoryPushIdentityProducer, factoryWorkflow, githubAppJwt, isLocalPreviewStage, localPreviewStage, mintInstallationToken, normalizeVitestProfileSample, parseLocalPreviewStage, previewCleanupDestroyJobId, previewProofInventory, previewProofLifecycle, productionImpactTargetOutput, proofReuseCoverage, proofReuseRequiredCommands, readVitestProfileDocument, resolveProofReuseCommands, runVitestProfile, workflowRunBlocks, workflowShellParseFailures, writeVitestProfile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patronage/factory-ci",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.19",
|
|
4
4
|
"description": "Deep CI and deploy building blocks for Patronage factory projects: workflow source artifacts, hosted diff classification, Alchemy entry execution, and disposable-stage semantics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"alchemy",
|
package/src/index.ts
CHANGED
|
@@ -124,6 +124,17 @@ export {
|
|
|
124
124
|
type FactoryLifecycleContractLaneOptions,
|
|
125
125
|
factoryLifecycleContractLane,
|
|
126
126
|
} from "./lifecycle-contract-lane.ts";
|
|
127
|
+
export {
|
|
128
|
+
FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID,
|
|
129
|
+
FACTORY_PR_STATUS_HUD_CONCURRENCY,
|
|
130
|
+
FACTORY_PR_STATUS_HUD_IF,
|
|
131
|
+
FACTORY_PR_STATUS_HUD_JOB_ID,
|
|
132
|
+
FACTORY_PR_STATUS_HUD_JOB_NAME,
|
|
133
|
+
FACTORY_PR_STATUS_HUD_PLAN_PATH,
|
|
134
|
+
type FactoryPrStatusHudWorkflow,
|
|
135
|
+
type FactoryPrStatusHudWorkflowOptions,
|
|
136
|
+
factoryPrStatusHudWorkflow,
|
|
137
|
+
} from "./pr-status-hud-workflow.ts";
|
|
127
138
|
export {
|
|
128
139
|
FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_ID,
|
|
129
140
|
FACTORY_PREVIEW_CLEANUP_AUDIT_JOB_NAME,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { PinnedAction } from "./actions.ts";
|
|
2
|
+
import type { WorkflowStep } from "./factory-workflow.ts";
|
|
3
|
+
import { assertPinnedAction } from "./pinned-action.ts";
|
|
4
|
+
import { FACTORY_PROOF_GATE_APP_ID } from "./proof-reuse-gate.ts";
|
|
5
|
+
|
|
6
|
+
export const FACTORY_PR_STATUS_HUD_JOB_ID = "status-hud";
|
|
7
|
+
export const FACTORY_PR_STATUS_HUD_JOB_NAME = "Present PR status HUD";
|
|
8
|
+
export const FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID = "factory-app-token";
|
|
9
|
+
export const FACTORY_PR_STATUS_HUD_PLAN_PATH =
|
|
10
|
+
".factory-memory/preview-plan.json";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Presentation is independent of deploy demand. Callers who `needs` the jobs
|
|
14
|
+
* that settle HUD sources (verify, deploy) must keep this `always()` so a
|
|
15
|
+
* skipped or withdrawn deploy still publishes Skipped rows.
|
|
16
|
+
*/
|
|
17
|
+
export const FACTORY_PR_STATUS_HUD_IF =
|
|
18
|
+
"always() && github.event_name == 'pull_request' && github.event.pull_request.draft != true";
|
|
19
|
+
|
|
20
|
+
export interface FactoryPrStatusHudWorkflowOptions {
|
|
21
|
+
readonly cli?: string;
|
|
22
|
+
readonly createGithubAppToken: PinnedAction;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const FACTORY_PR_STATUS_HUD_CONCURRENCY = Object.freeze({
|
|
26
|
+
cancelInProgress: false,
|
|
27
|
+
group: `status-hud-\${{ github.repository }}-\${{ github.event.pull_request.number }}`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export interface FactoryPrStatusHudWorkflow {
|
|
31
|
+
readonly concurrency: typeof FACTORY_PR_STATUS_HUD_CONCURRENCY;
|
|
32
|
+
readonly if: typeof FACTORY_PR_STATUS_HUD_IF;
|
|
33
|
+
readonly jobId: typeof FACTORY_PR_STATUS_HUD_JOB_ID;
|
|
34
|
+
readonly jobName: typeof FACTORY_PR_STATUS_HUD_JOB_NAME;
|
|
35
|
+
readonly presentSteps: readonly WorkflowStep[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const defaultCli = "psf";
|
|
39
|
+
|
|
40
|
+
export const factoryPrStatusHudWorkflow = (
|
|
41
|
+
options: FactoryPrStatusHudWorkflowOptions
|
|
42
|
+
): FactoryPrStatusHudWorkflow => {
|
|
43
|
+
assertPinnedAction(
|
|
44
|
+
"createGithubAppToken",
|
|
45
|
+
options.createGithubAppToken,
|
|
46
|
+
"actions/create-github-app-token"
|
|
47
|
+
);
|
|
48
|
+
const cli = options.cli || defaultCli;
|
|
49
|
+
// Same unscoped mint as the freeze job. A subset (checks/issues/PRs)
|
|
50
|
+
// 422s: those permissions are not granted to this installation.
|
|
51
|
+
const mintStep: WorkflowStep = Object.freeze({
|
|
52
|
+
id: FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID,
|
|
53
|
+
name: "Mint the factory App token",
|
|
54
|
+
uses: options.createGithubAppToken.uses,
|
|
55
|
+
with: Object.freeze({
|
|
56
|
+
"client-id": FACTORY_PROOF_GATE_APP_ID,
|
|
57
|
+
"private-key": `\${{ secrets.FACTORY_GITHUB_APP_PRIVATE_KEY }}`,
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
const presentStep: WorkflowStep = Object.freeze({
|
|
61
|
+
env: Object.freeze({
|
|
62
|
+
FACTORY_GITHUB_APP_TOKEN: `\${{ steps.${FACTORY_PR_STATUS_HUD_APP_TOKEN_STEP_ID}.outputs.token }}`,
|
|
63
|
+
FACTORY_HEAD_SHA: `\${{ github.event.pull_request.head.sha }}`,
|
|
64
|
+
FACTORY_OWNER: `\${{ github.repository_owner }}`,
|
|
65
|
+
FACTORY_PR: `\${{ github.event.pull_request.number }}`,
|
|
66
|
+
FACTORY_REPO: `\${{ github.event.repository.name }}`,
|
|
67
|
+
}),
|
|
68
|
+
name: "Present the PR status HUD",
|
|
69
|
+
run: `${cli} pr:status-hud --head "$FACTORY_HEAD_SHA" --owner "$FACTORY_OWNER" --repo "$FACTORY_REPO" --pr "$FACTORY_PR"`,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
concurrency: FACTORY_PR_STATUS_HUD_CONCURRENCY,
|
|
74
|
+
if: FACTORY_PR_STATUS_HUD_IF,
|
|
75
|
+
jobId: FACTORY_PR_STATUS_HUD_JOB_ID,
|
|
76
|
+
jobName: FACTORY_PR_STATUS_HUD_JOB_NAME,
|
|
77
|
+
presentSteps: Object.freeze([mintStep, presentStep]),
|
|
78
|
+
});
|
|
79
|
+
};
|