Skip to content

fix: handle tags containing / in GitHub release asset URL resolution - #3767

Merged
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/github-http-tag-extraction
Jul 28, 2026
Merged

fix: handle tags containing / in GitHub release asset URL resolution#3767
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/github-http-tag-extraction

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

The tag extraction in resolve_github_release_asset_api_url split the URL path on / and assumed the tag was a single path segment at index 4. Tags containing literal / (e.g. feature/v1) would be split across multiple segments, causing the tag to be truncated.

Example

For URL https://github.com/owner/repo/releases/download/feature/v1.0.0/asset.zip

  • Before: tag = "feature", asset_name = "v1.0.0/asset.zip" (wrong)
  • After: tag = "feature/v1.0.0", asset_name = "asset.zip" (correct)

Changes

  • src/specify_cli/_github_http.py (line 162): Changed from fixed index extraction to reconstructing tag as all segments between download and the final asset segment.

Testing

All 30 tests in test_github_http.py pass.

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

Fixes release asset resolution for GitHub tags containing literal /.

Changes:

  • Reconstructs the tag from all path segments before the asset filename.
  • Treats the final segment as the asset name.
Show a summary per file
File Description
src/specify_cli/_github_http.py Corrects tag and asset extraction from release URLs.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/specify_cli/_github_http.py

@mnriem mnriem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please address Copilot feedback

The tag extraction in resolve_github_release_asset_api_url split the
URL path on / and assumed the tag was a single segment at index 4.
Tags containing literal / (e.g. feature/v1) would be split across
multiple segments, causing the tag to be truncated to only the first
part and the asset name to include leftover tag segments.

Fix by reconstructing the tag as all segments between 'download' and
the final asset segment: tag = '/'.join(parts[4:-1]), asset = parts[-1].

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.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

@mnriem
mnriem self-requested a review July 28, 2026 20:45
@mnriem
mnriem merged commit 56b1839 into github:main Jul 28, 2026
14 checks passed
@mnriem

mnriem commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants