feat: register and activate a container image in one call - #869
feat: register and activate a container image in one call#869drake-nominal wants to merge 1 commit into
Conversation
Adds activate=False to ContainerizedExtractor.register_image and --activate to `nom container extractor register-image`. When set, the freshly registered image is activated on the extractor via set_active_image, which still polls the image to readiness first — current backends return images READY synchronously, but the poll keeps the flow correct against async processing. The default remains register-only (the staging state for release-gated rollouts). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c3607d9. Configure here.
| if wait: | ||
| if activate: | ||
| click.secho(f"Activated image {image.rid} ({image.tag}) on {extractor.name}", fg="green", err=True) | ||
| elif wait: |
There was a problem hiding this comment.
Register activate ignores wait flag
Medium Severity
With --activate, register-image never honors --no-wait: activation always blocks in register_image via set_active_image(..., poll_until_ready=True), while the sibling set-active-image command maps --wait/--no-wait to poll_until_ready. Pipelines using --activate --no-wait still wait until READY despite the flag.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c3607d9. Configure here.
|
Claude finished @drake-nominal's task in 1m 51s —— View job Review
Overview Well-considered change. The I verified one thing worth calling out as not a bug: Defects The only real issue — No other structural or maintainability concerns: the diff is small, no file approaches a size boundary, and no spaghetti was bolted onto existing flows. |


Adds an opt-in one-step register-and-deploy flow, keeping registration side-effect-free by default. Builds on #865's corrected
register_imagesemantics.SDK
ContainerizedExtractor.register_image(..., activate: bool = False)— when true, the freshly registered image is activated on the extractor viaset_active_image, which polls the image to readiness first: current backends push synchronously and return READY, but the poll keeps the flow correct if a backend ever processes asynchronously (and for any legacy non-READY rows). The extractor instance refreshes in place; failure modes are documented inRaises:(NominalAlreadyExistsErrorfor immutable-tag collisions,NominalContainerImageErrorif the image can't become READY).The default stays
False— registration remains the staging state, preserving gated-rollout and rollback workflows (many registered images, one active).CLI
nom container extractor register-image --activate— one-step deploy for continuous-deployment pipelines:nom container extractor register-image -r "$EXTRACTOR_RID" -f image.tar -t $(git rev-parse --short HEAD) -c extractor-config.json --activatestdout stays RID-only (activation status goes to stderr), so
$(...)capture is unaffected. Release-gated pipelines keep the two-step register /set-active-imageflow.Testing note
The
activatepath is a two-line composition overset_active_image, whose poll-then-activate behavior is already covered bytests/core/test_containerized_extractor.py. A direct happy-path test ofregister_imagewould require intercepting the multipart upload's raw HTTP PUTs (not reachable via MagicMock clients), which is why no such test exists for the method today.🤖 Generated with Claude Code