Snap channels for testing PRs (fixes/features)

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Snap channels for testing PRs (fixes/features)

Post by ppd »

Kunda1 wrote: Wed Mar 30, 2022 4:15 pm
ppd wrote: Wed Mar 30, 2022 2:20 pm Shall we disable the scheduled edge build? If you're triggering builds manually this often, maybe there's no need to build every day in addition.
Just during this feature freeze period, because we can give the devs faster feedback then every 24 hours.
I see. Maybe I should add a workflow that builds into a snapcraft branch then:
A branch is an optional finer subdivision of a channel for a published snap that allows for the creation of a short-lived sequences of snaps that can be pushed on demand by snap developers to help with fixes or temporary experimentation.

Branch names convey their purpose, such as fix-for-bug123, but the name isn’t exposed in the normal way, such as with snap info. Instead, they can be tracked by anyone simply knowing the name.

After 30 days with no further updates, a branch will be closed automatically. The replacement snap will then be chosen as it would be with closed channels (see below). For example, beta/fix-for-bug123 will fall back to beta after the fix-for-bug123 branch is closed.
(https://snapcraft.io/docs/channels)

This way, those temporary test builds would not interfere with the scheduled builds. It seems like those branches fit this use case very well.
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Testers: Snap Edge (nightly) has been manually triggered

Post by Kunda1 »

ppd wrote: Wed Mar 30, 2022 5:54 pm
A branch is an optional finer subdivision of a channel for a published snap that allows for the creation of a short-lived sequences of snaps that can be pushed on demand by snap developers to help with fixes or temporary experimentation.

Branch names convey their purpose, such as fix-for-bug123, but the name isn’t exposed in the normal way, such as with snap info. Instead, they can be tracked by anyone simply knowing the name.

After 30 days with no further updates, a branch will be closed automatically. The replacement snap will then be chosen as it would be with closed channels (see below). For example, beta/fix-for-bug123 will fall back to beta after the fix-for-bug123 branch is closed.
(https://snapcraft.io/docs/channels)

This way, those temporary test builds would not interfere with the scheduled builds. It seems like those branches fit this use case very well.
Wow, that is sick! Lets start a new thread on this. This has huge potential!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Snap channels for testing PRs (fixes/features)

Post by Kunda1 »

paddle wrote: pinged by pinger macro
CC @paddle
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Snap channels for testing PRs (fixes/features)

Post by ppd »

How do you want this to work? Suggestion: Workflow with two input parameters, git commit hash and branch name.
The workflow would check out FreeCAD @ this commit and publish the result to channel edge/${branch_name}.
You could trigger workflow runs just like you're doing it now, but with those two input params extra.

Does that make sense?
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Snap channels for testing PRs (fixes/features)

Post by adrianinsaval »

That would be interesting, with that I think you would be able to make snap builds of PRs on demand
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Snap channels for testing PRs (fixes/features)

Post by ppd »

There you go: https://github.com/ppd/freecad-ppd/acti ... branch.yml

The first parameter is where you select the git ref to build, e.g. simply "master" or a specific commit hash.
The second one is the name of the snapcraft branch. Users can switch to this branch via snap refresh freecad-ppd --channel=edge/${branch} (replace ${branch}).

Have fun.
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Snap channels for testing PRs (fixes/features)

Post by Kunda1 »

ppd wrote: Wed Mar 30, 2022 9:31 pm There you go: https://github.com/ppd/freecad-ppd/acti ... branch.yml

The first parameter is where you select the git ref to build, e.g. simply "master" or a specific commit hash.
The second one is the name of the snapcraft branch. Users can switch to this branch via snap refresh freecad-ppd --channel=edge/${branch} (replace ${branch}).
My mind is pretty blown right now. But I haven't tested it yet. I'm trying to understand...does this build PRs?
If s, for example, lets say I want to build @paddle's PR https://github.com/FreeCAD/FreeCAD/pull/6454
his branch is PaddleStroke:SketcherIcons is that what I add to the 1st param?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Snap channels for testing PRs (fixes/features)

Post by ppd »

You'd put in the most recent commit hash of this PR. In this case: e65094311d91869910e8d1b8c7499b30fae1058d

It would be possible to support passing PR IDs directly, but this should be good enough.
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Snap channels for testing PRs (fixes/features)

Post by paddle »

Hmm this is out of my understanding scope. There are too many words that I don't know my brain disconnected.

I seem to understand that the general idea is that it can build any external/development branch such that users can test them?
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Snap channels for testing PRs (fixes/features)

Post by ppd »

paddle wrote: Thu Mar 31, 2022 10:51 am I seem to understand that the general idea is that it can build any external/development branch such that users can test them?
The general idea is that @Kunda1, as a maintainer of the snap, can trigger builds for any commit that is fetchable from the GitHub repository. This includes commits that only exist in pull requests, but it also applies to commits in master or other branches, as you would expect.

If you go to your PR and copy the most recent commit hash, this can be entered into a text input of the GitHub workflow to make it build this exact commit, no matter where master is at the moment.

The second step is then to publish this build so that users can test it. There, a feature of snaps comes into play: branches. You can pick a suitable name and type it into the second workflow parameter input. The workflow will then upload the resulting snap into this branch.
Then, you tell interested users that they can test your PR/commit by installing the snap from the newly created branch.
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
Post Reply