feat(release): automate versioned releases on main

This commit is contained in:
2026-09-17 18:41:53 +02:00
parent dd37622bb6
commit 92859f3ccf
39 changed files with 7365 additions and 243 deletions

View File

@@ -0,0 +1,25 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import Fastify from 'fastify';
import healthRoutes from '../src/routes/health';
test('version endpoint reports image metadata without a database or authentication', async () => {
const previousVersion = process.env.FEDEO_VERSION;
const previousRevision = process.env.FEDEO_REVISION;
process.env.FEDEO_VERSION = '1.2.3';
process.env.FEDEO_REVISION = 'a'.repeat(40);
const app = Fastify();
try {
await app.register(healthRoutes);
const response = await app.inject({ method: 'GET', url: '/version' });
assert.equal(response.statusCode, 200);
assert.equal(response.headers['cache-control'], 'no-store');
assert.deepEqual(response.json(), { product: 'FEDEO', version: '1.2.3', revision: 'a'.repeat(40) });
} finally {
await app.close();
if (previousVersion === undefined) delete process.env.FEDEO_VERSION;
else process.env.FEDEO_VERSION = previousVersion;
if (previousRevision === undefined) delete process.env.FEDEO_REVISION;
else process.env.FEDEO_REVISION = previousRevision;
}
});