Require completed annotation upgrade before accepting evidence
Metadata integrity checks / metadata (push) Failing after 1m5s

This commit is contained in:
2026-11-08 18:40:51 +08:00
parent 27e336eee9
commit a13c535919
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ def _url(value):
def _require(conn):
if not available(conn):
if not available(conn) or not conn.execute('SELECT 1 FROM schema_migrations WHERE name=?', (MIGRATION,)).fetchone():
raise RuntimeError('Run paper-atlas annotate init explicitly before adding annotations')
+7
View File
@@ -59,6 +59,13 @@ class AnnotationTests(unittest.TestCase):
self.assertTrue(initialize(self.c)); self.assertFalse(initialize(self.c))
self.assertEqual(len(schema.inspect(self.c)), 22)
def test_unmarked_table_cannot_receive_assertions(self):
initialize(self.c)
self.c.execute("DELETE FROM schema_migrations WHERE name='annotation_events_v1'")
with self.assertRaisesRegex(RuntimeError, 'init explicitly'):
self.add()
self.assertEqual(self.c.execute('SELECT count(*) FROM annotation_events').fetchone()[0], 0)
def test_types_tags_and_platform_labels_are_independent_and_queryable(self):
initialize(self.c)
self.add()