Skip to content

[8.19](backport #6698) Replace elastic/infra GitHub API check with public GCS branches endpoint#6824

Open
mergify[bot] wants to merge 1 commit into8.19from
mergify/bp/8.19/pr-6698
Open

[8.19](backport #6698) Replace elastic/infra GitHub API check with public GCS branches endpoint#6824
mergify[bot] wants to merge 1 commit into8.19from
mergify/bp/8.19/pr-6698

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Apr 12, 2026

The DRA pipeline was checking branch availability by querying the private elastic/infra GitHub repo via the GitHub API, requiring a GITHUB_REPO_TOKEN. This should instead use the public endpoint https://storage.googleapis.com/artifacts-api/snapshots/branches.json.

Changes

  • .buildkite/hooks/pre-command
    • Removed GITHUB_REPO_TOKEN dependency
    • Replaced check_if_file_exist_in_repo() (GitHub API + file path lookup) with check_if_branch_available() (public GCS JSON endpoint)
    • Uses jq any(. == $branch) for exact branch name matching — avoids false positives from substring matches
    • Updated call site to match new single-argument signature
# Before: queried private elastic/infra repo via GitHub API
check_if_file_exist_in_repo() {
    local path_to_file="cd/release/release-manager/project-configs/${branchName}/build.gradle"
    local response=$(curl --fail -s -H "Authorization: token $GITHUB_REPO_TOKEN" \
        https://api.github.com/repos/elastic/${repoName}/contents/${path_to_file} | ...)
}

# After: queries public GCS endpoint
check_if_branch_available() {
    local url="https://storage.googleapis.com/artifacts-api/snapshots/branches.json"
    local response=$(curl --fail -s "${url}")
    if echo "${response}" | jq -e --arg branch "${branch}" 'any(. == $branch)' > /dev/null 2>&1; then
        ...
    fi
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/artifacts-api/snapshots/branches.json
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


This is an automatic backport of pull request #6698 done by [Mergify](https://mergify.com).

@v1v v1v enabled auto-merge (squash) April 12, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants