From: Kaelyn <kaelyn.alexi@protonmail.com>
To: zimoun <zimon.toutoune@gmail.com>
Cc: "Leo Famulari" <leo@famulari.name>,
"Ludovic Courtès" <ludo@gnu.org>,
guix-devel@gnu.org
Subject: Re: guix weather exit status?
Date: Sun, 11 Jul 2021 13:23:17 +0000 [thread overview]
Message-ID: <IP5LfKYTqpo-iL1H6FvhqMpmUO4tzl3leeeXM8LoIm6vNo9_n19uHC2NZBglSwZj0iVAyszP_5-5LMwfDAAR-s_FQPwM9ikdFU1AhNwPFeY=@protonmail.com> (raw)
In-Reply-To: <86mtqti6q2.fsf@gmail.com>
Hi,
I'm fairly new to Guix and haven't made much use of guix weather, but had a thought about the exit status.
On Sunday, July 11th, 2021 at 4:40 AM, zimoun <zimon.toutoune@gmail.com> wrote:
> Hi,
>
> On Sat, 10 Jul 2021 at 18:06, Leo Famulari leo@famulari.name wrote:
>
> > On Sat, Jul 10, 2021 at 04:41:44PM +0200, Ludovic Courtès wrote:
> >
> > > I agree we could change (or rather refine) semantics to exit with
> > >
> > > non-zero when overall coverage is below 100%. In the example above, it
> > >
> > > should return 0.
> >
> > Maybe we could distinguish between various cases like this:
> >
> > 0 means 100% coverage
> >
> > 1 means a substitute is available, but not from all servers
> >
> > 2 means a substitute is not available
> >
> > This would preserve the current meaning of 0, while still allowing `guix weather` to be used in scripts to "wait for a substitute".
>
> What about two or more packages? “guix weather foo bar” when the
>
> package ’foo’ is available on one server and ’bar’ is not at all. Or if
>
> ’foo’ is available on one server and ’bar’ on the other. Etc.
>
> We could have:
>
> 0 100% all servers
>
> 1 100% from one server
>
> 2 100% from a server mix
>
> 3 one or more substitute is missing
It looks to me like there are two overlapping use cases for guix weather and it's exit status (and sorry if they aren't the clearest): checking substitute availability for download, and substitute progress/coverage among servers.
There is already a "--coverage" flag to guix weather that the help describes as "show substitute coverage for packages with at least COUNT dependents". What if a new flag was added, say "-a" / "--available", which specifies the number of servers a single substitute must be available from to be considered available, possibly with a default of "1". That way guix weather can exit 0 when needed for both of the use cases.
For example, with the original output that showed 100% substitute availability from ci.guix.gnu.org and 0% availability from bordeaux.guix.gnu.org for a single package and exited 1 as a result:
* "guix weather -a 1" would exit 0
* "guix weather -a 2" would exit 1 because it was available from less than 2 servers.
That way, even when multiple packages are specified at once, guix weather would exit 0 as long as all of the packages met the requested minimum availability.
Cheers,
Kaelyn
P.S. If folks like the idea, I'm volunteering to implement it. ;)
prev parent reply other threads:[~2021-07-12 8:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 20:35 guix weather exit status? Leo Famulari
2021-07-10 14:41 ` Ludovic Courtès
2021-07-10 22:06 ` Leo Famulari
2021-07-11 8:40 ` zimoun
2021-07-11 13:23 ` Kaelyn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='IP5LfKYTqpo-iL1H6FvhqMpmUO4tzl3leeeXM8LoIm6vNo9_n19uHC2NZBglSwZj0iVAyszP_5-5LMwfDAAR-s_FQPwM9ikdFU1AhNwPFeY=@protonmail.com' \
--to=kaelyn.alexi@protonmail.com \
--cc=guix-devel@gnu.org \
--cc=leo@famulari.name \
--cc=ludo@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).