summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-06-02Fix: code styleMatthias Beyer
Fixes: 52bd280b4b95949cf130e4d7477c02ad2d2f81b3 ("Refactor: Database connection setup code") Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-02Fix: About string should be settable for argument generator helper fnMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-01Update changelog for the 0.1.4 releaseMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de> (cherry picked from commit 4e3dccc9290056c91d120cfa8cf74330b0a7d65d)
2021-06-01Remove sourcehut buildsMatthias Beyer
Since today, sourcehut builds should only work if payment is enabled. Right now it still seems to work. I am not sure whether this is a bug or intended. Either way, to be nice, remove the build setup for now until we figured out what is happening and how to continue. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-31Fix: git commit hash/author information passingMatthias Beyer
This fixes the git commit hash and author information passing. The changes in 2d72cbed2495517dba84ec4d46e5f521ff46412b did not add the environment variables to the `find_artifact()` call when searching for replacement artifacts. Thus, calling the same build twice, with the staging directory from the first call added in the second call, resulted in a full rebuild, although the artifacts from the first call could be resused. With this patch applied, this issue is fixed by adding the environment variables to the environment passed to the `find_artifacts()` call. Fixes: 2d72cbed2495517dba84ec4d46e5f521ff46412b ("Add feature to pass git author and git commit information to container") Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-31Merge branch 'fix-color-log-in-db'Matthias Beyer
2021-05-31Fix: Insert shouldn't be done with LogItem::display()Matthias Beyer
This fixes a nasty bug; because we used the LogItem::display() function to build the log string that was put into the database, the database contained _colorized_ log lines. Because of this, our parsing of the log text later (when reading historical data from the database) failed to parse whether the job was successfull or not. The issue was actually introduced in b3a6458ce34e3065192208826b2fc85edd4761f9, where we changed the `LogItem::display()` implementation. With this fix in place, the log text in the database is corrected again (only for new logs that get put into the database). Fixes: b3a6458ce34e3065192208826b2fc85edd4761f9 ("Add color support in LogItem::display() impl") Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-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-31Impl Debug for ParsedLogMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-31Add another successfullness test for log parserMatthias 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-28Remove feature "PackageFlags"Matthias Beyer
This patch removes the `PackageFlags` type and the feature from the package definition struct, so a user cannot longer use the package flags. This feature was not used yet in our repository, so it seems that this is nothing that is valuable. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-26Add tests for job-successfullness-checkMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-25Fix: Error out if a dependency cannot be foundMatthias Beyer
This fixes a bug where dependencies were not found, but this was ignored. This happened even if there was a typo in the version of the dependency, for example. Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Tested-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-25Impl Display for PackageVersionConstraintMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
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-18Preallocate a reasonable large bufferMatthias Beyer
This patch changes the LogReceiver to preallocate a reasonable large buffer for holding logs in memory. Because of the fact that we have to write the log _in one piece_ to the database (there might be a way to append to the log field, but that's optimization of a problem we shouldn't have - we rather should use another approach for storing logs), we have to keep the log in memory until the job is finished. For keeping the log of a job in memory, we use a `Vec`. After consulting the documentation https://doc.rust-lang.org/stable/std/collections/index.html#when-should-you-use-which-collection https://doc.rust-lang.org/stable/std/collections/index.html#sequences we found that `Vec` should be appropriate here, although `VecDeque` might be an option as well because of O(1) insertion time (and we're only inserting). Still, because `Vec` has amortized constant time for adding elements at the end, this should be sufficient. Preallocating a reasonable large amount of elements could yield big benefits with only minor disadvantage. If the job fails early (after only a few lines of log output), there's memory wasted. Also, if we have a large number of jobs, we allocate a huge amount of memory before filling it up. Because we need to have that memory anyways (considering all jobs succeed), that is not really a disadvantage. Now, what is "reasonable large"? This value might be changed later on, but for now, I took this value from experience we had when using butido in practice: select AVG(length.l), MAX(length.l), MIN(length.l) FROM ( SELECT LENGTH(log_text) - LENGTH(REPLACE(log_text, chr(10), '')) AS l FROM jobs ) AS length +-----------------------+--------+-------+ | avg | max | min | |-----------------------+--------+-------| | 2863.0497427101200686 | 165213 | 11 | +-----------------------+--------+-------+ The max and min values seem to be extreme. Now, the values contain a lot of failed jobs and the maximum value (165k log lines is _huge_!) was also a bogus setup. Removing these from the equation, using only the successful jobs, gives us a not-so-different number: SELECT AVG(l.len), MAX(l.len), MIN(l.len) FROM ( SELECT LENGTH(log_text) - LENGTH(REPLACE(log_text, CHR(10), '')) AS len, STRPOS(log_text, 'BUTIDO:STATE:OK') AS okpos FROM JOBS ) AS l WHERE l.okpos != 0 AND l.len != 165213 +-----------------------+-------+-------+ | avg | max | min | |-----------------------+-------+-------| | 2661.7306791569086651 | 55422 | 66 | +-----------------------+-------+-------+ Using the average (arithmetic mean) as a baseline, we decided to go for 4096 (2^12) preallocated elements in the buffer, which should be reasonable. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-18Make normal about message more consise, detailed about in long messageMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-18Remove angle brackets for readability and consistencyMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-18Remove unnecessary linebreakMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-18Move detailed about text to long aboutMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-17Fix typo in help messageMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-17Update changelog for the 0.1.3 releaseMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de> (cherry picked from commit 944ee16b5688f10d7f2395be630802035fa6635f)
2021-05-17Fix: Check whether environments are equalMatthias Beyer
This change fixes a bug where two submits that differed only in an environment variable where considered equal: butido build pkg butido build pkg -E FOO=1 the second build reused the artifacts from the first one, which is a bug. Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Tested-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Fix: Do not print database password in debug logMatthias Beyer
We have to manually implement Debug here, because otherwise we would print the database password in the debug output, which is CLEARLY a bad idea. Hence, change the debug!() call in the establish_connection() function to (debug-)print `self` and hand-implement the `Debug` trait. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
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-17Merge branch 'database-setup'Matthias Beyer
2021-05-17Merge branch 'fix-examples'Matthias Beyer
2021-05-17Add more detailed notes on how to setup butidoMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Create database in dev-container script as wellMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Fix example: Fix syntaxMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-17Fix example: releases are now stored in subdir of releases rootMatthias Beyer
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 'no-pager'Matthias Beyer
2021-05-17Merge branch 'download-graceful-error-reporting'Matthias Beyer
2021-05-17Merge branch 'download-fail-slow'Matthias Beyer
2021-05-12Fix: Helptext is for downloadingMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
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-12Fix typoMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-12Remove the pager env variables from CLI helptextMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-12Revert "Add automatic pager setup"Matthias Beyer
The automatic pager setup resulted in more confusion in using the CLI than in benefit. Hence, remove this feature again. This reverts commit b5a3f02a05311d5f5a4eb35b8d2513cb6a543560. 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-11Update changelog for the 0.1.2 releaseMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de> (cherry picked from commit db40f5d644fa5fbf3c0a2ea2fe3498c524f4e33f)
2021-05-11Merge branch 'doc'Matthias Beyer