about summary refs log tree commit diff
path: root/ops/besadii
AgeCommit message (Collapse)AuthorFilesLines
2024-08-23 r/8557 chore(ops/besadii): remove sourcegraph index update supportVincent Ambo2-38/+1
Change-Id: I4ee9a5a69c90e2050c60b2ef8483431d691b499f Reviewed-on: https://cl.tvl.fyi/c/depot/+/12287 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-01-03 r/7322 fix(ops/besadii): error formattingFlorian Klink1-2/+2
Errors can only be wrapped in fmt.Errorf, in these two cases, we want to print their string representation to stderr. Change-Id: I65d345daacdd3960428ce82b5fdafceae61c6cc7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10527 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-01-03 r/7321 chore(ops/besadii): ioutil is deprecatedFlorian Klink1-6/+6
Change-Id: I6794162cf29fd2e0b0270265ce8ca4923bcc6aa9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10526 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-06-09 r/4232 fix(ops/besadii) test trigger.ref against configured branchÅsmund Østvold1-1/+1
Before this commit besadii only worked for repos having 'refs/heads/canon' as main branch. Change-Id: Ia2ceb8a720c675be84bc3d81b89338522cea6ebd Reviewed-on: https://cl.tvl.fyi/c/depot/+/5862 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: asmundo <asmundo@gmail.com>
2022-04-26 r/3991 fix(ops/besadii): Fix output formatting for non-CL buildsVincent Ambo1-1/+1
Change-Id: Ie9ffb2d287f6c8a1e3ae45a7ad6671b9b8fa9c8a Reviewed-on: https://cl.tvl.fyi/c/depot/+/5505 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: asmundo <asmundo@gmail.com>
2022-01-19 r/3633 feat(ops/besadii): make text 'cl' posted BuildKite configurableÅsmund Østvold1-4/+20
Some companies do not know the 'cl' term. They do know of 'change' and would maybe not like to introduce one more synonym. This cl introduce an optional entry 'gerritChangeName' in besadii.json. The string has to match `^[a-z0-9]+$` for readability. Change-Id: Id70fcb1e45158869f88bf37669be49b8b8a3b295 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4825 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: asmundo <asmundo@gmail.com>
2022-01-14 r/3592 feat(besadii): Skip builds of patchsets with no code changesVincent Ambo1-2/+8
Currently Gerrit is configured to copy forward the scores of the 'Verified' label if the tree of the commit does not change (e.g. only author information or commit message is modified). Besadii still triggers builds for these patchsets though. With this change it will inspect the (previously ignored) "kind" of the patchset and skip patchsets with the same tree as their predecessor. See Gerrit docs for the semantics of "kind": https://gerrit-review.googlesource.com/Documentation/json.html#patchSet Note that an argument can be made that we should do the exact opposite - stop carrying over 'Verified' at all and always build all patchsets. I think this depends on whether we intend to use commit metadata in CI runs at all. Adding a few people to the review for opinions. Change-Id: I48a96a1ad1e07d92330d84e5cfdc820a39395297 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4867 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: asmundo <asmundo@gmail.com> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-01-12 r/3585 fix(ops/besadii) no need to ref CL number in post to GerritÅsmund Østvold1-1/+1
The comment posted to the Gerrit change do not need to contain the CL number as it is given by the context of the Gerrit UI. Change-Id: I172645e7f4d82e2fbebe179578babd42ea29737f Reviewed-on: https://cl.tvl.fyi/c/depot/+/4826 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: asmundo <asmundo@gmail.com>
2021-12-21 r/3332 style(ops/besadii): run depotfmtsterni1-2/+2
Unclear if this reformat is caused by the channel update or if this file was ignored previously. Change-Id: I3498ab181c7fff1b132419783e33a96f7bebfe42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4520 Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-12-19 r/3307 fix(ops/besadii): fix Gerrit URL format ... againVincent Ambo1-1/+1
got into some kind of race with different patchsets of this CL somehow, idk Change-Id: I3dcdb708f141829b866fbd786483710b43ea9824 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4481 Autosubmit: tazjin <mail@tazj.in> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-12-19 r/3306 fix(ops/besadii): Only set branch to CL when building patchsetsVincent Ambo1-3/+5
If we set this for canon, then stuff starts to fail in non-obvious ways. Change-Id: I3bf38e29151c6066aaf4eba68ae387272d8a82c2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4463 Tested-by: BuildkiteCI Autosubmit: tazjin <mail@tazj.in> Reviewed-by: grfn <grfn@gws.fyi>
2021-12-19 r/3305 fix(ops/besadii): Stop path.Join from eating our URLVincent Ambo1-1/+1
apparently this chomps away at things inside of fragment strings Change-Id: Ie60d52d101dc4281b3a62c228af076791e1c7928 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4462 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2021-12-19 r/3304 feat(ops/besadii): Pass Gerrit link to builds as an envvarVincent Ambo1-1/+7
This makes it possible to annotate builds with a link back to Gerrit. Change-Id: If351785d3b631b96753d41f417ca94bc7a95ac54 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4441 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-12-19 r/3303 feat(ops/besadii): Make branch key cl/XXXXGriffin Smith1-1/+5
The branch key for buildkite builds isn't actually used to fetch if a commit is given - instead, it's just a visual grouping of multiple builds. This means we can just make the branch key cl/<cl number>, which is the convention we already use to refer to CLs and gets us a nice visual grouping of builds of successive patchsets of the same CL number, even though the ref we're providing isn't a real ref. Change-Id: Iaa9111297a88f965fda94cd8266240106f58a100 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4347 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Autosubmit: grfn <grfn@gws.fyi>
2021-12-15 r/3253 fix(ops/besadii): Don't send notifications for CI statusGriffin Smith1-0/+8
Don't notify reviewers ever on CI status changes, and only notify the owner if the build fails. Change-Id: If2cf63581b49e3de77181024ce8a4213031f4bd5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4337 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Autosubmit: grfn <grfn@gws.fyi>
2021-12-14 r/3237 feat(besadii): Make Gerrit label configurableÅsmund Østvold1-5/+11
By default besadii will set the `Verified` label in Gerrit. This adds a config option to set a different label instead if desired. Co-authored-by: Vincent Ambo <mail@tazj.in> Change-Id: I254159e46994e01182987ed5e5e26e27c57f46ce
2021-12-07 r/3150 chore(besadii): Improve error messages on parse failureVincent Ambo1-2/+2
Change-Id: I3cc4637aca8a940a0fdeca2d8bd6ac620ea384c0
2021-12-07 r/3149 fix(ops/besadii): Unquote Gerrit's extra-quotes around emailsVincent Ambo1-0/+6
Gerrit wraps RFC5322 emails in another layer of quotes when passing them as flags, and this needs to be unquoted. Otherwise hook invocations fail with cryptic errors. Change-Id: Ieeb74c662873d99a4154f8cbc92da77b039cb88e
2021-12-06 r/3146 fix(ops/besadii): Pass Build.Author to BuildkiteVincent Ambo1-12/+47
Extracts author information from the flags passed by Gerrit and moves them along to Buildkite. This should display the owners of builds correctly in the UI, rather than marking everything as coming from me. Change-Id: If9efe5553a13f0dbdb8bf3936c1d341ae5922318
2021-12-02 r/3137 refactor(ops/besadii): Get config from home directory by defaultVincent Ambo1-1/+16
Slightly more ergonomic in some setups. Change-Id: I565f2d242852ffd299ef5d5740a47520187dd4b4
2021-12-02 r/3136 refactor(ops/besadii): Generalise for use with non-TVL URLsVincent Ambo1-46/+30
This makes it possible to use besadii for any TVL-ish setup using Gerrit and Buildkite, with the same hook functionality as for TVL. Change-Id: I1144b68d7ec01c4c8e34f7bee4da590f2ff8c53c
2021-12-02 r/3135 feat(ops/besadii): Add other missing configuration keysVincent Ambo1-0/+24
Adds configuration keys and rudimentary validation for all other besadii settings that are currently hardcoded. This adds the config options: * repository: Name of the repository in Gerrit. * branch: Name of the HEAD branch in the repository. * gerritUrl: Base URL of the Gerrit instance * gerritUser: Username of the Gerrit user * gerritPassword: Password of the Gerrit user * buildkiteOrg: Name of the Buildkite organisation * buildkiteProject: Name of the pipeline inside the Buildkite organisation * buildkiteToken: Auth token for Buildkite access All of these configuration options are required. Change-Id: Ie6b109de9cd8484a3773c6351d7fd140f39a49ed
2021-12-02 r/3133 refactor(ops/besadii): Move Sourcegraph config to a fileVincent Ambo1-20/+56
Initial step towards moving besadii away from hardcoded values and onto config files. This is required because I want to reuse besadii outside of the TVL context. Change-Id: Id4fa7a49c5d4f876a02b202f04a421ab5ba0dcc4
2021-12-01 r/3125 feat(besadii): Support invocation as different Gerrit hooksVincent Ambo1-67/+117
Removes besadii support for the previously used 'ref-updated' hook and instead introduces support for the 'change-merged' and 'patchset-created' hooks. These hooks more accurately capture the semantics of when besadii should trigger CI builds and using them will avoid problems such as skipping 'canon' builds if chains of CLs are submitted together. Change-Id: Ib90356c069780bf0c0250e56b927e46a5b31ce7f
2021-11-29 r/3105 refactor(besadii): Rename refUpdated -> buildTriggerVincent Ambo1-34/+40
We are changing the Gerrit hooks which invoke besadii, but this structure will be used for both kinds. Change-Id: Idb1cb0c640d2c42db8e7af39f3ab372a97bfef91
2021-11-28 r/3102 fix(ops/besadii): Trim whitespace of auth tokensVincent Ambo1-4/+7
This is causing failures when trying to update Sourcegraph at least, for good measure I've trimmed both. Change-Id: I40266ee83b4e266ffe50f16bb365eb2e51952513
2021-09-18 r/2888 feat(besadii): Link to started builds in CL commentsVincent Ambo1-5/+35
This makes it easier to click through to a build from Gerrit after submitting a CL. Change-Id: Ic5c6eeb81c87bc4ea23c5c5ca25704434b081fd0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3572 Tested-by: BuildkiteCI Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-09-18 r/2887 refactor(besadii): Extract logic for posting review commentsVincent Ambo1-42/+50
Currently besadii only posts comments when builds succeed, but it might be very useful to also have a link to a build when the build is started. This just shuffles code around. The only functional change is that the `labels` field in the review input is marked as `omitempty`, as this will not be needed when posting the build start comment. Change-Id: Id4a43fad8817c9a15da02f01ab2b781d48b46978 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3571 Tested-by: BuildkiteCI Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-08-24 r/2757 feat(besadii): Tag gerrit comments as autogeneratedGriffin Smith1-7/+10
This is a bit of an under-documented feature, but if the "tag" field for a gerrit review starts with the string "autogenerated:<something>~<something-else>", only the last comment per instance of <something> will be shown by default on the CL page (with the rest viewable by toggling the "Show all entries" switch). The idea behind the "<something-else>" tag is to be used for the "type" of comment within a particular system - gerrit's documentation gives the example of one tag for "the build is running" and another for "the build has finished, here's the result". Change-Id: I9199a6ed97beca1b3a51ec5d6230c6c8358ba2b3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3374 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-04-12 r/2494 chore(besadii): Stop passing explicit messages to BuildkiteVincent Ambo1-6/+0
Dropping the message field will make Buildkite use the commit messages instead, which makes for much more readable build logs. Change-Id: I1849f811632526893b700f117c9f6cf64888c329 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2949 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2021-03-25 r/2329 refactor: Replace some uses of builtins.toFile with pkgs.writeTextVincent Ambo1-3/+1
I'm looking at removing some of these because they can cause unnecessary build steps during CI pipeline generation. Change-Id: I84742968918090c050d2eedab8a1b42692632a42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2655 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2021-02-06 r/2182 fix(config): remove ciBuilds inheritsterni1-1/+1
The ciBuilds attribute seems to no longer exist and it breaks the evaluation of the config attribute. It's only appearance was in besadii which doesn't actually use the attribute. Removing the ciBuilds inherit fixes these issues. Change-Id: Ibbf3413ba6efe10ad868cf57cf0711d574860f97 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2487 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-01-30 r/2159 chore(3p|nix): Remove typed GoVincent Ambo2-2/+2
Nobody has actually done any experimentation with typed Go, so we're getting rid of it for now - it's causing annoying IFD during build graph generation. Change-Id: Ibac3dea98ebed1b3ee08acda184d24c500cf695d Reviewed-on: https://cl.tvl.fyi/c/depot/+/2458 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: Profpatsch <mail@profpatsch.de>
2020-08-26 r/1724 fix(besadii): Remove unused Nix code from the derivationVincent Ambo1-4/+0
This was used previously when build granularity was besadii's task, which it no longer is. Change-Id: I6df2db1ed4730a7953199b7b48aa9ad916418b22 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1853 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-17 r/1669 docs: Update README for the repository itselfVincent Ambo1-2/+2
Adds a lot more information about what is actually going on here, as well as links to relevant things such as our Monorepo document. I'm aware that I didn't make all `//...` links clickable, but I realised at some point that it might be easier to just update cheddar to support highlighting those natively :-) Change-Id: Icbb212a6c07a5cf38ab8e65d83a64bec783eb8d0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1768 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-02 r/1537 fix(besadii): Don't add people back to attention set.Luke Granger-Brown1-3/+7
This uses the not very documented ignore_default_attention_set_rules review API. Change-Id: I650777bbbd24a1922f26967fbbd7da06d14b6782 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1513 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-03 r/1202 chore(besadii): Stop adding Code-Review label on CLsVincent Ambo1-7/+0
We now use the actual 'Verified' label instead of Code-Review from Buildkite, this workaround is no longer required. This reverts commit d3f9cb0ec398d25a3be01cbc7c9b1ee8716b877f. Change-Id: Ib8c1680eae844cb7b45bf8837acf2af03d4ed344 Reviewed-on: https://cl.tvl.fyi/c/depot/+/909 Reviewed-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-07-01 r/1144 fix(besadii): Do not pass on update values for meta refsVincent Ambo1-2/+2
Before this change, besadii would skip further processing of meta refs (which happen for every CL metadata change), but it would still schedule a build by returning an update - which would then inevitably fail. This change makes besadii skip meta refs the same way it skips non-depot builds, i.e. completely. Move *on* from meta refs, do *not* collect $100. Change-Id: I269d2299f4d3cb1f9c041da8c92fa00ae7794b38 Reviewed-on: https://cl.tvl.fyi/c/depot/+/825 Reviewed-by: eta <eta@theta.eu.org> Reviewed-by: BuildkiteCI Tested-by: BuildkiteCI
2020-06-30 r/1135 fix(besadii): Don't log errors for /meta refsVincent Ambo1-2/+3
These are updated for all sorts of things and should just be silently ignored by besadii. Change-Id: I0a6de373b21d6bef5fd31d0a1d3f72c501073bba Reviewed-on: https://cl.tvl.fyi/c/depot/+/801 Reviewed-by: BuildkiteCI Reviewed-by: Kane York <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-06-29 r/1129 feat(besadii): Temporarily add Code-Review labels on CLsVincent Ambo1-0/+7
Besadii already adds 'Verified'-labels, which are used to signal CI status on CLs, however we don't actually use these labels (yet) which also means that they are not displayed in the Gerrit UI. This change temporarily introduces the Code-Review label *in addition* (with the same values as Verified), providing a build status signal on the CL but without being required for submission. Change-Id: I2c3a37c59aceb426815ad4e400c80ab85be482dd Reviewed-on: https://cl.tvl.fyi/c/depot/+/781 Tested-by: BuildkiteCI Reviewed-by: ericvolp12 <ericvolp12@gmail.com> Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-06-29 r/1127 feat(besadii): Implement support for Buildkite's post-command hookVincent Ambo1-19/+118
This hook is invoked by Buildkite (on the runner) after every build stage. This change adds support in Besadii to run as this hook and update the build status on a Gerrit CL. Change-Id: Ie07a94d9b41645a77681cf42f6969d218abf93c1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/761 Tested-by: BuildkiteCI Reviewed-by: Kane York <rikingcoding@gmail.com>
2020-06-29 r/1122 feat(besadii): Propagate Gerrit change ID & patchset to BuildkiteVincent Ambo1-4/+9
I previously implemented this in a CL that ended up being abandoned, but it turns out we need it for the hook setup, anyways. These environment variables become available during the build and, crucially, to the post-build hooks. Change-Id: Id6c1657947995e8bae1fa7b76184dd8be4c01525 Reviewed-on: https://cl.tvl.fyi/c/depot/+/739 Reviewed-by: Kane York <rikingcoding@gmail.com>
2020-06-28 r/1106 feat(besadii): Enable automatic builds for CLsVincent Ambo1-12/+29
This expands builds to also be triggered for updates to CL refs. The message displayed on Buildkite will contain a link back to the CL (& patchset) from which the build was triggered. Change-Id: Ib36dee454aeb11d623b89c78b384359ee7ea3477 Reviewed-on: https://cl.tvl.fyi/c/depot/+/708 Reviewed-by: ericvolp12 <ericvolp12@gmail.com> Reviewed-by: isomer <isomer@tvl.fyi>
2020-06-28 r/1105 refactor(besadii): Rename branchUpdate -> refUpdatedVincent Ambo1-7/+8
The name of the hook this type represents is 'refUpdated'. Since we're adding support for additional hooks, it makes sense to to rename this accordingly. Change-Id: Ia568c85493813f5e754c77d0b993aaf246d3d595 Reviewed-on: https://cl.tvl.fyi/c/depot/+/667 Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-06-27 r/1101 feat(besadii): Trigger builds on Buildkite instead of SourcehutVincent Ambo1-113/+35
These builds run on runners that we control and disk space is (less of) an issue there. Change-Id: Id0a1436b2368418e447f6d5298ab474f829d4c97 Reviewed-on: https://cl.tvl.fyi/c/depot/+/628 Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-06-26 r/1092 feat(besadii): Trigger separate builds for build target setsVincent Ambo2-18/+60
In CL/570 we split up the build targets into different buckets, with the idea that this should help us avoid the disk space issues on Sourcehut. This commit changes Besadii to read the list of target sets from a file and trigger a separate build for each one of them. Change-Id: If280fda5f40cd130c534c40911072e47c2d8f2be Reviewed-on: https://cl.tvl.fyi/c/depot/+/608 Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-06-19 r/1027 feat(besadii): Add Sourcegraph index update triggersVincent Ambo1-13/+42
Sourcegraph has a heuristic for determining when to update the repository that doesn't work for the TVL repository, where commits are often in irregular short bursts. This changes besadii to trigger Sourcegraph index updates when invoked by Gerrit. Change-Id: Ifcfc25406d9e25bbdc93e79c23608ce4c6b10ba8
2020-06-18 r/1018 chore(besadii): Make besadii a Go2 projectVincent Ambo2-2/+2
Change-Id: Id5aef73b131252fb9c880dd95fc72bfe083f1b75
2020-06-13 r/931 feat(besadii): Adapt into a Gerrit ref-updated-hookVincent Ambo2-65/+60
Besadii was previously invoked as a git post-update hook, but Gerrit does not use these hooks and instead has its own concept of hooks. This change adapts besadii to be compatible with the way Gerrit hooks are invoked (arguments being passed as flags, rather than via stdin). Change-Id: I487b3a9e15810583bc5442fdc024ee2771c580cb
2020-06-12 r/916 feat(camden): Move cgit to code.tvl.fyiVincent Ambo1-5/+5
Moves the host at which cgit is served to 'code.tvl.fyi'. Also updates related projects that link to this, most importantly: * Hound's & Gerrit's cgit link bases have been updated * besadii is updated to request CI builds for the new location Change-Id: I44e3e584010ac29cc913ebb1a197c996eb024d80 Reviewed-on: https://cl.tvl.fyi/c/depot/+/71 Reviewed-by: lukegb <lukegb@tvl.fyi>