@@ -36,6 +36,24 @@ pipeline: `.gitlab/hpsf-gitlab-ci.yml`. The PR comment triggered job pulls
3636the PR branch from GitHub first before running tests. For this approach to
3737work, we store a pipeline trigger (obtained from GitLab's `Settings -> CI/CD
3838-> Pipeline trigger tokens` ) as a secret at GitHub's ` Settings -> Secrets
39- and variables -> Actions -> Repository secrets`. The GitHub workflow waits
40- for the result of the GitLab pipeline result and posts the final status and
41- a link to the result as a comment.
39+ and variables -> Actions -> Repository secrets`.
40+
41+ After the GitLab pipeline finishes, its ` .post ` stage will post the final
42+ status and a link to the results back to the GitHub PR as a comment. This is
43+ done through a GitHub App that we built and installed in the AMReX
44+ repository. The App was created via
45+ https://github.com/organizations/AMReX-Codes/settings/apps . It does not need
46+ "Webhook" access. For repository permissions, it only needs read & write to
47+ pull requests so it can create PR comments. The app requires a private key,
48+ which you generate during the setup. After the app was installed in the
49+ amrex repository, we got an installation ID. We then stored the app ID,
50+ installation ID and the private key in GitLab's `Settings -> CI/CD ->
51+ Variables`. The app ID isn't a secret. So you can store it as clear text. In
52+ fact, GitLab does not allow 7-digit masked variables anyway. The
53+ installation ID is also not senstive, but nevertheless we stored it as
54+ protected and masked. The private key is a secret that must be protected and
55+ masked. We also diabled "Expand" for all of these variables because the CI
56+ script doesn't need variable expansion. GitLab seems to have a bug that
57+ prevents saving the private key as a multi-line value, and saving it as a
58+ file didn't work either. So we encoded it with ` base64 -w0 ` to turn it into
59+ a single line. That's why in the GitLab CI script we have to decode it.
0 commit comments