summaryrefslogtreecommitdiffstats
path: root/src/commands
AgeCommit message (Collapse)Author
2021-07-01Fix: Follow HTTP redirectsMatthias Beyer
This patch fixes the reqwest GET call by building a Client and a Request object configured to follow HTTP redirects (10 by now, maybe this will later need to be configurable). Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-07-01Refactor: Move helper fn to in outermost scopeMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-24Add spinner for establishing database connectionMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-23Add implementation of "endpoint images" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-18Remove progressbar for tree-of subcommandMatthias Beyer
Remove the progress bar here because it does not bring any real value and rather clutters the output and thus makes it harder to read. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-18Make progress bar for loading DAG optionalMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-16Move what-depends implementation to new package print interfaceMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-16Move dependencies-of implementation to new package print interfaceMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-16Iterator adaptor for package printing mechanicMatthias Beyer
This implements a new interface for printing packages from an iterator. It can be used to implement parallel print-preparation. The new interface is used in the command implementation of the "find-pkg" subcommand. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Add flag to filter releases by packageMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Revert "Add support for filtering releases by package name and version"Matthias Beyer
Filtering the releases from the database should not be done via a regex in the application code. Rationale is that filtering with a regex is only wanted if the user _searches_ for something. In this instance, the user is expected to know already what they want to see, so this is not a _search_, but a _filtering_. Hence, we rather implement the filtering via an appropriate database query instead of loading all releases and then filtering by regex. This reverts commit b665c7cd4aa4ea900dc194a6ba5ad9de527f978c. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Add flag to filter releases by storeMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Add package filtering for "db jobs" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Add endpoint filtering in "db jobs" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Add date-filtering to "db jobs" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Refactor: Simplify query buildingMatthias Beyer
Simplify query building by making `sel` variable `mut` and not reassigning it in else cases. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Capitalize table headingsMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Remove database IDs from outputMatthias Beyer
The database IDs are an implementation detail and the user does not need to see them in any case. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-07Merge branch 'db-release-arg-date-filter'Matthias Beyer
2021-06-02Fix: Wrong wording in metrics outputMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Add support for filtering releases by package name and versionMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Try to parse time with " 00:00:00" appendedMatthias Beyer
This makes it a bit easier to only specify a date. If the parsing fails (e.g. with "2020-01-01"), this patch adds another step of parsing by adding " 00:00:00" to the commandline argument and trying again to parse. This way, the CLI argument can be "2020-01-01" and the time does not have to be specified. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Subcommand "db releases" add date filterMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Add ability to specify point in time in date filter argumentMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Refactor: move get_date_filter() helper fn to commands:util moduleMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Fix: code styleMatthias Beyer
Fixes: 52bd280b4b95949cf130e4d7477c02ad2d2f81b3 ("Refactor: Database connection setup code") Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-31Fix typoMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-31Add trace outputMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-31Make job-successfullness-check less boolishMatthias Beyer
This patch changes the interface from `-> Option<bool>` to something more explanatory. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-20Update dependency: indicatif 0.15 -> 0.16.1Matthias Beyer
0.16.1 has been published which fixes the bug introduced by 0.16.0, hence update this dependency. This reverts commit ddbd9629b3188c9f08d023829683c40ab9e1448b. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-18Fix typo in fn nameMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-18Fix: Counting should not use helper fnMatthias Beyer
By using the helper function is_job_successfull(), we resulted in bogus output when there was no successfull and no failed job, because jobs can have an "unknown" state as well. This patch fixes this by counting properly. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-17Revert "Update dependency: indicatif 0.15 -> 0.16"Matthias Beyer
This reverts the dependency update because indicatif 0.16 introduced a reachable `unreachable!()` statement in their sourcecode that we actually hit if we `--hide-bars`. This reverts commit 6ceccb679d9c2d19389c6c6eef792d8db9086f31. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Add "db setup" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Refactor: Return Cow instead of StringMatthias Beyer
This results in less overhead in the or-else case by now allocating a String object. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Merge branch 'download-graceful-error-reporting'Matthias Beyer
2021-05-17Merge branch 'download-fail-slow'Matthias Beyer
2021-05-12Report download errors gracefullyMatthias Beyer
This patch changes the implementation of the "source download" subcommand so that download errors are reported in the progress bar message, instead of dropping the bar silently (which resulted in errors not being that visible to the user). Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-12Report URL of finished download in bar finish messageMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-12Fix: Consume all items before failingMatthias Beyer
This patch changes the download implementation so that one failing download does not fail the whole process, but errors are collected instead and reported after all other downloads are finished. This is the simple case implementation where only one error is reported, though multiple could have happened. Tested-by: Matthias Beyer <matthias.beyer@atos.net> Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-12Set length of bar before iteratingMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Add description for the subcommand implementing functionsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-11Add docs for helper functionsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-11Add module-level docsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-11Refactor: Parsing and connection establishing should be member functionsMatthias Beyer
This refactors the parsing of the `DbConnectionConfig` object and the establishing of the connection to be member functions of the type, rather than free functions. Way more idomatic. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Refactor: Database connection setup codeMatthias Beyer
This patch refactors the database connection setup code to involve less copying of data in memory. It also changes the configuration value type of the database port and the database connection timeout setting to be `u16` instead of `String`, which is another improvement. Because the `DbConnectionConfig` type no longer holds owned values, it must be annotated with a lifetime. Usages were adapted. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Refactor: Use human readable time formatMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Add subcommand: endpoint containers stopMatthias Beyer
Implementation of the "endpoint containers stop" subcommand. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Merge branch 'refactor-log-printing'Matthias Beyer
2021-05-11Refactor: Replace manual string-formatting with LogItem::display() callMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>