mirror of
https://github.com/storytold/craft-common-actions.git
synced 2026-11-26 20:45:11 +01:00
nightly: admit 14 apps' Linux nightly tar rows (#367)
Independent review: dylanmtaylor at this exact head (https://github.com/storytold/craft-common-actions/pull/367#issuecomment-7172085284), no code blocker identified.
This commit is contained in:
1 parent
e08bf3b8d4
commit
dec63506af
7 files changed
+421
-49
No files matched your search
+350
-28
@@ -2,9 +2,32 @@
|
||||
"apps": {
|
||||
"anicraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "AniCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "anicraft-bin",
|
||||
"entrypoint": "anicraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "ANICRAFT",
|
||||
"note": "AniCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (anicraft) with anicraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/anicraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "anicraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.anicraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"artcraft": {
|
||||
"default_branch": "main",
|
||||
@@ -14,9 +37,32 @@
|
||||
},
|
||||
"cadcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "CADCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "cadcraft-bin",
|
||||
"entrypoint": "cadcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "CADCRAFT",
|
||||
"note": "CADCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (cadcraft) with cadcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/cadcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "cadcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.cadcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"craft-anything": {
|
||||
"default_branch": "main",
|
||||
@@ -32,51 +78,235 @@
|
||||
},
|
||||
"deckcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "DeckCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "deckcraft-bin",
|
||||
"entrypoint": "deckcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "DECKCRAFT",
|
||||
"note": "DeckCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (deckcraft) with deckcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/deckcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "deckcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.deckcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"designcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "DesignCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "designcraft-bin",
|
||||
"entrypoint": "designcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "DESIGNCRAFT",
|
||||
"note": "DesignCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (designcraft) with designcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/designcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "designcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.designcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"effectcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "EffectCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "effectcraft-bin",
|
||||
"entrypoint": "effectcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "EFFECTCRAFT",
|
||||
"note": "EffectCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (effectcraft) with effectcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/effectcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "effectcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.effectcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"figcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "FigCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "figcraft-bin",
|
||||
"entrypoint": "figcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "FIGCRAFT",
|
||||
"note": "FigCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (figcraft) with figcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/figcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "figcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.figcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"filmcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "FilmCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "filmcraft-bin",
|
||||
"entrypoint": "filmcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "FILMCRAFT",
|
||||
"note": "FilmCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (filmcraft) with filmcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/filmcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "filmcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.filmcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"gridcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "GridCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "gridcraft-bin",
|
||||
"entrypoint": "gridcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "GRIDCRAFT",
|
||||
"note": "GridCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (gridcraft) with gridcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/gridcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "gridcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.gridcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "LightCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "lightcraft-bin",
|
||||
"entrypoint": "lightcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "LIGHTCRAFT",
|
||||
"note": "LightCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (lightcraft) with lightcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/lightcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "lightcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.lightcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"materialcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "MaterialCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "materialcraft-bin",
|
||||
"entrypoint": "materialcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "MATERIALCRAFT",
|
||||
"note": "MaterialCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (materialcraft) with materialcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/materialcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "materialcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.materialcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"pdfcraft": {
|
||||
"default_branch": "main",
|
||||
@@ -151,27 +381,119 @@
|
||||
},
|
||||
"soundcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "SoundCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "soundcraft-bin",
|
||||
"entrypoint": "soundcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "SOUNDCRAFT",
|
||||
"note": "SoundCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (soundcraft) with soundcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/soundcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "soundcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.soundcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"texturecraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "TextureCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "texturecraft-bin",
|
||||
"entrypoint": "texturecraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "TEXTURECRAFT",
|
||||
"note": "TextureCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (texturecraft) with texturecraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/texturecraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "texturecraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.texturecraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"vectorcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "VectorCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "vectorcraft-bin",
|
||||
"entrypoint": "vectorcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "VECTORCRAFT",
|
||||
"note": "VectorCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (vectorcraft) with vectorcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/vectorcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "vectorcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.vectorcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"wordcraft": {
|
||||
"default_branch": "main",
|
||||
"note": "No source-vetted isolated package/profile adapter yet; build artifacts are not Launcher-installable.",
|
||||
"display_name": "WordCraft",
|
||||
"entrypoints": {
|
||||
"linux-x86_64": {
|
||||
"binary": "wordcraft-bin",
|
||||
"entrypoint": "wordcraft"
|
||||
}
|
||||
},
|
||||
"env_prefix": "WORDCRAFT",
|
||||
"note": "WordCraft nightly-v1 Linux x86_64 GUI tar.gz, started through the canonical launcher (wordcraft) with wordcraft-bin beside it. macOS and Windows need their own admission.",
|
||||
"repository": "storytold/wordcraft",
|
||||
"targets": []
|
||||
"targets": [
|
||||
{
|
||||
"asset_pattern": "wordcraft-{version}-linux-x86_64-nightly.tar.gz",
|
||||
"isolation": {
|
||||
"associations": "none",
|
||||
"package_identity": "ai.storyteller.wordcraft.nightly",
|
||||
"profile_contract": "nightly",
|
||||
"profile_version": 1
|
||||
},
|
||||
"target": {
|
||||
"arch": "x86_64",
|
||||
"format": "tar_gz",
|
||||
"os": "linux"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": "craft-nightly-registry/v1"
|
||||
|
||||
+57
-15
@@ -253,12 +253,14 @@ import nightly_windows as _w
|
||||
import nightly_release_platforms as _plat
|
||||
|
||||
VERSION = '1.2.3-nightly.20261122.100.1.gaaaaaaaaaaaa'
|
||||
# Apps admitted with a Linux nightly tar row only (their launcher-template PRs record these rows).
|
||||
LINUX_ROWS = ('anicraft', 'cadcraft', 'deckcraft', 'designcraft', 'effectcraft', 'figcraft', 'filmcraft', 'gridcraft', 'lightcraft', 'materialcraft', 'soundcraft', 'texturecraft', 'vectorcraft', 'wordcraft')
|
||||
ELF = b'\x7fELF\x02\x01\x01' + b'\x00' * 9 + _struct.pack('<HHI', 2, 62, 1) + b'\x00' * 40
|
||||
MACHO = _struct.pack('<8I', 0xfeedfacf, 0x0100000c, 0, 2, 0, 0, 0, 0)
|
||||
|
||||
|
||||
def second_app_registry(**row_changes):
|
||||
"""The live registry plus a synthetic reviewed DesignCraft row with all three targets."""
|
||||
"""The live registry with DesignCraft's real Linux row plus synthetic Windows and macOS targets."""
|
||||
registry = _copy.deepcopy(REGISTRY)
|
||||
ident = 'ai.storyteller.designcraft.nightly'
|
||||
isolation = {'associations': 'none', 'package_identity': ident, 'profile_contract': 'nightly', 'profile_version': 1}
|
||||
@@ -272,7 +274,7 @@ def second_app_registry(**row_changes):
|
||||
'target': {'arch': 'aarch64', 'format': 'portable_zip', 'os': 'macos'}}],
|
||||
'entrypoints': {
|
||||
# A launcher in the tar starts the GUI binary with the nightly profile.
|
||||
'linux-x86_64': {'entrypoint': 'designcraft', 'binary': 'lib/designcraft-nightly/designcraft'},
|
||||
'linux-x86_64': {'entrypoint': 'designcraft', 'binary': 'designcraft-bin'}, # as the live row
|
||||
'macos-aarch64': {'entrypoint': 'DesignCraft Nightly.app/Contents/MacOS/DesignCraft',
|
||||
'binary': 'DesignCraft Nightly.app/Contents/MacOS/DesignCraft'},
|
||||
'windows-x86_64': {'entrypoint': 'designcraft.exe', 'binary': 'designcraft.exe'}}})
|
||||
@@ -323,9 +325,9 @@ class PhotoCraftUnchangedTests(unittest.TestCase):
|
||||
base = json.loads((ROOT / 'tests/fixtures/nightly-apps-photocraft-targets-8f58b6d0.json').read_text())['photocraft']
|
||||
live = REGISTRY['apps']['photocraft']
|
||||
self.assertEqual({k: v for k, v in live.items() if k not in ('display_name', 'env_prefix', 'entrypoints')}, base)
|
||||
# No other app gained targets or the new name fields.
|
||||
# Apps without an admitted Linux row still have no targets and none of the name fields.
|
||||
for app, row in REGISTRY['apps'].items():
|
||||
if app != 'photocraft':
|
||||
if app != 'photocraft' and app not in LINUX_ROWS:
|
||||
with self.subTest(app=app):
|
||||
self.assertEqual(row['targets'], [])
|
||||
self.assertFalse({'display_name', 'env_prefix', 'entrypoints'} & set(row))
|
||||
@@ -348,8 +350,8 @@ class SecondAppTests(unittest.TestCase):
|
||||
refused = [('designcraft', 'storytold/photocraft', 'refs/heads/main', self.registry),
|
||||
('designcraft', 'someone/designcraft', 'refs/heads/main', self.registry),
|
||||
('designcraft', 'storytold/designcraft', 'refs/heads/feature', self.registry),
|
||||
('designcraft', 'storytold/designcraft', 'refs/heads/main', REGISTRY), # no targets yet
|
||||
('lightcraft', 'storytold/lightcraft', 'refs/heads/main', self.registry), # no targets
|
||||
('pdfcraft', 'storytold/pdfcraft', 'refs/heads/main', REGISTRY), # no targets
|
||||
('pdfcraft', 'storytold/pdfcraft', 'refs/heads/main', self.registry), # no targets
|
||||
('not-an-app', 'storytold/not-an-app', 'refs/heads/main', self.registry),
|
||||
('../x', 'storytold/x', 'refs/heads/main', self.registry)]
|
||||
for args in refused:
|
||||
@@ -392,7 +394,7 @@ class SecondAppTests(unittest.TestCase):
|
||||
out = _io.StringIO()
|
||||
with contextlib.redirect_stdout(out):
|
||||
self.assertEqual(names_tool.main(['path', '--app-name', 'designcraft', '--platform', 'linux-x86_64', '--kind', 'binary']), 0)
|
||||
self.assertEqual(out.getvalue().strip(), 'lib/designcraft-nightly/designcraft')
|
||||
self.assertEqual(out.getvalue().strip(), 'designcraft-bin')
|
||||
|
||||
def test_version_check_and_smoke_use_the_app_and_strip_its_env(self):
|
||||
_u.verify_version_output(f'DesignCraft {VERSION} (nightly-v1)\n', VERSION, 'designcraft')
|
||||
@@ -420,26 +422,26 @@ class SecondAppTests(unittest.TestCase):
|
||||
|
||||
def linux(self, launcher=LAUNCHER, binary=ELF, launcher_mode=0o755, binary_mode=0o755, extra=()):
|
||||
members = [('designcraft', launcher.encode() if isinstance(launcher, str) else launcher, launcher_mode),
|
||||
('lib/designcraft-nightly/designcraft', binary, binary_mode), ('LICENSE', b'synthetic notice', 0o644), *extra]
|
||||
('designcraft-bin', binary, binary_mode), ('LICENSE', b'synthetic notice', 0o644), *extra]
|
||||
return _u.verify_archive(None, 'linux-x86_64', self.tar(members), VERSION, app='designcraft')
|
||||
|
||||
def test_launcher_entrypoint_with_elf_binary_is_accepted(self):
|
||||
result = self.linux()
|
||||
self.assertEqual((result['entrypoint'], result['binary']), ('designcraft', 'lib/designcraft-nightly/designcraft'))
|
||||
self.assertEqual((result['entrypoint'], result['binary']), ('designcraft', 'designcraft-bin'))
|
||||
output = self.root / 'unpacked'
|
||||
_u.verify_archive(None, 'linux-x86_64', self.tar([('designcraft', LAUNCHER.encode(), 0o755),
|
||||
('lib/designcraft-nightly/designcraft', ELF, 0o755)]), VERSION, output, app='designcraft')
|
||||
self.assertEqual((output / 'lib/designcraft-nightly/designcraft').read_bytes(), ELF)
|
||||
('designcraft-bin', ELF, 0o755)]), VERSION, output, app='designcraft')
|
||||
self.assertEqual((output / 'designcraft-bin').read_bytes(), ELF)
|
||||
self.assertEqual((output / 'designcraft').read_bytes(), LAUNCHER.encode())
|
||||
|
||||
def test_rendered_template_is_the_only_accepted_launcher(self):
|
||||
self.assertIn('target="$dir/lib/designcraft-nightly/designcraft"\nreadonly target\n', LAUNCHER)
|
||||
self.assertIn('target="$dir/designcraft-bin"\nreadonly target\n', LAUNCHER)
|
||||
self.assertIn('/ai.storyteller.designcraft.nightly"\nreadonly profile_root\n', LAUNCHER)
|
||||
self.assertIn(' --launch-profile) exec "$target" "$@" ;;\n', LAUNCHER)
|
||||
self.assertNotIn('@BINARY@', LAUNCHER); self.assertNotIn('@APP_ID@', LAUNCHER)
|
||||
variants = {
|
||||
'trailing newline': LAUNCHER + '\n', 'missing final newline': LAUNCHER[:-1], 'CRLF': LAUNCHER.replace('\n', '\r\n'),
|
||||
'extra space': LAUNCHER.replace('set -eu', 'set -eu '), 'other binary': LAUNCHER.replace('designcraft-nightly/designcraft', 'designcraft-nightly/other'),
|
||||
'extra space': LAUNCHER.replace('set -eu', 'set -eu '), 'other binary': LAUNCHER.replace('/designcraft-bin"', '/designcraft-other"'),
|
||||
'other profile root': LAUNCHER.replace('ai.storyteller.designcraft.nightly', 'designcraft'),
|
||||
'reassigned target': LAUNCHER.replace('readonly target\n', 'readonly target\ntarget=/tmp/x\n'),
|
||||
'extra command': LAUNCHER.replace('set -eu\n', 'set -eu\nrm -f "$HOME/x"\n'),
|
||||
@@ -514,10 +516,10 @@ class LauncherTemplateRuntimeTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp = _tempfile.TemporaryDirectory(); self.addCleanup(self.temp.cleanup)
|
||||
self.root = Path(self.temp.name).resolve() / 'un packed' # a directory with a space
|
||||
(self.root / 'lib/designcraft-nightly').mkdir(parents=True)
|
||||
self.root.mkdir(parents=True)
|
||||
self.launcher = self.root / 'designcraft'
|
||||
self.launcher.write_text(LAUNCHER); self.launcher.chmod(0o755)
|
||||
stub = self.root / 'lib/designcraft-nightly/designcraft'
|
||||
stub = self.root / 'designcraft-bin'
|
||||
stub.write_text('#!/bin/sh\nfor arg in "$@"; do printf "%s\\n" "$arg"; done\n'); stub.chmod(0o755)
|
||||
|
||||
def argv(self, shell, args, env, cwd=None):
|
||||
@@ -617,5 +619,45 @@ class GeneralizedWorkflowTests(unittest.TestCase):
|
||||
self.assertTrue(any('nightly_app.py admit --require --release-ref' in s.get('run', '') for s in validate))
|
||||
|
||||
|
||||
class RegistryRowsTests(unittest.TestCase):
|
||||
"""Every admitted registry row validates and renders; names never collide."""
|
||||
def admitted(self):
|
||||
return sorted(app for app, row in REGISTRY['apps'].items() if row['targets'])
|
||||
|
||||
def test_every_admitted_row_validates_and_its_launcher_renders(self):
|
||||
self.assertEqual(self.admitted(), sorted(('photocraft',) + LINUX_ROWS))
|
||||
for app in self.admitted():
|
||||
with self.subTest(app=app):
|
||||
names = names_tool.App(app, REGISTRY)
|
||||
self.assertEqual(names.identity, f'ai.storyteller.{app}.nightly')
|
||||
self.assertEqual(names.record['repository'], f'storytold/{app}')
|
||||
for platform in names.platforms:
|
||||
if names.entrypoint(platform) != names.binary(platform):
|
||||
rendered = names_tool.render_launcher(app, platform, REGISTRY).decode()
|
||||
self.assertIn(f'target="$dir/{names.binary(platform)}"\n', rendered)
|
||||
self.assertIn(f'/{names.identity}"\n', rendered)
|
||||
for app in LINUX_ROWS:
|
||||
with self.subTest(row=app):
|
||||
row = REGISTRY['apps'][app]
|
||||
self.assertEqual(row['entrypoints'], {'linux-x86_64': {'entrypoint': app, 'binary': f'{app}-bin'}})
|
||||
self.assertEqual([t['target'] for t in row['targets']], [{'os': 'linux', 'arch': 'x86_64', 'format': 'tar_gz'}])
|
||||
self.assertEqual(row['targets'][0]['asset_pattern'], f'{app}-{{version}}-linux-x86_64-nightly.tar.gz')
|
||||
|
||||
def test_no_two_apps_share_an_identity_env_prefix_or_display_name(self):
|
||||
rows = [names_tool.App(app, REGISTRY) for app in self.admitted()]
|
||||
for field in ('identity', 'prefix', 'display'):
|
||||
values = [getattr(row, field) for row in rows]
|
||||
with self.subTest(field=field):
|
||||
self.assertEqual(len(values), len(set(values)))
|
||||
self.assertEqual(len(values), len({value.lower() for value in values}))
|
||||
|
||||
def test_designcraft_fixture_matches_the_live_row(self):
|
||||
live = REGISTRY['apps']['designcraft']
|
||||
synthetic = second_app_registry()['apps']['designcraft']
|
||||
self.assertEqual(synthetic['entrypoints']['linux-x86_64'], live['entrypoints']['linux-x86_64'])
|
||||
self.assertEqual([t for t in synthetic['targets'] if t['target']['os'] == 'linux'], live['targets'])
|
||||
self.assertEqual((synthetic['display_name'], synthetic['env_prefix']), (live['display_name'], live['env_prefix']))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -214,7 +214,9 @@ class NightlyTests(unittest.TestCase):
|
||||
production = json.loads((ROOT / "nightly-apps.json").read_text())
|
||||
self.assertGreaterEqual(len(production["apps"]), 18)
|
||||
self.assertEqual(len(production["apps"]), 19)
|
||||
self.assertEqual([name for name, row in production["apps"].items() if row["targets"]], ["photocraft"])
|
||||
# PhotoCraft's three platforms plus fourteen apps' Linux nightly tar rows (canonical launcher).
|
||||
self.assertEqual([name for name, row in production["apps"].items() if row["targets"]],
|
||||
sorted(("photocraft",) + ('anicraft', 'cadcraft', 'deckcraft', 'designcraft', 'effectcraft', 'figcraft', 'filmcraft', 'gridcraft', 'lightcraft', 'materialcraft', 'soundcraft', 'texturecraft', 'vectorcraft', 'wordcraft')))
|
||||
# One release carries every admitted platform: Windows, Linux and the notarized macOS app.
|
||||
self.assertEqual([row["target"] for row in production["apps"]["photocraft"]["targets"]],
|
||||
[{"os": "windows", "arch": "x86_64", "format": "portable_zip"},
|
||||
|
||||
@@ -69,7 +69,8 @@ class RepositoryBindingTests(unittest.TestCase):
|
||||
with self.assertRaises(ValueError): p.trusted_repository(bad,self.app,self.env)
|
||||
def test_real_second_identity_does_not_pass_photo_installable_validation(self):
|
||||
with self.assertRaises(ValueError): p.validate_prepared(self.registry,self.prepared,self.policy,self.env,self.case.config)
|
||||
self.assertEqual(self.registry['apps'][self.app]['targets'],[])
|
||||
# GridCraft now has only its Linux nightly tar row; the old Photo route still refuses it above.
|
||||
self.assertTrue(all(row['target']['os']=='linux' for row in self.registry['apps'][self.app]['targets']))
|
||||
def test_current_nonphoto_prepare_cli_still_refuses_before_token_or_transport(self):
|
||||
self.refused_without_credentials(p,['prepare','--registry',str(self.registry_path),'--config',str(self.local.config),'--app',self.app,'--identity','unused','--policy','unused'])
|
||||
def test_current_nonphoto_attestation_cli_still_refuses_before_token_or_transport(self):
|
||||
|
||||
@@ -101,7 +101,9 @@ class UnixProducerTests(unittest.TestCase):
|
||||
self.assertEqual(targets[0]['target'],{'os':'windows','arch':'x86_64','format':'portable_zip'})
|
||||
self.assertEqual([row for row in targets if row['target']['os']=='macos'],[u.registry_target(mac)])
|
||||
self.assertEqual([row for row in targets if row['target']['os']=='linux'],[u.registry_target(linux)])
|
||||
self.assertTrue(all(not row['targets'] for name,row in self.registry['apps'].items() if name!='photocraft'))
|
||||
# Other apps hold at most their Linux nightly tar row; none admits Windows or macOS.
|
||||
self.assertTrue(all(all(t['target']=={'os':'linux','arch':'x86_64','format':'tar_gz'} for t in row['targets'])
|
||||
for name,row in self.registry['apps'].items() if name!='photocraft'))
|
||||
|
||||
def test_admitted_linux_row_must_match_the_feed_registry_exactly(self):
|
||||
self.assertTrue(self.check()['feed_admitted'])
|
||||
|
||||
@@ -77,7 +77,9 @@ class WindowsCandidateTests(unittest.TestCase):
|
||||
self.assertEqual([row for row in live if row["target"]["os"] == "windows"], [golden])
|
||||
self.assertEqual(sorted(row["target"]["os"] for row in live), ["linux", "macos", "windows"])
|
||||
self.assertEqual(len(self.live_registry["apps"]), 19)
|
||||
self.assertTrue(all(not row["targets"] for app, row in self.live_registry["apps"].items() if app != "photocraft"))
|
||||
# No other app has a Windows row; some hold a Linux nightly tar row only.
|
||||
self.assertTrue(all(row["target"]["os"] == "linux" for app, record in self.live_registry["apps"].items()
|
||||
if app != "photocraft" for row in record["targets"]))
|
||||
# The Windows adapter accepts its exact row beside reviewed platform rows, never a changed one.
|
||||
self.check(registry=self.live_registry)
|
||||
changed = copy.deepcopy(self.live_registry)
|
||||
|
||||
@@ -137,9 +137,10 @@ class PublisherTests(unittest.TestCase):
|
||||
with patch.object(n, "build_feed", side_effect=AssertionError("asset I/O forbidden")):
|
||||
for app, record in self.registry["apps"].items():
|
||||
if app == "photocraft": continue
|
||||
self.assertEqual(record["targets"], [])
|
||||
env = {**self.env, "GITHUB_REPOSITORY": record["repository"]}
|
||||
with self.subTest(app=app), self.assertRaises(n.Unavailable):
|
||||
# No targets: no adapter at all. Linux-tar-only rows (release-ref route) still refuse here.
|
||||
refusal = n.Unavailable if not record["targets"] else n.InvalidNightly
|
||||
with self.subTest(app=app), self.assertRaises(refusal):
|
||||
p.prepare_packet(self.registry, {**self.prepared, "app": app}, "DO_NOT_READ", env)
|
||||
self.assertEqual(self.api.calls, [])
|
||||
|
||||
|
||||
Reference in new issue
Block a user