Skip to content

Switch active-branches source to S3 endpoint and simplify parsing - #874

Merged
v1v merged 6 commits into
mainfrom
copilot/update-active-branches-endpoint
May 22, 2026
Merged

v1v merged 6 commits into
mainfrom
copilot/update-active-branches-endpoint

Conversation

Copilot AI commented Apr 1, 2026 •

Copy link
Copy Markdown
Contributor

Replace the GCS-hosted branches.json endpoint with the new release team S3 endpoint active-branches.txt, removing JSON parsing overhead in favor of a plain-text line-per-branch format.

elastic/active-branches

  • Drop requests dependency entirely; use stdlib urllib.request
  • Remove the pip install requests==2.31.0 action step
  • Parse response as plain text (one branch per line) instead of payload.get('branches') from JSON

github/backport-active

  • Update default backports-url to new S3 endpoint
  • Replace get_config_from_url (returned JSON dict) with get_branches_from_url (returns list[str] directly)
  • Update unit test mocks from response.json.return_value = {...} to response.text = 'branch1\nbranch2\n...'
  • Update README to reflect new URL and plain-text format

Before:

req = requests.get('https://storage.googleapis.com/artifacts-api/snapshots/branches.json')
branches = req.json().get('branches')

After:

with urllib.request.urlopen('https://elastic-release-api.s3.us-west-2.amazonaws.com/public/active-branches.txt') as response:
    branches = [line.strip() for line in response.read().decode('utf-8').splitlines() if line.strip()]

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:

  • elastic-release-api.s3.us-west-2.amazonaws.com
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
    • Triggering command: /usr/bin/curl curl -v REDACTED (dns block)

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

Copilot AI changed the title [WIP] Use new active branches API endpoint Switch active-branches source to S3 endpoint and simplify parsing Apr 1, 2026
Copilot finished work on behalf of v1v April 1, 2026 18:59
Copilot AI requested a review from v1v April 1, 2026 18:59
@v1v v1v added the changelog:enhancement When you enhance an existing feature label May 20, 2026
Copilot AI review requested due to automatic review settings May 20, 2026 15:13
@v1v
v1v marked this pull request as ready for review May 20, 2026 15:13
@v1v
v1v requested a review from a team as a code owner May 20, 2026 15:13
@v1v

v1v commented May 20, 2026

Copy link
Copy Markdown
Member

@copilot the CI failed with

Traceback (most recent call last):
  File "/home/runner/work/oblt-actions/oblt-actions/./elastic/active-branches/script.py", line 41, in <module>
    response = requests.get(branch_url, headers=headers)
               ^^^^^^^^
NameError: name 'requests' is not defined

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the “active branches” source from the legacy GCS JSON endpoint to a new release-team S3 plain-text endpoint, simplifying branch parsing and updating consumers accordingly.

Changes:

  • Update github/backport-active to default to the new S3 active-branches.txt endpoint and parse branches as plain text lines.
  • Update elastic/active-branches to fetch branches via urllib.request and remove the requests install step.
  • Adjust unit tests and README docs to reflect the new plain-text format and default URL.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
github/backport-active/test_backport_script.py Updates mocks to provide branch lists via response.text (line-per-branch) instead of JSON.
github/backport-active/README.md Updates inputs/docs to describe the new plain-text active-branches endpoint.
github/backport-active/backport_script.py Replaces JSON config fetching with plain-text branch list parsing.
github/backport-active/action.yml Updates the default backports-url to the new S3 endpoint.
elastic/active-branches/script.py Switches branch fetching to urllib.request and parses branches from plain text.
elastic/active-branches/action.yml Removes the step that installed requests.

Comment on lines 3 to 6
import json
import os
import requests
import urllib.request

Comment on lines +13 to +17
| Name | Description | Required | Default |
|-----------------|-------------------------------------|----------|-------------------------------------------------------------------------------------|
| `github-token` | GitHub token for authentication | `false` | `${{ github.token }}` |
| `backports-url` | URL to fetch the active branches | `false` | `https://elastic-release-api.s3.us-west-2.amazonaws.com/public/active-branches.txt` |
| `pr-number` | PR number to use (needed for tests) | `false` | `${{ github.event.pull_request.number }}` |
Comment on lines +64 to +67
if target_branches:
print(f"Found branches: {target_branches}")
else:
print("No branches found in config or config not available")
print("No branches found or config not available")
Copilot AI requested review from Copilot and removed request for Copilot May 20, 2026 15:29

Copilot AI commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the CI failed with

...

Fixed in 1edca44; elastic/active-branches now uses urllib for the GitHub branch checks as well, so the workflow no longer depends on requests.

Copilot AI requested review from Copilot and removed request for Copilot May 20, 2026 15:30
Copilot finished work on behalf of v1v May 20, 2026 15:32
Copilot AI requested a review from v1v May 20, 2026 15:32
@v1v
v1v enabled auto-merge May 20, 2026 15:37

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@v1v
v1v added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 14d040a May 22, 2026
33 checks passed
@v1v
v1v deleted the copilot/update-active-branches-endpoint branch May 22, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:enhancement When you enhance an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use https://elastic-release-api.s3.us-west-2.amazonaws.com/public/active-branches.txt

4 participants