Skip to content

Snap packaging and release follow-ups #2272

Closed

Description

@TerryHowe

Follow-up from #2270. The Snap Store flagged stale ca-certificates in revisions r12–r14: v1.2.0-rc.1 builds from 2024-05 that were still published on candidate/beta/edge. Those channels have been closed and now follow stable (v1.3.5). The items below keep this from happening again.

  • Release stable builds to candidate as well, so that channel can't go stale
  • Remove stage-packages: ca-certificates from snapcraft.yaml
  • Add an ORAS owner as a collaborator on the oras snap in the Snap Store, and regenerate SNAPCRAFT_STORE_CREDENTIALS with narrower permissions

Feasibility

  1. Stale candidate channel. This is a one-line change in release-snap.yml#L45: change release=stable to release=stable,candidate. The upload step already passes $SNAP_RELEASE to --release, which accepts a comma-separated list of channels.
  2. Remove ca-certificates. Delete snapcraft.yaml#L41-L42. The package was added in chore: add snap for ubuntu #965, when the snap was strictly confined. Since ci(release): add dispatch GHA for snapcraft classic release #1256 the snap uses confinement: classic, and the binary is pure Go (built with CGO_ENABLED=0), so it reads the host's /etc/ssl/certs. Nothing in the repo sets SSL_CERT_FILE or refers to $SNAP paths, so the bundled certificates are never used. Their only effect is to trigger the store's security notices.
  3. Store access. This isn't a code change. Today no ORAS owner is a collaborator on the snap. The publisher (toabctl) has to add one, or an existing collaborator can if the store allows them to invite others. Regenerating the token also needs an owner with store access.

Effort

Small. Items 1 and 2 fit in one PR that touches two files. Item 3 is coordination with people, not code.

Risk

  • Item 1: low risk. If an RC is on candidate when a stable release goes out, the stable build replaces it. That's the behaviour we want.
  • Item 2: low risk, but there are no snap tests, so it needs checking by hand. Confirm that TLS still works from the installed classic snap on a plain Ubuntu host, both for registry calls and for credential helpers.
  • Item 3: limiting the token to this snap and adding an expiry shrinks what a leaked token could do. If the new token is too narrow, the release workflow fails at the publish step, so test it with a candidate release.
  • None of this touches the CLI's Go code or user-facing behaviour.

Suggested approach

  1. One PR covering items 1 and 2:

    • Change release-snap.yml to set release=stable,candidate when isStable is true.
    • Remove the stage-packages: - ca-certificates block from snapcraft.yaml.
  2. Verify the PR locally:

    • Fill in the placeholders and build: sed 's/{VERSION}/v1.3.5/;s/{ARCH}/amd64/' snapcraft.yaml, then run snapcraft.
    • Install it with sudo snap install --classic --dangerous oras_*.snap.
    • Run oras repo tags ghcr.io/oras-project/oras, then an authenticated login and pull.
    • Check that unsquashfs -l no longer lists etc/ssl.
  3. Check the next release: after the next stable release, confirm with snapcraft status oras that stable and candidate both show the new revision.

  4. Store access (item 3): once an owner is a collaborator, they regenerate the CI token. The exact ACL names should be checked with snapcraft export-login --help. The documented ACLs are package_access, package_manage, package_metrics, package_push, package_register, package_release and package_update; uploading uses package_push.

    snapcraft export-login --snaps oras \
      --acls package_access,package_push,package_update,package_release \
      --expires <date> creds.txt

    Put the result in the SNAPCRAFT_STORE_CREDENTIALS repo secret. Optionally, move publishing to a publisher account the project controls.

Related code

References: Snapcraft authentication, Snapcraft authentication options

Activity

  1. added
    enhancement
    help wanted
    on Oct 23, 2026
  2. TerryHowe commented on Oct 23, 2026

    @TerryHowe
    MemberAuthor

    Re: store access. [email protected] is reportedly a collaborator on the oras snap, which would cover the first half of item 3. Can someone with that login confirm, either with snapcraft login then snapcraft status oras, or from the snapcraft.io/oras Collaboration page? @SamirPS, as a collaborator you should also be able to see whether it's listed there.

  3. SamirPS commented on Oct 23, 2026

    @SamirPS

    I see the email [email protected] on the snap dashboard

  4. ketchupz1999 commented on Oct 23, 2026

    @ketchupz1999
    Contributor

    I reproduced the stale-channel/package-content conditions and implemented the two code items in this issue: publishing stable builds to both stable,candidate, and removing the unused ca-certificates stage package.

    The snap builds successfully, no longer contains etc/ssl, and the packaged binary can access GHCR using the Ubuntu host CA store. I also verified authenticated login, push, and pull through a Docker credential helper against a temporary local registry.

    I can open a draft PR today. The remaining validation gap is installing the artifact through snapd on a plain Ubuntu host.

  5. TerryHowe commented on Oct 23, 2026

    @TerryHowe
    MemberAuthor

    Done

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions