Has anyone gotten the Pulumi Github App to work wi...
# general
f
Has anyone gotten the Pulumi Github App to work with buildkite (http://buildkite.com/)? I see it in the Github checks, but I haven’t seen the Pulumi bot actually make a PR comment yet. I tried to reverse engineer the environment variables that I need to set by looking at https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/pulumi++%22PULUMI_CI%22#3 In my buildkite builds, I use the following script to set up the env vars:
Copy code
#!/usr/bin/env bash

set -ex

cd "$(dirname "${BASH_SOURCE[0]}")/.."

if [ "$BUILDKITE_PULL_REQUEST" == "false" ]; then
    export PULUMI_CI_BUILD_TYPE=push
else
    export PULUMI_CI_BUILD_TYPE=pull_request
    export PULUMI_CI=pr
fi

export PULUMI_CI_BUILD_ID=$BUILDKITE_BUILD_ID
export PULUMI_CI_BUILD_URL=$BUILDKITE_BUILD_URL
In the build step that actually runs
pulumi preview --diff
, I can see that
PULUMI_CI_BUILD_TYPE == pull_request
and
PULUMI_CI == pr
. Is there anything else that I need to set?
Oh, and
PULUMI_CI_SYSTEM == "Buildkite"
as well
bumping this since it’s now monday
w
cc @colossal-beach-47527 and @clever-sunset-76585 in case they know.
c
Hi @fierce-dinner-20116 there are a few more values required needed so the the Pulumi GitHub app can comment on your PRs. Let me dig up the right values…
👍 1
The Pulumi GitHub app works by recognizing the Git commit SHA in the update(s) performed on your CI system, and then matching those to the git commit SHAs from your pull request. So the values we need are here: https://github.com/pulumi/pulumi/blob/master/cmd/util.go#L501
PULUMI_CI_PULL_REQUEST_SHA
- The commit hash of the pull request. This is usually different from what is being built on your CI system, since your CI system builds at the merge commit of the pull request merged into the target branch.
We haven’t added automatic detection for BuildKite. But if you are feeling saucy, you are more than welcome to add it. Just take a look at the files in this directory: https://github.com/pulumi/pulumi/tree/master/pkg/util/ciutil. It should just be a matter of adding the right environment variables that are sent on the BuildKite builder. e.g. a BuildKite part of this switch statement: https://github.com/pulumi/pulumi/blob/master/pkg/util/ciutil/vars.go#L53
Let me know if that works out for you, or if you have any other questions.
f
Thanks, it worked! I’ll look into submitting a PR to add proper Buildkite support. Thanks for your help!
🙌🏽 2