Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/unit/test_registry_platform_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async def test_startup_sync_schedules_artifact_for_resolved_version(

mock_result = SimpleNamespace(
version=SimpleNamespace(id=uuid.uuid4()),
version_string="1.0.0.dev20260522140000",
version_string="1.0.0.post20260522140000+collision.123456",
num_actions=0,
actions=[],
)
Expand All @@ -480,7 +480,7 @@ async def test_startup_sync_schedules_artifact_for_resolved_version(
await _sync_as_leader(session, "1.0.0")

schedule_build.assert_called_once_with(
"1.0.0.dev20260522140000",
"1.0.0.post20260522140000+collision.123456",
promote_version_id=None,
expected_current_version_id=None,
)
Expand Down Expand Up @@ -584,7 +584,7 @@ async def test_promote_after_artifact_build_promotes_collision_version(
)
collision_version = PlatformRegistryVersion(
repository_id=repo.id,
version="1.2.3.dev20260522140000",
version="1.2.3.post20260522140000+collision.123456",
manifest=_make_manifest(["test.action_v2"]),
tarball_uri="s3://test/collision.tar.gz",
)
Expand All @@ -596,7 +596,7 @@ async def test_promote_after_artifact_build_promotes_collision_version(

await _promote_platform_registry_version_after_artifact_build(
session,
target_version="1.2.3.dev20260522140000",
target_version="1.2.3.post20260522140000+collision.123456",
version_id=collision_version.id,
artifact_uri="s3://test/collision.tar.gz",
expected_current_version_id=old_version.id,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_registry_sync_base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ async def fake_build_and_upload_artifacts(

assert first.version.version == "1.2.3"
assert first.version.id != second.version.id
assert second.version.version.startswith("1.2.3.dev")
assert second.version.version.startswith("1.2.3.post")
assert "+collision." in second.version.version
# Re-syncing unchanged content should reuse the active collision version.
assert third.version.id == second.version.id
assert repo.current_version_id == second.version.id
Expand Down
4 changes: 2 additions & 2 deletions tracecat/registry/sync/base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ async def _resolve_sync_version(
return version, None

def _generate_collision_version(self, base_version: str) -> str:
"""Generate a unique dev version for same-version manifest changes."""
"""Generate a unique post-release version for manifest collisions."""
suffix = datetime.now(UTC).strftime("%Y%m%d%H%M%S%f")
tiebreaker = cast(int, uuid.uuid4().int) % 1_000_000
return f"{base_version}.dev{suffix}{tiebreaker:06d}"
return f"{base_version}.post{suffix}+collision.{tiebreaker:06d}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve valid collision labels for post releases

When the base registry version is itself a supported post release such as 1.2.3-post.1 (scripts/update-version.sh accepts post in PUBLIC_SUFFIX_PATTERN), this produces 1.2.3-post.1.post...+collision..., which packaging.version.Version rejects. If that collision becomes the current platform registry version, the next startup downgrade check in tracecat/registry/sync/jobs.py::_is_downgrade falls into _release_tag_key, which also cannot parse the collision suffix, so startup registry sync aborts instead of comparing versions. The previous .dev... suffix remained PEP 440-parseable for post releases, so this is a regression for that release channel.

Useful? React with 👍 / 👎.


def _build_validation_failure_message(
self,
Expand Down
Loading