Skip to content
Merged
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
6 changes: 5 additions & 1 deletion landing-zone-configurator/docs/production.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ die Ankündigung des ersten Produktionsrelease zu wiederholen.
5. Veröffentlichte Quelle, Hinweise und bekannte Einschränkungen prüfen, dann in
GitHub freigeben. Der Job lädt dieselben veröffentlichten Bytes, validiert
Runner und Datenbankmigration und aktiviert erst nach Erfolg aller
Staging-Zweige. Danach prüft er HTTPS, STACKIT PKCE, die Zugriffssperren ohne
Staging-Zweige. Das App-Staging wendet das Manifest mit maskierten
Umgebungswerten an, lädt ein Paket hoch und baut dessen Droplet, ohne die
laufende App zu stoppen. `cf push --no-start` vermeiden: Die festgelegte CLI
stoppt damit bereits gestartete Apps. Lifecycle-Tests prüfen Staging ohne
Aktivierung und lehnen abweichende Paket-/Build-Nachweise ab. Danach prüft er HTTPS, STACKIT PKCE, die Zugriffssperren ohne
Anmeldung und den getrennten Runner.

Ein durch einen Menschen veröffentlichtes GitHub Release mit denselben Assets
Expand Down
6 changes: 5 additions & 1 deletion landing-zone-configurator/docs/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ production-release announcement.
5. Review the published source, notes and known limitations, then approve in
GitHub. The job downloads those published bytes unchanged, validates both
Runner and database migration, and activates only after all staging lanes
succeed. It checks HTTPS, STACKIT PKCE, unauthenticated tenant boundaries and
succeed. Application staging applies the redacted manifest, uploads a package
and builds its droplet without stopping the currently serving app. Avoid
`cf push --no-start`: the pinned CLI stops apps that are already started.
The lifecycle tests cover staging without activation and reject mismatched
package/build evidence. It checks HTTPS, STACKIT PKCE, unauthenticated tenant boundaries and
the isolated Runner afterward.

