Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildkite use pat #2919

Merged
merged 7 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/build_pr_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
env:
USE_HTTPS_CLONE: true

steps:
- key: "cancel-existing-builds"
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/preview_cleaner_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
env:
USE_HTTPS_CLONE: true

steps:
- label: ":white_check_mark: Preview cleaning"
command: ".buildkite/scripts/clean_preview_branches.sh"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/build_pr_commit_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Setting commit status: buildkite/${BUILDKITE_PIPELINE_SLUG} - ${status_sta
curl -s -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Authorization: Bearer ${VAULT_GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${githubPublishStatus}" \
-d "${data}"
2 changes: 1 addition & 1 deletion .buildkite/scripts/clean_preview_branches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ssh-agent bash -c '
-v ~/.ssh/known_hosts:/root/.ssh/known_hosts:cached,ro \
-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK:cached,ro \
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
-e GITHUB_TOKEN=$GITHUB_TOKEN \
-e GITHUB_TOKEN=$VAULT_GITHUB_TOKEN \
-v /opt/git-mirrors:/opt/git-mirrors:cached,ro \
-e CACHE_DIR=/opt/git-mirrors \
$IMAGE node /docs_build/preview/clean.js $REPO'
3 changes: 2 additions & 1 deletion preview/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Cleaner(token, repo, cache_dir, tmp_dir) {
if (found) {
acc.push({
branch: found[1],
// Temporary hack during the Buildkite migration that breaks the <repo>_<PR> convention,
// Temporary hack during the Buildkite migration that breaks the <repo>_<PR> convention,
// and introduces the <repo>_BK_<PR> convention - see https://github.com/elastic/docs-projects/issues/134
repo: found[2].includes('_bk') ? found[2].replace('_bk', '') : found[2],
number: Number(found[3]),
Expand Down Expand Up @@ -96,6 +96,7 @@ function Cleaner(token, repo, cache_dir, tmp_dir) {
}

const is_pr_closed = function (pr) {
console.info(`Checking status of https://github.com/elastic/${pr.repo}/pull/${pr.number}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is extra-logging that makes it easier to understand which PR is creating issues

return new Promise((resolve, reject) => {
const body = {
query: `
Expand Down