Require release versions for script uploads
CI / checks (push) Successful in 5m26s

This commit is contained in:
2026-10-12 18:46:57 -04:00
parent ffda04f276
commit 2f52dcb1ef
50 changed files with 871 additions and 113 deletions
+15 -2
View File
@@ -28,6 +28,7 @@ async function setup() {
const { destOfKind, configFileOf } = await import('../../src/lib/server/config.js');
const create = (game: string, path = 'shared.gsc') =>
library.createScript({
releaseVersion: '1.0.0',
name: `${game} ${path}`,
targetRelPath: path,
scopeType: 'game',
@@ -82,7 +83,11 @@ describe('multi-game beta bundles', () => {
expect(ownerOf(t5[0], 'six.gsc')).toBeNull();
await activateFiles('beta', betaId);
await x.reviseBeta(betaId, 1, [
{ scriptId: files[1].script.id, content: Buffer.from('t6 revised') }
{
scriptId: files[1].script.id,
releaseVersion: '1.0.1',
content: Buffer.from('t6 revised')
}
]);
expect(
x.stagedFileChanges('beta', String(betaId)).map((row) => [row.server, row.rel_path])
@@ -115,7 +120,12 @@ describe('multi-game beta bundles', () => {
await import('../../src/lib/server/fleet/inventory.js');
const files = [x.create('t5'), x.create('t6')];
const priors = files.map((file) =>
x.uploadNewVersion(file.script.id, Buffer.from(`${file.script.scope_value} original`))
x.uploadNewVersion(
file.script.id,
Buffer.from(`${file.script.scope_value} original`),
undefined,
'1.0.1'
)
);
for (let i = 0; i < files.length; i++) {
x.db
@@ -221,6 +231,7 @@ describe('multi-game beta bundles', () => {
it('applies unscoped files to every selected server alongside game-specific files', async () => {
const x = await setup();
const shared = x.createScript({
releaseVersion: '1.0.0',
name: 'Shared helper',
targetRelPath: 'helper.gsc',
content: Buffer.from('shared')
@@ -250,6 +261,7 @@ describe('multi-game beta bundles', () => {
await expect(x.open([five, six], [t5[0]])).rejects.toMatchObject({ kind: 'out-of-scope' });
await expect(x.open([five], participants)).rejects.toMatchObject({ kind: 'out-of-scope' });
const overlap = x.createScript({
releaseVersion: '1.0.0',
name: 'Map overlap',
targetRelPath: 'shared.gsc',
scopeType: 'map',
@@ -260,6 +272,7 @@ describe('multi-game beta bundles', () => {
kind: 'duplicate-target'
});
const global = x.createScript({
releaseVersion: '1.0.0',
name: 'Global overlap',
targetRelPath: 'shared.gsc',
content: Buffer.from('overlap')