microsoft / microsoft/azure-devops-python-api

get_artifact_content_zip() does not follow redirect from 302

Open
#332 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
684
Forks
218
Avg merge
8d 10h
Merged PRs (30d)
1

Description

Appears that ADO puts small pipeline artifacts elsewhere and uses a 302 to redirect.

My code downloading artifacts from multiple builds works fine for the big artifacts but gets a 404 for the little ones. My suspicion (haven't traced through this one completely) is that the underlying API (from msrest?) is putting in the 404. Looking at the traffic in Fiddler I see that ADO is actually issuing a 302

HTTP/1.1 302 Found
Cache-Control: no-cache
Pragma: no-cache
Expires: -1
Location: https://artprodwus21.artifacts.visualstudio.com/*redacted*/_apis/artifact/*redacted*/content?format=zip
[---
    rest of the stuff removed as I don't think it's of interest and 
    I'm not certain what/if should be removed before posting
---]

The link provided for the redirect works fine.

Looked through the azure-devops code to see if there was a flag to set to have it follow the redirect but didn't see it (in the base class (super in Python?) maybe?)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the get_artifact_content_zip() entry point and trace how its request handles the 302 response from Azure DevOps. Reproduce the small-artifact download case, then verify that a redirected artifact URL returns the zip content instead of a 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.