Commit graph

122 commits

Author SHA1 Message Date
Skyler Grey 8f62abf571 fix: Correct output path with failed builds
Previously, if a build failed to produce any output we would try to
write "None" to the output file. This doesn't work, causing the job to
error. Instead, we should skip writing the output and preserve the
original "failed" status.
2024-09-11 20:27:39 +00:00
Skyler Grey 70dfe25211 feat!: Update output path writing
- Allow pull requests to create output paths

Previously, it was not possible to get unmerged pull request outputs. I
would like to access these (e.g. for hosting a preview version of a
website in a similar way to https://docs.netlify.com/site-deploys/deploy-previews/
or https://vercel.com/docs/deployments/preview-deployments)

These are now surfaced under `{owner}/{repo}/pulls/{pr number}`

- Fix repository attribute name conflicts

Previously there was no difference between samely-named attributes in
different repositories.

This has been changed so outputs are under `{owner}/{repo}/{branch}`

- Allow full attribute names, still stripping path traversal

Previously, presumably to prevent path traversal, if your attribute name
contained slashes buildbot-nix would only take the last segment as an
output.

This has been replaced by interpreting slashes as subdirectories and
refusing any segments which don't descend into a subdirectory (i.e. are
attempting path traversal)

- Still create outputs on skipped builds

Previously when something was skipped, for example a build that was
completed in a pull request, the output wouldn't be updated. This made
the outputs directory quite unreliable.

Outputs will now always be updated, no matter whether a build was
actually executed.

