Packages and Registries: Source, Version and Consumer
Three different responsibilities
A repository stores source and history; a package registry distributes versioned packages; a consumer resolves and installs a dependency. One repository may produce multiple packages. A package can include compiled output or metadata different from source files. A container registry similarly stores images and related manifests and layers. An image tag may move; a digest identifies specific content.
Identify a package version
The fictional registry uses namespace demo, package garden-notes and version 1.0.0. This JSON is a teaching record, not a real registry manifest. Version policy must match the ecosystem: semantic versioning can communicate compatibility intent but cannot guarantee it. Pin a reviewed version, retain lockfiles where applicable and verify expected source and integrity.
{ "namespace": "demo", "name": "garden-notes", "version": "1.0.0", "visibility": "private"}Match access to purpose
Consumers normally need read access; a release publisher needs only the required write access to its intended package. Administrative operations such as deletion need separate review and authorization. GitHub Packages has registry-dependent access models: some inherit repository access, others allow account or organization scoped permissions. Workflow tokens need the appropriate permissions and package access; do not assume repository visibility alone grants access. Verify plan, registry, retention and billing before live use.
Practice the mock lifecycle
The lab uses an in-memory registry with an immutable-version policy: a publisher can register bytes and a reader can retrieve them; neither may silently replace an existing version. Reusing the same version with changed bytes is rejected by this model, not a universal registry rule. A consumer requesting an unknown package fails. Avoid names from unintended registries; review the registry URL and namespace. No installation, credentials or real publishing is performed.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Packages and Registries: Source, Version and Consumer — knowledge check
Reason about distribution, integrity and provenance.
What role does a registry serve?
What access is appropriate for a read-only consumer?
Does private repository visibility alone guarantee workflow package access?
In the mock immutable registry, what happens to changed bytes under an existing version?
Which identifies specific image content rather than a movable tag?