Monday, August 15, 2022
apps@conference.yunohost.org
August
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
       
             

[15:33:25] <Aleks> folks, do none of you have any huge epic issues with commands like `ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/config.ini.php"` (cf https://github.com/YunoHost-Apps/matomo_ynh/blob/master/scripts/upgrade#L114)
[15:33:44] <Aleks> i mean apparently the code of `--keep` expect a relative path, not an absolute path
[15:34:08] <Aleks> so when writing ` --keep="$final_path/config/config.ini.php"` the file will ... not be kept ..?
[15:34:20] <Aleks> (instead of just ` --keep="config/config.ini.php"`)
[15:34:28] <@navan:navan.dev> wait what?
[15:34:30] <Aleks> the issue is, i'm grepping the app
[15:34:43] <@navan:navan.dev> does it tell you that it’s not keeping the file or did you discover that yourself?
[15:34:49] <@navan:navan.dev> Because I use that helper in a few apps
[15:34:51] <Aleks> and there's 78 occurence of apps using final_path in the --keep arg
[15:35:18] <Aleks> Navan: i'm investigating an upgrade crash on the support and this seem to be the issue
[15:35:35] <Aleks> i may be wrong tho
[15:35:46] <@navan:navan.dev> I’ll have to revisit some of those apps, but I thought it would work as expected 😔
[15:36:20] <Aleks> https://github.com/YunoHost/yunohost/blob/030927cf03991ae90df8ed1de3b8d220410da817/helpers/utils#L168
[15:36:59] <Aleks> so yeah that's how it works
[15:37:26] <Aleks> i can make it smartly detect that it's an absolute path tho ... so that we don't have to fix 78 apps
[15:37:47] <Aleks> but i don't understand how we don't have 78 apps with upgrade exploding right now ...
[15:39:59] <Aleks> there's even `dendrite/scripts/upgrade:86: ynh_setup_source --dest_dir="$final_path/build" --keep="$final_path/dendrite.yaml"` ... but the `--keep` path is not even in the `dest_dir` so there's no reason to "keep it" as it doesn't get deleted é_è
[16:06:06] <Aleks> > <@Alekswag:matrix.org> but i don't understand how we don't have 78 apps with upgrade exploding right now ...

Or maybe that's because `ynh_setup_source` is somewhat smart and most of the time it won't delete files that do not exist in the original archive
[16:06:29] <eric_G[m]> oh god... I have used extensively `—keep` opt with absolute path 🙄
[16:06:30] <Aleks> like usually there's no `config.json` but maybe `config.json.example`
[16:06:45] <Aleks> so the file is kept anyway
[16:07:09] <Aleks> but now i wonder if I fix the issue won't it create a shitload of issues because the code works differently ...
[16:07:57] <eric_G[m]> 78 apps to fix shouldn't take long...
[16:08:21] <Aleks> 😬
[16:09:48] <eric_G[m]> How do you search for those apps? I am using GitHub search on the app repo without convincing results...
[16:11:49] <Aleks> i'm grepping the app cache on saperlipopette (which is used to rebuild the catalog every X hours), but it you want you can make yourself such a cache locally using `python3 autopatch.py --build-cache` from the `apps` repository, in tools/autopatches
[16:12:11] <Aleks> it will 'just" git clone like 300 apps
[16:12:32] <Aleks> (well it only git clones a single branch or commit for every app so it's not that huge)
[16:15:39] <eric_G[m]> ah... My 2Go disk space is not gonna like it 😅
[16:16:05] <Aleks> ¯\_(ツ)_/¯ buy a new hard drive and make SSH pay for it ffs :P
[16:17:16] <Aleks> but otherwise yeah, github search is ... not reliable
[16:18:37] <@navan:navan.dev> Try to sign up for https://cs.github.com/about
[16:18:53] <eric_G[m]> If I want to keep a folder, do I have to leave a trailing slash: `--keep="data/"` ?
[16:19:58] <Aleks> from what i can read in the code, i think it doesnt matter
[16:22:24] <Aleks> eric_G: https://paste.yunohost.org/raw/yaraledahu