A human-published GitHub Release with the same assets also triggers this workflow.
Expand Down
39 changes: 38 additions & 1 deletion landing-zone-configurator/infra/ci/release-lifecycle.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ test("activation rejects a mismatched droplet before manifest mutation or restar
test("workflow activation is downstream of all staging lanes, while browser success gates artifact creation", () => {
const workflow = readFileSync(join(root, "../.github/workflows/configurator-release.yml"), "utf8");
const app = readFileSync(join(import.meta.dirname, "stage-release-application.sh"), "utf8");
assert.match(app, /cf push --no-start/);
assert.match(app, /cf apply-manifest .*--redact-env/);
assert.match(app, /cf create-package landing-zone-configurator/);
assert.doesNotMatch(app, /^cf push/m);
assert.match(app, /cf stage-package .*--package-guid/);
assert.doesNotMatch(app, /^cf (?:start|restart|set-droplet)/m);
assert.ok(workflow.indexOf("stage-release-migration.sh") < workflow.indexOf("run: node infra/ci/activate-release.mjs"));
Expand All @@ -92,6 +94,41 @@ test("workflow activation is downstream of all staging lanes, while browser succ
assert.match(readFileSync(join(import.meta.dirname, "stage-release-migration.sh"), "utf8"), /CF_HOME="\$LZC_PRIVATE\/cf-migration"/);
});

for (const scenario of ["running", "wrong-package", "upload-failure"]) {
test(`application staging avoids activation commands and validates evidence: ${scenario}`, () => {
const dir = mkdtempSync(join(tmpdir(), "lzc-stage-app-"));
try {
writeFileSync(join(dir, "cf"), `#!/usr/bin/env node
const fs = require('node:fs');
const args = process.argv.slice(2);
fs.appendFileSync(${JSON.stringify(join(dir, "calls"))}, JSON.stringify(args)+'\\n');
const scenario = ${JSON.stringify(scenario)};
if (args[0] === 'push' || ['stop', 'start', 'restart', 'set-droplet'].includes(args[0])) process.exit(90);
if (args[0] === 'create-package' && scenario === 'upload-failure') process.exit(7);
if (args[0] === 'app') console.log('app-id');
if (args[0] === 'curl' && args[1].startsWith('/v3/packages?')) console.log(JSON.stringify({resources:[{guid:'new-package', state:'READY'}]}));
if (args[0] === 'curl' && args[1].startsWith('/v3/builds?')) console.log(JSON.stringify({resources:[{guid:'new-build', state:'STAGED', package:{guid:scenario === 'wrong-package' ? 'other-package' : 'new-package'}, droplet:{guid:'new-droplet'}}]}));
`, { mode: 0o700 });
const result = spawnSync("bash", [join(import.meta.dirname, "stage-release-application.sh")], {
env: { ...env, PATH: `${dir}:${env.PATH}`, LZC_PRIVATE: dir }, encoding: "utf8",
});
const success = scenario === "running";
assert.equal(result.status === 0, success, result.stderr);
const calls = readFileSync(join(dir, "calls"), "utf8").trim().split("\n").map(JSON.parse);
assert.ok(calls[0].includes("--redact-env"));
assert.ok(calls[0].includes(join(dir, "app-stage-vars.json")));
assert.deepEqual(calls[1], ["create-package", "landing-zone-configurator", "-p", ".local/release"]);
assert.equal(calls.some(call => ["push", "start", "stop", "restart", "set-droplet"].includes(call[0])), false);
if (success) {
assert.deepEqual(calls[4], ["stage-package", "landing-zone-configurator", "--package-guid", "new-package"]);
assert.deepEqual(JSON.parse(readFileSync(join(dir, "app-stage.json"))), { app: "app-id", package: "new-package", build: "new-build", droplet: "new-droplet" });
} else {
assert.equal(existsSync(join(dir, "app-stage.json")) && statSync(join(dir, "app-stage.json")).size > 0, false);
}
} finally { rmSync(dir, { recursive: true, force: true }); }
});
}

test("successful activation applies final variables then assigns only the verified droplet before start", () => {
const dir = mkdtempSync(join(tmpdir(), "lzc-activation-success-"));
try {
Expand Down
3 changes: 2 additions & 1 deletion landing-zone-configurator/infra/ci/release-notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const tag=process.env.LZC_RELEASE_TAG;
if(!/^v(?:[2-9]|[1-9][0-9]+)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.test(tag??""))throw new Error("Expected a stable product release tag");
const notes={
"v2.1.1": {
introduction:"Assistant folder-naming fixes for the Landing Zone Configurator.",
introduction:"Assistant folder-naming and deployment fixes for the Landing Zone Configurator.",
changes:[
"Keep existing application instances serving while staging a release before its gated activation.",
"Propose concrete prefixed folder names alongside company settings and reuse a previously proposed prefix in follow-up requests.",
"Show folder proposals in the conversation language while preserving folder identities, access settings and unrelated configuration.",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
set -euo pipefail
# Staging uses a private snapshot with execution disabled and no Runner binding.
# Existing processes keep their previous environment; no new process starts.
cf push --no-start -f deploy/cloud-foundry/manifest.yml -p .local/release --vars-file "$LZC_PRIVATE/app-stage-vars.json" --redact-env
# push --no-start stops an already started app in CF CLI v8.17.0.
# Apply configuration and upload independently to keep its current droplet serving.
cf apply-manifest -f deploy/cloud-foundry/manifest.yml --vars-file "$LZC_PRIVATE/app-stage-vars.json" --redact-env
cf create-package landing-zone-configurator -p .local/release
app_id="$(cf app landing-zone-configurator --guid)"
package_id="$(cf curl "/v3/packages?app_guids=$app_id&order_by=-created_at&per_page=1" | jq -er '.resources | if length == 1 and .[0].state == "READY" then .[0].guid else error("Expected a ready application package") end')"
cf stage-package landing-zone-configurator --package-guid "$package_id"
Expand Down
Loading