暴露项目发布 gate manifest API
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export { createLinuxCncIniSdk } from "./linuxcnc-ini.js";
|
||||
export { createLinuxCncInterpSdk } from "./linuxcnc-interp.js";
|
||||
export {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessReport,
|
||||
parseProjectReleaseReadinessArtifactJson,
|
||||
|
||||
@@ -98,6 +98,21 @@ function arrayOrEmpty(value) {
|
||||
return Array.isArray(value) ? value : [];
|
||||
}
|
||||
|
||||
export function createProjectReleaseGateManifest() {
|
||||
return {
|
||||
apiName: "project-release-gate-manifest",
|
||||
manifestVersion: 1,
|
||||
gateCount: REQUIRED_RELEASE_GATES.length,
|
||||
gateIds: REQUIRED_RELEASE_GATES.map(({ id }) => id),
|
||||
gates: REQUIRED_RELEASE_GATES.map((gate) => ({
|
||||
id: gate.id,
|
||||
label: gate.label,
|
||||
command: gate.command,
|
||||
expectedOutput: gate.expectedOutput ?? null,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessReport({
|
||||
gateResults = {},
|
||||
observedOutputs = [],
|
||||
@@ -106,7 +121,8 @@ export function createProjectReleaseReadinessReport({
|
||||
promotedRuntimeFamilies = [],
|
||||
} = {}) {
|
||||
const outputs = Array.isArray(observedOutputs) ? observedOutputs : [];
|
||||
const gateRows = REQUIRED_RELEASE_GATES.map((gate) => {
|
||||
const gateManifest = createProjectReleaseGateManifest();
|
||||
const gateRows = gateManifest.gates.map((gate) => {
|
||||
const passed = readGatePassed({ gate, gateResults, observedOutputs: outputs });
|
||||
return {
|
||||
id: gate.id,
|
||||
@@ -149,6 +165,7 @@ export function createProjectReleaseReadinessReport({
|
||||
blockedRuntimeFamilies: blockedFamilies,
|
||||
promotedRuntimeFamilies: promotedFamilies,
|
||||
promotedBlockedFamilies,
|
||||
gateManifest,
|
||||
gates: gateRows,
|
||||
rows: [
|
||||
{
|
||||
@@ -215,6 +232,8 @@ export function createProjectReleaseReadinessArtifactValidation(artifact = {}) {
|
||||
artifactApiName: artifactObject.apiName ?? null,
|
||||
artifactVersion: artifactObject.reportVersion ?? null,
|
||||
gateCount: gates.length,
|
||||
expectedGateCount: REQUIRED_RELEASE_GATES.length,
|
||||
expectedGateIds: createProjectReleaseGateManifest().gateIds,
|
||||
blockedRuntimeFamilies: arrayOrEmpty(artifactObject.blockedRuntimeFamilies),
|
||||
rows: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user