Skip to content

Commit

Permalink
Don't send gitea status update when build is started
Browse files Browse the repository at this point in the history
This was the source of a flaky test because sometimes hydra-notify was
quick enough to send out `buildStarted` and sometimes it apparently
wasn't which was quickly spottable with `nix build --rebuild`.

Removing that status update doesn't make a difference functionally,
gitea doesn't differentiate between "queued" and "running", so we send
the same status ("pending") out on both events, so we'd even safe one
avoidable request.
  • Loading branch information
Ma27 committed Mar 8, 2024
1 parent ceff5c5 commit 806c375
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,9 @@
response = json.loads(data)
assert len(response) == 3, "Expected exactly three status updates for latest commit (queued, started, finished)!"
assert len(response) == 2, "Expected exactly three status updates for latest commit (queued, finished)!"
assert response[0]['status'] == "success", "Expected finished status to be success!"
assert response[1]['status'] == "pending", "Expected started status to be pending!"
assert response[2]['status'] == "pending", "Expected queued status to be pending!"
assert response[1]['status'] == "pending", "Expected queued status to be pending!"
machine.shutdown()
'';
Expand Down
4 changes: 0 additions & 4 deletions src/lib/Hydra/Plugin/GiteaStatus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ sub buildQueued {
common(@_, [], 0);
}

sub buildStarted {
common(@_, [], 1);
}

sub buildFinished {
common(@_, 2);
}
Expand Down

0 comments on commit 806c375

Please sign in to comment.