Saturday, February 25, 2023
apps@conference.yunohost.org
February
Mon Tue Wed Thu Fri Sat Sun
    1 2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
         
             

[07:07:26] <florent> Do these kind of changes (update of github workflows) have to be merged into master?
https://github.com/YunoHost-Apps/paheko_ynh/pull/13/files
Poke rodinux @rodinux07:matrix.org
Intuitively, I would say no, though I am not sure
[09:02:22] <tituspijean> florent the workflows are ran from the default branch of the repo, so if it is master the PR needs to be merged. No need to bump the package version though, it's useless to trigger an upgrade for the users with that. :)
[17:50:13] <tituspijean> (creating a thread for Matrix users)
[17:54:31] <tituspijean> Interesting SO thread on a combination of PyGithub and PyGit2: https://stackoverflow.com/questions/49458329/create-clone-and-push-to-github-repo-using-pygithub-and-pygit2
[17:55:19] <tituspijean> I am trying to think through how we can self-host the auto-updater.
Current resources:

- BASH: https://github.com/YunoHost-Apps/dendrite\_ynh/blob/master/.github/workflows/updater.sh
- PYTHON: https://github.com/YunoHost-Apps/wordpress\_ynh/blob/testing/.github/workflows/updater.py
- Discussion on Python vs Bash, said selfhosting, and latest version of the Python scripts: https://github.com/YunoHost/example\_ynh/pull/187

(creating a thread for Matrix users)
[18:13:24] <tituspijean> My initial thinking:

1. Have an auto-updater.yml file to declare some variables:
1. How we find about new versions:

- repository (defaults to the upstream address from the manifest): commits or tags, and declare filters to exclude("RC", "beta", ...) tags (defaulting to Github, but we might include functions to handle Gitlab and other forges)
- json, or other API
2. Where we find the assets to download (tarball, zipball, assets from a release, other repo \[looking at you, Jellyfin\])
3. How often should the auto-updater run
2. Have Salamandar's updater.py or run updater.sh with appropriate env variables to run app-specific actions. His updater\_lib.py should be integrated in the core of the auto-updater
[18:21:18] <tituspijean> Onto the architecture of the thing.

IIRC we host a copy of the repos for the catalog builder. we could tap on that, since it's updated pretty often (~4h). That would prevent us from harassing the forges API to re-download everything.

We could then crawl through all the directories reading the `auto-updater.yml`s, and copy the directory to a temp dir and work our magic with the scripts described above.
[18:22:41] <Salamandar> Ow can't think about it this week end. Maybe a github discussion ? :D
[18:23:13] <tituspijean> Yeah maybe 😆
[18:23:40] <tituspijean> (I'd encourage all Matrix users to enable the threads beta feature, it's very nice :p)
[18:25:41] <Yunohost Git/Infra notifications> [apps] @tituspijean just made [pull request #1624](https://github.com/YunoHost/apps/pull/1624) ready for review: Add auto-updater upgrader
[18:28:19] <tituspijean> > <@titus:pijean.ovh> Yeah maybe 😆

creating it...
[18:32:58] <tituspijean> Done: https://github.com/YunoHost/issues/discussions/2164
[18:34:26] <Yunohost Git/Infra notifications> [example_ynh] @tituspijean [commented](https://github.com/YunoHost/example_ynh/pull/187#issuecomment-1445177399) on [issue #187](https://github.com/YunoHost/example_ynh/pull/187) Rewrite updater.sh -> .py. Remove redundant info in updater.yml.: General discussion on the auto-updater infrastructure: https://github.com/YunoHost/issues/discussions/2164
[19:33:31] <Yunohost Git/Infra notifications> @Gofannon forked wordpress_ynh to [Gofannon/wordpress_ynh](https://github.com/Gofannon/wordpress_ynh)
[19:56:55] <Spok> > <@titus:pijean.ovh> I am trying to think through how we can self-host the auto-updater.
> Current resources:
> - BASH: https://github.com/YunoHost-Apps/dendrite_ynh/blob/master/.github/workflows/updater.sh
> - PYTHON: https://github.com/YunoHost-Apps/wordpress_ynh/blob/testing/.github/workflows/updater.py
> - Discussion on Python vs Bash, said selfhosting, and latest version of the Python scripts: https://github.com/YunoHost/example_ynh/pull/187

Waaaait, neither of these support packaging v2?
Bash solution would sort of require providing `yq` on runners, right?
[20:24:06] <tituspijean> Damn yeah indeed, the bash script directly refers to `manifest.json`
[20:57:59] <Spok> > <@titus:pijean.ovh> Damn yeah indeed, the bash script directly refers to `manifest.json`

quick look around revelas that of 8 packages I'm aware that are using v2 packagin:
- snappymail, libreddit and altserver use script copied from example_ynh and are therefore broken
- homeassistant parses `manifest.toml` with `awk` - however, the script is slimmer than the one coming from `example_ynh`, not sure if it's a drop-in replacement
[23:14:42] <Spok> The other 4 don't seem to use auto update