Closed manics closed 2 years ago
:+1: for the helpful messages.
Adding a few notes about my investigation of using this branch for private repository releases. Individual releases can be accessed by setting a valid GitHub OAuth token in the request header as per:
diff --git a/omego/fileutils.py b/omego/fileutils.py
index fb02653..f794dc8 100644
--- a/omego/fileutils.py
+++ b/omego/fileutils.py
@@ -96,6 +96,11 @@ def open_url(url, httpuser=None, httppassword=None, method=None):
# Override method http://stackoverflow.com/a/4421485
req = urllib.request.Request(url)
+ if 'GITHUB_TOKEN' in os.environ:
+ req.add_header(
+ 'Authorization', 'token %s' % os.environ.get('GITHUB_TOKEN'))
+ log.debug('Setting authorization')
+
if method:
req.get_method = lambda: method
With this change GithubArtifacts.read_downloads
will list all release assets as expected.
However during the download, I was unable to consume browser_download_url
even when also setting the Accept
request header as per https://developer.github.com/v3/repos/releases/#get-a-single-release-asset. Likely the code might need to be adapted to consume the release asset endpoint instead. However, this might requires a larger refactoring of this code as the component name cannot be simply extracted from the asset URL.
I think I've fixed Travis which looks like it was broken for a while. The remaining failing tests should be the ones that download from openmicroscopy.org
A few thoughts:
Support downloading from GitHub releases. Currently limited to:
latest
isn't supported, nor are partial tag prefixes such as5.5
).zip
(matches the current behaviour ofomego download
, but e.g. this means you won't see the Insight.dmg)E.g.: