Merge pull request 'Boards: align publication verification with the active promoter state' (#380) from fix/board-publisher-promotion-state into main

This commit is contained in:
unimatrix 2026-11-17 13:12:38 +00:00
commit 2c0b5967e5
2 changed files with 8 additions and 1 deletions

View file

@ -16,6 +16,7 @@ EXPECTED = {
'system-board-membership.php': '8d9fc7126a229b2ca0f6033ec0647946e418558981af75eb731ef5526f63a15f',
}
FILES = ['system-board-provision.php', 'provision-system-boards.php', 'system-board-membership.php']
PROMOTION_STATE = Path('/mnt/HC_Volume_107481500/dunegit/ci/promotion')
def digest(data):
@ -48,7 +49,7 @@ def main():
app = Path('/home/dunerealms/apps/dunerealms')
if (app / 'current').resolve(strict=True) != release or not re.fullmatch(r'ci-[0-9a-f]{40}', release.name):
raise RuntimeError('Use this publisher from the active CI-promoted release')
if Path('/var/lib/dunerealms-ci-promote/deployed').read_text().strip() != release.name[3:]:
if (PROMOTION_STATE / 'deployed').read_text().strip() != release.name[3:]:
raise RuntimeError('Publication state does not match the active release')
source = release / 'integrations/mybb'
target = Path('/home/dunerealms/apps/integrations/mybb').resolve(strict=True)

View file

@ -10,6 +10,12 @@ spec.loader.exec_module(publisher)
class BoardPublicationGuardTest(unittest.TestCase):
def test_publisher_uses_the_existing_promoter_state_directory(self):
promotion_spec = importlib.util.spec_from_file_location('promoter_for_board_publication', Path(__file__).with_name('promote-safe-v3.py'))
promoter = importlib.util.module_from_spec(promotion_spec)
promotion_spec.loader.exec_module(promoter)
self.assertEqual(publisher.PROMOTION_STATE, promoter.STATE)
def test_changed_native_helpers_are_refused_without_overwriting_them(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)