Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Snap Store builds might skip Pebble revisions, including stable releases #300

Closed
cjdcordeiro opened this issue Sep 7, 2023 · 0 comments
Assignees

Comments

@cjdcordeiro
Copy link
Collaborator

cjdcordeiro commented Sep 7, 2023

SOTA

Our current workflows for the Pebble snap are divided in 2 parts:

  1. the Snap Store is connected to the Pebble repository (see https://snapcraft.io/pebble/builds). This makes the store lookup new commits to the Pebble repo's default branch (master) on a frequent basis (I believe the polling interval is 30''). If there are new commits to the default branch, the Snap Store will automatically build the Pebble snap and release it to the latest/edge channel.
    • PROBLEM [1]: we have experienced a store behaviour where if >1 commits are pushed within the store's polling window, only the most recent commit will be taken for the snap build. This might cause some snap revisions to be skipped, including stable ones (like v1.3.0)
  2. on every release, a dedicated GitHub workflow will be triggered. This workflow will go into an infinite loop that waits for the Snap Store to build a Pebble snap that corresponds to the released Pebble version. Once the store builds and releases that snap, the GitHub workflow will promote it from latest/edge to latest/candidate

Proposed solution

Given Pebble's release strategy (2 back-to-back commits for every new release, i.e. "tag" and "revert bump"), the pitfall noted in [1] above is very likely to happen, and as the title says, we might end up not having a snap built for a stable Pebble release.

To avoid introducing an artificial delay between the 2 release commits, I propose the following changes:

  1. disconnect the Pebble repository in the Snap Store (i.e. no more automatic store-side builds)
  2. in pebble/.github/workflows/snap.yml, do the following changes:
    1. add a new trigger event for every new tag and commit to master
    2. add a new job called remote-build, that only runs on pushes to master and new tags, which will run snapcraft remote-build --build-for=amd64,arm64... and then upload the resulting snaps to the store, on the latest/edge channel. If the trigger event is a tag, then this job also promotes the resulting snap from latest/edge to latest/candidate
      • alongside, change snap/snapcraft.yaml to remove build-environment as it is not supported in remote-builds. Instead, manually script the binary installation by replacing craftctl default by CGO_ENABLED=0 go build -trimpath -ldflags=-w -ldflags=-s -o ${CRAFT_PART_INSTALL}/bin/pebble ./cmd/pebble
@cjdcordeiro cjdcordeiro self-assigned this Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 12, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 13, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 13, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 13, 2023
cjdcordeiro added a commit to cjdcordeiro/pebble that referenced this issue Oct 13, 2023
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 a pull request may close this issue.

1 participant