Skip to content

feat(registry): refuse a release with local changes in a remote registry - #685

Open
karhu wants to merge 1 commit into
mainfrom
feature/refuse-untraceable-publish
Open

karhu wants to merge 1 commit into
mainfrom
feature/refuse-untraceable-publish

Conversation

@karhu

@karhu karhu commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

A release in a remote registry outlives the machine that built it, so its manifest must name the exact code. A remote or S3 registry now accepts only a release whose manifest records TimeNet code without local changes. A local registry accepts any release. There is no override.

The check reads build_env.git in the manifest, not the installed code, because a publish copies a release that was built earlier. PackageSnapshot and TimeNetSnapshot get require_no_local_changes(), and WritableRegistry gets the property requires_committed_code (False only for LocalRegistry) and the method require_committed_code(manifest).

Every way to publish checks the rule:

  • put_release() refuses before it uploads anything. put_dataset() publishes through put_release(), so it refuses too.
  • copy_release() checks every release that it copies before it copies anything, so timenet.publish() and timenet-build build --publish-to leave the destination unchanged.

The error names the registry, the release and the package with local changes. It says to build the release again from committed code, or to keep it in a local registry. With --publish-to, a build with local changes still lands in the local registry, and only the publish step fails.

The docs describe the rule in a new section, "Committed code for remote registries".

This replaces the first design of this PR, which gated publish_pipeline() on a snapshot of the installed code. Main removed publish_pipeline(): a build now always lands in the local registry, and a publish is a separate copy.

Closes TNET-165


Stack created with GitHub Stacks CLI • Give Feedback 💬

@karhu
karhu added this pull request to stack #686 November 5, 2026 14:47
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from f257778 to 621e42c Compare November 5, 2026 15:56
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from 621e42c to b32942b Compare November 6, 2026 14:55
Comment thread docs/registry.md Resolved
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from b32942b to 312a676 Compare November 6, 2026 15:25
@karhu
karhu marked this pull request as ready for review November 6, 2026 15:25
@karhu
karhu requested review from TimoStoff and removed request for TimoStoff November 6, 2026 15:25
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from 312a676 to 9a145a6 Compare November 9, 2026 09:36
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

✅ CI checks passed

Check Status
Quick checks ✅ Passed
Tests (Python 3.13) ✅ Passed
Tests (Python 3.11) ✅ Passed

Updated for f74087e · run #8369

@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from 9a145a6 to 435ccfb Compare November 9, 2026 10:22
@karhu

karhu commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@RealLast Same here, addressed your feedback. Please take another look!

@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch 4 times, most recently from ee13fef to ce5fae6 Compare November 9, 2026 19:32

@RealLast RealLast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Minor nits for clean up

@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from ce5fae6 to a1c4841 Compare November 10, 2026 16:46
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from a1c4841 to f84ad22 Compare November 10, 2026 18:58
@karhu karhu changed the title feat(engine): refuse to publish a build that cannot be traced to a commit feat(registry): refuse a release with local changes in a remote registry Nov 10, 2026
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from f84ad22 to 4bf1974 Compare November 10, 2026 19:20
Base automatically changed from feature/build-env-git-sha to main November 10, 2026 19:36
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from 4bf1974 to 53ff091 Compare November 10, 2026 19:36
A remote or S3 registry now accepts only a release that was built from
committed TimeNet code. Each manifest records the git commit of the
TimeNet packages and whether they had local changes. If a manifest
records local changes, put_release() raises TimeNetBuildError. The same
applies to put_dataset(), because it publishes through put_release().
copy_release(), and so timenet.publish() and timenet-build --publish-to,
checks every release that it copies before it copies anything.

The check reads the manifest, not the installed code, because a publish
copies a release that was built earlier. LocalRegistry accepts any
release, through the new requires_committed_code property.

Part of TNET-165
@karhu
karhu force-pushed the feature/refuse-untraceable-publish branch from 53ff091 to f74087e Compare November 10, 2026 19:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants