Sunday, October 23, 2022
dev@conference.yunohost.org
October
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
29
30
31
           

[17:35:31] <Salamandar> Hey btw, i had worked on an experiment for a declarative app description. it generates the install/backup scripts from a yaml file for now. How much interested are you about that ? Should i continue spending time on this ?
[17:35:59] <Salamandar> (the upside of generating a bash script is that the yaml can contain "variables" that are actually expanded at bash execution)
[17:36:41] <Salamandar> (and when we would want to use the yaml without going through a bash conversion, it could be jinja variables)
[17:37:56] <Aleks (he/him/il/lui)> eeeeh
[17:38:10] <Aleks (he/him/il/lui)> did you base this work on the manifest v2 ? 🤔 😛
[17:38:48] <Aleks (he/him/il/lui)> i'd be interested to have a look yeah
[17:39:27] <Salamandar> no, i wrote my own format because "reasons" :p
[17:39:29] <Aleks (he/him/il/lui)> i already had some thoughts on how to design manifest / packaging v3 (though some other things are still unclear)
[17:39:47] <Salamandar> (the main being "i want to do what I have in mind to have comparison elements with manifest v2 and maybe improvement suggestions)
[17:41:16] <Aleks (he/him/il/lui)> but the core idea of manifest v3 would be to completely "drop" writing any install / remove / ... script by the packager, and only have a "build" script, a "init configure" script, maybe something for migrations, and all these would be ran as non-root, and have a small "hook" mechanism to perform pre-build/post-build operations as root etc.
[17:41:27] <Aleks (he/him/il/lui)> (it's kinda hard to explain in a couple sentences in the chat)
[17:42:12] <Aleks (he/him/il/lui)> ah and configuration files (nginx, systemd, app conf, etc.) would somehow be declared in the manifest
[17:42:38] <Salamandar> yeah i agree
[17:42:43] <Aleks (he/him/il/lui)> similar to the resource system introduced in the manifest v2
[17:42:51] <Salamandar> that's what I had in mind too
[17:43:33] <Salamandar> https://paste.yunohost.org/biporefede.bash
[17:44:27] <Salamandar> that's still dirty, but i genuinely wanted to "try something then bump into all the weird issues" :p
[17:47:00] <Aleks (he/him/il/lui)> 👀
[17:47:09] <Aleks (he/him/il/lui)> so like did you implemented the logic behind all this ? xD
[17:48:21] <Salamandar> yeah it generates install and backup scripts for now
[17:48:40] <Salamandar> did not get further, life is full of things taking too much time :p
[17:48:57] <Aleks (he/him/il/lui)> ah yeah and zbleh about the file format, we were discussing a long time ago about toml vs yaml, i was in favor of yaml but the main argument opposed was the confusing indentation ... toml is kinda simpler to understand, but the drawback is that having some "multi-line bash" stuff is not really doable (i don't remember why but it's a mess)
[17:49:34] <Salamandar> it's full of things like :
```
if deps := self.data.get("dependencies", False):
self.write_section("install dependencies")
self.write_progress("Installing dependencies...", 1)
self.write_code(f'ynh_install_app_dependencies {" ".join(deps)}')

if users := ensure_list(self.data.get("users", [])):
self.write_section("create dedicated user")
self.write_progress("Configuring system user...", 1)
```
[17:49:39] <Aleks (he/him/il/lui)> ah yes i see it basically just generate the scripts and everything else is the usual code
[17:50:19] <Salamandar> > <@Alekswag:matrix.org> ah yeah and zbleh about the file format, we were discussing a long time ago about toml vs yaml, i was in favor of yaml but the main argument opposed was the confusing indentation ... toml is kinda simpler to understand, but the drawback is that having some "multi-line bash" stuff is not really doable (i don't remember why but it's a mess)

Oh yeah we discussed about that. But yaml vs toml is kind of a non-debate : i wrote a yaml file but it can easily be converted to toml
[17:50:28] <Salamandar> (as long as it doesn't use weird yaml features, of course)
[17:51:16] <Salamandar> > having some "multi-line bash" stuff is not really doable (i don't remember why but it's a mess)

Crap. A workaround I was thinking about would be to have small bash scripts/snippets/functions in another file and just put the function name in the descriptive file.
[17:52:07] <Aleks (he/him/il/lui)> yeah :| but that kinda spread the information
[17:52:11] <Salamandar> the toml website says:
[17:52:16] <Salamandar> > Multi-line basic strings are surrounded by three quotation marks on each side and allow newlines. Include a line ending backslash to automatically trim whitespace preceeding any non-whitespace characters:
[17:52:18] <Salamandar> looks OK to me, no ?
[17:52:22] <Aleks (he/him/il/lui)> hm yeah
[17:52:31] <Aleks (he/him/il/lui)> i don't remember why i concluded that it was messy
[17:52:47] <Aleks (he/him/il/lui)> or maybe the parser didnt like it idk
[17:53:04] <Salamandar> ah maybe…
[17:53:04] <Salamandar> ok :)
[17:53:04] <Aleks (he/him/il/lui)> should re-investigate
[18:01:19] <Aleks (he/him/il/lui)> Salamandar: but ultimately what takes the most time about designing all of these is "how are you gonna handle the complex cases for real-life apps", typically the upgrade script is kinda of a mess
[18:01:40] <Salamandar> yeah that's what i'm scared about
[18:02:22] <Salamandar> i was wondering about allowing the packager to describe a "steps order" to solve some difficult issues
[18:02:56] <Aleks (he/him/il/lui)> but maybe we could imagine a "v2.5" format with that kind of syntax build on top of the v2 which would autogenerate the install/remove/upgrade/backup/restore scripts
[18:03:13] <Salamandar> why not
[18:04:01] <Aleks (he/him/il/lui)> i mean just listing the needed confs (nginx, systemd, ...) is a good chunck of what's left once you remove everything else now handled from the v2 format
[18:04:18] <Salamandar> eheh
[18:04:35] <Salamandar> gonna try to find some time tomorrow to think about it :)
[18:05:26] <Aleks (he/him/il/lui)> (in case you're not already aware of it, there's a python script which attempts to "convert" what it can from a v1 app to v2 format : https://github.com/YunoHost/apps/blob/master/tools/packaging_v2/convert_app_to_packaging_v2.py - including commenting out all the now-unecessary stuff from the install/remove/upgrade/backup/remove scripts)
[18:06:14] <Aleks (he/him/il/lui)> (which of courses needs to be reviewed and tweaked by a human but that automatize like 2/3rd of the work)
[18:07:37] <Salamandar> ahah
[18:45:22] <Aleks (he/him/il/lui)> Draft for the 11.1 release note : https://forum.yunohost.org/t/yunohost-11-1-spooky-testing/21802

I'm planning to merge the `11.1` branch into `dev` in the upcoming hours and release it

The main thing I'm concerned about is that the manifest v2 changes may introduce regressions so I'm planning to trigger some tests for a bunch of major apps on the ci-unstable during the week
[19:09:18] <Yunohost Git/Infra notifications> [yunohost] @alexAubin pushed 1 commit to 11.1: Fix missing i18n strings https://github.com/YunoHost/yunohost/commit/cd3bd8985794ceb61976deb8f2e64def321bc109
[20:20:03] <Aleks (he/him/il/lui)> https://gitlab.com/yunohost/yunohost/-/pipelines/674784565
[20:20:11] <Aleks (he/him/il/lui)> https://aria.im/_matrix/media/v1/download/matrix.org/sLoJcddRcjGQzeHJvtCVkfzS
[20:21:47] <eric_G> nooo! code quality is failing
[20:27:22] <eric_G> ```
"requirements": {
"yunohost": ">= 11.1"
},
```

[20:28:46] <eric_G> Aleks (he/him/il/lui): I guess we will have to set 11.1 as requirement for the manifest v2 apps?
[20:32:03] <Aleks (he/him/il/lui)> eh yes indeed
[20:32:41] <Aleks (he/him/il/lui)> > <@ericg:matrix.org> nooo! code quality is failing

>No more CI minutes available

🤔 😢
[21:07:36] <eric_G> I guess we will have to work on Nextcloud first so we can migrate most of the users 😅
[21:28:53] <tituspijean> > <@Alekswag:matrix.org> Draft for the 11.1 release note : https://forum.yunohost.org/t/yunohost-11-1-spooky-testing/21802
>
> I'm planning to merge the `11.1` branch into `dev` in the upcoming hours and release it
>
> The main thing I'm concerned about is that the manifest v2 changes may introduce regressions so I'm planning to trigger some tests for a bunch of major apps on the ci-unstable during the week

I fixed some typos 😇
[22:24:54] <ljf[m]> I discover `systemctl freeze` 👀