Commit Graph

3791 Commits

Author SHA1 Message Date
b1b1b4b74b t/lib/LDAPContext.pm: error message nit
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-02-10 11:31:49 -05:00
4837a68d8d LDAPContext: don't background slapd 2022-02-10 09:28:53 -05:00
8bce8109e3 flake.nix: drop the LDAP server test 2022-02-09 20:56:10 -05:00
80c6525029 LDAP: Create a test which does not use a VM 2022-02-09 20:56:10 -05:00
e4adec36f3 Set an env var in the build environment to point to the root of openldap 2022-02-09 20:56:10 -05:00
60adee7f94 hydra check inputs: add openldap 2022-02-09 20:56:10 -05:00
9ae7c8bddc Hydra::Helper::Exec add an expectOkay which dies with stdout / stderr on exit 2022-02-09 20:56:10 -05:00
5184e895df Merge pull request #1148 from DeterminateSystems/hydra-helper-exec
captureStdoutStderr*: move to Hydra::Helper::Exec which helps avoid some environment variable fixation problems
2022-02-09 14:42:07 -05:00
a374ef7d81 Merge pull request #1149 from DeterminateSystems/flake-format
flake.nix: format with nixpkgs-fmt
2022-02-09 14:40:48 -05:00
845e6d4760 captureStdoutStderr*: move to Hydra::Helper::Exec which helps avoid some environment variable fixation problems 2022-02-09 14:28:50 -05:00
68c6c3d556 flake.nix: format with nixpkgs-fmt 2022-02-09 10:43:40 -05:00
1abe7f4d80 Merge pull request #1145 from DeterminateSystems/eval-status
`eval_*` events: change the API to include IDs and use \t separators
2022-02-09 10:23:15 -05:00
517dce285a eval_added event: change interface to traceID\tjobsetID\tevaluationID
I was not going to break the interface until I noticed
the current implementation uses the string literal \t.
2022-02-08 09:51:35 -05:00
d512e6220f eval_failed event: change interface to traceID\tjobsetID
I was not going to break the interface until I noticed the other eval_* events used literal \ts
2022-02-08 09:51:35 -05:00
2597fa8c11 eval_cached event: change interface to traceID\tjobsetID\tevaluationID
I was not going to break the interface until I noticed
the current implementation uses the string literal \t.
2022-02-08 09:51:35 -05:00
be531c6c57 notifications.t: create a helper to parse the actual messages from the evaluator using the Event code 2022-02-08 09:51:35 -05:00
c30f084f32 eval_started event: change interface to traceID\tjobsetID
I was not going to break the interface until I noticed
the current implementation uses the string literal \t.
2022-02-08 09:51:35 -05:00
3864ca820a Merge pull request #1144 from DeterminateSystems/eval-event-cleanup
Eval event cleanup
2022-02-08 09:50:33 -05:00
c0eb873379 notifications: document eval_* 2022-02-07 18:08:01 -05:00
f648e91487 StepFinished.t: fixup use 2022-02-07 16:08:40 -05:00
7107ce2bc7 t/Event/* -> t/Hydra/Event/ 2022-02-07 16:08:40 -05:00
8a18326f2b Sort notification classes / events 2022-02-07 16:08:27 -05:00
7b7c03a521 Merge pull request #1141 from amerocu/amerocu/fix-dev-env
missing develop dependencies
2022-02-06 14:35:27 -05:00
73f2cc184f missing develop dependencies 2022-02-05 20:28:44 +01:00
85b842e0ac Merge pull request #1137 from DeterminateSystems/runcommand-logs
Store and display the output of RunCommands
2022-01-31 16:26:31 -05:00
b57345ba1f hydra.sql: add IndexRunCommandLogsOnBuildID index 2022-01-31 12:56:34 -08:00
d0b6329aa8 sql/upgrade-81: remove unnecessary comment 2022-01-31 12:55:36 -08:00
9c4e6f78e7 hydra-module: don't bzip2 runcommand-logs 2022-01-31 12:55:36 -08:00
8c67e32480 RunCommand: ensure we reset the umask 2022-01-31 12:55:36 -08:00
34e4c119f4 build.tt: don't duplicate RunCommandLog buttons 2022-01-31 11:40:16 -08:00
61189ecca9 Helper/Nix: constructRunCommandLogPath: verify uuid is valid
This shouldn't be possible normally, but it is possible to:

    $db->resultset('RunCommandLogs')->new({ uuid => "../etc/passwd" });

if you have access to the `$db`.
2022-01-31 08:58:33 -08:00
e381751564 Helper/Nix: constructRunCommandLogPath: return undef in case of an error
This allows us to give a web request to an invalid UUID a 404.
2022-01-31 08:58:33 -08:00
2c6487b8d7 t/Helper: test constructRunCommandLogPath 2022-01-31 08:58:33 -08:00
8bf3cdbc67 t/Helper: switch to using test_context() 2022-01-31 08:58:33 -08:00
8eab7b8543 Helper/Nix: constructRunCommandLogPath: take RunCommandLog as input
This way we ensure that it actually exists in the database, rather than
blindly trusting user-generated input.
2022-01-31 08:58:33 -08:00
61914d56c6 runcommand-log.tt: escape the command 2022-01-31 08:58:33 -08:00
71bbb042db build.tt: link to the pretty, raw, and tail versions of the log
Also split it out to a new div -- there are now 3 lines per
RunCommandLog -- the first saying when it started, the second saying how
long it ran for (or has been running), and the third with the buttons
for the pretty, raw, and tail versions of the log.
2022-01-31 08:58:33 -08:00
3594ba942a Controller/Build: use showLog in view_runcommandlog
This also adds the `runcommandlog` object to the stash so that we can
access its uuid as well as command run in order to display more useful
and specific information on the webpage.
2022-01-31 08:58:33 -08:00
1d0076408b Controller/Build: pass log_uri to showLog in place of drvPath
This way, we can reuse the `showLog` sub for other things, such as
`view_runcommandlog` (which doesn't have a drvPath attached).
2022-01-31 08:58:33 -08:00
ff390e89a6 Controller/Build: remove unused parameter from showLog 2022-01-31 08:58:33 -08:00
38896db6b6 t/RunCommand: init http.t
Test that we can indeed visit the pages of a valid runcommand log and
not of an invalid one.
2022-01-31 08:58:33 -08:00
47c1f89d5a t/RunCommand: fixup basic.t to use uuid 2022-01-31 08:58:33 -08:00
fc3cf4ecb2 RunCommandLogs: identify and access via uuid
Using a sha1 of the command combined with the build ID is not a
particularly good or unique identifier:

* A build could fail, be restarted, and then succeed -- assuming no
configuration changes, the sha1 hash of the command as well as the build
ID will be the same. This would lead to an overwritten log file.

* Allowing user input to influence filenames is not the best of ideas.
2022-01-31 08:58:33 -08:00
dcb0c1425c RunCommandLogs: set a UUID automatically 2022-01-31 08:58:33 -08:00
89e8676d80 UUID4Tiny: init 2022-01-31 08:58:33 -08:00
cf49a05ff5 RunCommandLogs: add a uuid to each log entry 2022-01-31 08:58:33 -08:00
94ed9ed7ff Merge pull request #1136 from DeterminateSystems/github-status-cached-evals
GithubStatus: try pushing statuses for cached buildqueued/buildfinished events
2022-01-31 09:11:37 -05:00
3ae4b19d12 flake: update to postgres 13 for UUID commands 2022-01-28 13:07:11 -08:00
244300c1ad RunCommand: remove unused and problematic imports
Since breaking the filename construction out to a helper function,
Hydra::Model::DB is no longer used. Importing Hydra::Helper::Nix,
however, has the potential to break tests, so just use the functions we
need without importing the entire module.
2022-01-28 13:07:11 -08:00
fdf6f4d3da RunCommand: use IPC::Run3::run3 instead
run3 just seems to do better handling for what we want to do, and
requires less deep-reaching changes to this plugin to get it to play
nice, as IPC::Run::run would.
2022-01-28 13:07:11 -08:00