microsoft / microsoft/azure-devops-python-api

get_artifact_content_zip() does not follow redirect from 302

Offen
#332 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
684
Forks
218
Ø Merge
8 T. 10 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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?)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne beim Einstiegspunkt get_artifact_content_zip() und verfolge, wie seine Anfrage die 302-Antwort von Azure DevOps verarbeitet. Stelle den Download-Fall eines kleinen Artefakts nach und überprüfe anschließend, dass eine umgeleitete Artefakt-URL den zip-Inhalt statt eines 404 zurückgibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.