BREAKING-CHANGE: This stops old output locations being outputted. If you rely on these locations, you will need to update whatever relies on them.
2024-07-28 08:50:18 +00:00
magic_rb 0ecf33f8d4
Reformat gitea_projects.py, __init__.py, and github_projects.py
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 11:53:06 +02:00
magic_rb 19d5cdd29a Hide gcroot registration steps from the reporters
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 11:37:23 +02:00
magic_rb d44dc3da09
Fix Gitea backend using the Gitea url as a webhook url
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 11:37:10 +02:00
magic_rb 437ebc49b9 Support combined builds for Gitea
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 11:23:49 +02:00
magic_rb 28b6da6e73
Make the cut off point for combining build reports customizable.
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 11:23:38 +02:00
magic_rb dd2df67009 Combine build reports for GitHub if there are too many
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 11:09:12 +02:00
Jörg Thalheim 7480ee03b3 jwt: fix passing private_key_file to command 2024-07-26 06:13:34 +00:00
Jörg Thalheim eb6fae3100 fix linter errros 2024-07-26 06:13:34 +00:00
magic_rb 6e8e735628 Utilize pydantic for serialization and deserialization
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-26 06:13:34 +00:00
Jörg Thalheim 5bdbb76096
Merge pull request #229 from MagicRB/support-other-caches
Generalize Cachix support to `post_build_steps`
2024-07-19 17:27:23 +02:00
magic_rb 8a6d34b83c Create gcroots on skipped builds too
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-19 15:09:38 +00:00
magic_rb e99623b2f6
Generalize Cachix support to post_build_steps
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-18 17:39:36 +02:00
Jörg Thalheim 0b301f0782 switch to www package back 2024-07-14 04:50:23 +02:00
Jörg Thalheim 5163434da6 github/reporter: use properties to render github secret 2024-07-14 02:48:29 +00:00
magic_rb c3346978d5 Support per installation tokens directly in GitHubStatusPush
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-14 02:48:29 +00:00
Jörg Thalheim 6c7b3b1a1c fix max-silent-time 2024-07-13 00:06:04 +00:00
magic_rb 458b39fc3a Don't pass token into AvatarGitHub, it works perfectly without it
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-12 07:33:19 +02:00
Jörg Thalheim 3389164c13 fix retries beeing zero 2024-07-12 07:28:28 +02:00
Jörg Thalheim 701a5ac400 add build retries nixos option 2024-07-09 09:29:57 +00:00
magic_rb 372d7dc70b Defer hook creation to project reload, both GitHub and Gitea
Signed-off-by: magic_rb <richard@brezak.sk>
2024-07-05 12:13:55 +00:00
Jörg Thalheim 837df7f642 fix normalizing builder names 2024-07-05 11:47:21 +00:00
Jörg Thalheim c94738d1a1 buildbot_nix: allows to restart a build 2024-07-05 11:47:21 +00:00
zowoq 1912618053 remove github.user 2024-06-14 14:35:31 +00:00
magic_rb aaab03e1da Fix JWT token renewal condition
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-14 14:28:26 +00:00
magic_rb 16d4308d29 Fix GitHub InstallationToken renewal.
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-13 10:54:09 +02:00
magic_rb 300fd88394
Fix treefmt errors introduced in #156
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-12 18:59:23 +02:00
Richard Brežák 7e327b88b6
Merge pull request #156 from MagicRB/github_app
Add GitHub App support
2024-06-12 15:40:19 +00:00
magic_rb 0ac5dcb33d
Fix GitHub App backend failing if project-id-map disappears
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-12 17:36:43 +02:00
magic_rb 467b9164de
Fix app_project_id_map_name in GitHub App backend, not having a .json extension
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-12 17:36:08 +02:00
magic_rb eeb21e9ddd
Streamline Legacy <-> App GitHub auth backend migrations
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-12 17:19:11 +02:00
Jörg Thalheim 9f04067a6a bust cache after adding installation_id 2024-06-12 07:58:34 +02:00
Jörg Thalheim 30a49d4e88 fix typo in class name 2024-06-07 16:55:36 +02:00
Jörg Thalheim 4357604463 add assert message to get_repo_token 2024-06-07 16:50:03 +02:00
magic_rb 475fbf3952 Fix GitHub avatars for GitHub Apps
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-07 08:16:40 +00:00
magic_rb 5dc05ea3fe Fix GitHub installation tokens not getting updated in the cache file
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-07 08:16:40 +00:00
magic_rb 067f3e0fc1 Add GitHub App support
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-07 08:16:39 +00:00
magic_rb 12e9d639df
Fix Gitea backend not authenticating properly with Gitea
Signed-off-by: magic_rb <richard@brezak.sk>
2024-06-02 16:30:29 +02:00
Jörg Thalheim 48d3f2dedc gitea: don't drop pull request events 2024-05-03 20:36:17 +02:00
Jörg Thalheim 1153510b04 Revert "don't block CI on github status updates"
This reverts commit 0bb55aaa8dfe98dc81c993d647ba814ebd9df260.
2024-05-03 20:36:17 +02:00
Jörg Thalheim f0f934bf11 don't block CI on github status updates 2024-05-03 11:51:34 +00:00
Jörg Thalheim a36953b52d gitea: fix testing pull requests 2024-05-03 10:20:55 +00:00
Jörg Thalheim 5e37a99685 github: only include properties that we actually use for performance 2024-05-02 04:29:28 +00:00
Jörg Thalheim 4f78c6e7f7 gitea: expect full instance url 2024-05-01 12:00:45 +02:00
Jörg Thalheim 993b5e822a log worker name on startup 2024-04-30 18:03:29 +02:00
Jörg Thalheim 56899cd29c fix printing errors in project reload hooks 2024-04-30 18:03:29 +02:00
Jörg Thalheim 6ae08b645c make it possible to disable github 2024-04-30 17:32:40 +02:00
magic_rb 3f01a96147 Add Gitea backend
Signed-off-by: magic_rb <richard@brezak.sk>
2024-04-29 18:30:15 +02:00
magic_rb 1605d2d3c2 Remove assumption of GitHub being the only forge
Signed-off-by: magic_rb <richard@brezak.sk>
2024-04-29 18:29:35 +02:00