Merge remote-tracking branch 'origin/v0.3' into fix/2835-cicd-plan

This commit is contained in:
root
2026-07-22 08:29:42 +02:00
3 changed files with 51 additions and 7 deletions
+3 -6
View File
@@ -1223,9 +1223,8 @@ lanes:
HWPOD_TEMPORAL_ADDRESS: temporal-frontend.temporal.svc.cluster.local:7233
HWPOD_TEMPORAL_NAMESPACE: unidesk
HWPOD_TEMPORAL_TASK_QUEUE: hwlab-v03-hwpod
HWPOD_RUNTIME_API_URL: http://hwlab-cloud-api.hwlab-v03.svc.cluster.local:6667
HWPOD_RUNTIME_API_AUTHORIZATION: secretRef:hwlab-v03-master-server-admin-api-key/api-key
HWPOD_RUNTIME_API_AUTHORIZATION_PREFIX: Bearer
HWPOD_NODE_OPS_API_URL: http://hwlab-hwpod-api.hwlab-v03.svc.cluster.local:6681
HWPOD_NODE_WS_TOKEN: secretRef:hwlab-v03-hwpod-node-auth/token
HWPOD_SPEC_DATABASE_URL: secretRef:hwlab-cloud-api-v03-db/database-url
HWPOD_SPEC_DATABASE_SCHEMA: hwpod
HWPOD_SPEC_DATABASE_TABLE: runtime_specs
@@ -1245,9 +1244,7 @@ lanes:
HWPOD_TEMPORAL_ADDRESS: temporal-frontend.temporal.svc.cluster.local:7233
HWPOD_TEMPORAL_NAMESPACE: unidesk
HWPOD_TEMPORAL_TASK_QUEUE: hwlab-v03-hwpod
HWPOD_RUNTIME_API_URL: http://hwlab-cloud-api.hwlab-v03.svc.cluster.local:6667
HWPOD_RUNTIME_API_AUTHORIZATION: secretRef:hwlab-v03-master-server-admin-api-key/api-key
HWPOD_RUNTIME_API_AUTHORIZATION_PREFIX: Bearer
HWPOD_NODE_OPS_API_URL: http://hwlab-hwpod-api.hwlab-v03.svc.cluster.local:6681
HWPOD_SPEC_DATABASE_URL: secretRef:hwlab-cloud-api-v03-db/database-url
HWPOD_SPEC_DATABASE_SCHEMA: hwpod
HWPOD_SPEC_DATABASE_TABLE: runtime_specs
+36
View File
@@ -446,6 +446,42 @@ test("node CI planner scopes runtime config rendering to the changed service wit
assert.equal(plan.ciCdPlan.noImageBuildReason, "runtime-config-only-change");
});
test("v03 planner scopes lane service runtime overrides without image builds", async () => {
const selectedServices = ["hwlab-cloud-api", "hwlab-cloud-web", "hwlab-gateway"];
const repo = await createFixtureRepo({ serviceIds: selectedServices });
const deployPath = path.join(repo, "deploy/deploy.yaml");
const deploy = await readStructuredFile(repo, deployPath);
deploy.lanes.v03.services = selectedServices.map((serviceId) => ({ serviceId, env: { RUNTIME_REVISION: "v1" } }));
await writeStructuredFile(repo, deployPath, deploy);
await git(repo, ["add", "deploy/deploy.yaml"]);
await git(repo, ["commit", "-m", "seed v03 runtime overrides"]);
deploy.lanes.v03.services.find((service) => service.serviceId === "hwlab-cloud-api").env.RUNTIME_REVISION = "v2";
deploy.lanes.v03.services.find((service) => service.serviceId === "hwlab-cloud-web").env.RUNTIME_REVISION = "v2";
await writeStructuredFile(repo, deployPath, deploy);
await git(repo, ["add", "deploy/deploy.yaml"]);
await git(repo, ["commit", "-m", "change two v03 runtime overrides"]);
const plan = await createCiPlan({
repoRoot: repo,
lane: "v03",
baseRef: "HEAD~1",
targetRef: "HEAD",
artifactCatalogPath: "deploy/artifact-catalog.v03.json",
services: selectedServices
});
assert.deepEqual(plan.affectedServices, ["hwlab-cloud-api", "hwlab-cloud-web"]);
assert.deepEqual(plan.rolloutServices, ["hwlab-cloud-api", "hwlab-cloud-web"]);
assert.deepEqual(plan.buildServices, []);
assert.deepEqual(plan.rolloutWithoutImageBuildServices, ["hwlab-cloud-api", "hwlab-cloud-web"]);
assert.deepEqual(plan.reusedServices, ["hwlab-gateway"]);
assert.equal(plan.services.find((service) => service.serviceId === "hwlab-cloud-api").runtimeConfigChanged, true);
assert.equal(plan.services.find((service) => service.serviceId === "hwlab-cloud-web").runtimeConfigChanged, true);
assert.equal(plan.services.find((service) => service.serviceId === "hwlab-gateway").runtimeConfigChanged, false);
assert.equal(plan.ciCdPlan.noImageBuildReason, "runtime-config-only-change");
});
test("node CI planner keeps Tekton renderer changes out of runtime rollout scope", async () => {
const repo = await createFixtureRepo();
await mkdir(path.join(repo, "scripts/src/gitops-render"), { recursive: true });
+12 -1
View File
@@ -748,10 +748,21 @@ function serviceRuntimeConfigIdentity(deployJson, lane, serviceId) {
healthPort: Number.isInteger(declaration.healthPort) ? declaration.healthPort : null,
healthProbe: normalizeServiceHealthProbe(declaration.healthProbe),
env: normalizeServiceEnv(declaration.env),
observable: declaration.observable === true
observable: declaration.observable === true,
baseRuntimeService: runtimeServiceConfigById(deployJson?.services, serviceId),
laneRuntimeService: runtimeServiceConfigById(laneConfig?.services, serviceId)
};
}
function runtimeServiceConfigById(services, serviceId) {
if (!Array.isArray(services)) return null;
let match = null;
for (const service of services) {
if (service?.serviceId === serviceId) match = service;
}
return match;
}
export async function packageRuntimeFieldsChanged(repoRoot, baseRef, targetRef, filePath = "package.json") {
const [before, after] = await Promise.all([
readJsonFromGit(repoRoot, baseRef, filePath, null),