[BuildStream] Minor code review enhancement: Documentation Preview



Hi all,

When reviewing merge requests with documentation changes, I often find it
useful to look at the generated documentation to ensure formatting, links etc.
are correct. Especially since it's hard to catch them during the build.

GitLab does allow one to browse the artifacts for a build, so it's possible to
see the preview directly on GitLab without having to build the docs locally.
This works well, but requires one to follow a bunch of links before seeing the
docs. I find it mildly annoying to have to do this for each review.

To fix that, I have written a small bot that will post the link to the
generated documentation, if the "docs" job succeeds. The link will be posted as
a commit status on GitLab, with the name "Preview Documentation", and will be
visible next to other statuses under the "external" group.

Since this was a such a small change, and not intrusive in my opinion, I
thought I'd ask for forgiveness, not permission :) I have added configured this
bot to listen on the BuildStream repository events, so we should start seeing a
new status on merge requests.

An example would be this merge request:
https://gitlab.com/BuildStream/buildstream/merge_requests/1576. Click on the
"external: passed" to see the status, and then click on the status to follow
the link.

In case anyone notices any issues with this, please let me know. I will fix it
or stop it as appropriate.


Cheers!
Chandan

PS: For the curious, this runs as an AWS Lambda function and the function
    definition can be found at: https://gitlab.com/snippets/1891489.

PPS: The only reason this doesn't run as a part of the CI job is to ensure that
     we don't leak the credentials required to post the status.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]