Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support downloads from other workflows #517

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

owenfarrell
Copy link

Fixes #501

@owenfarrell owenfarrell changed the title Added support for downloads from other workflows Support downloads from other workflows Jul 15, 2020
@owenfarrell owenfarrell force-pushed the issue-501 branch 3 times, most recently from 120ae0f to 32ebaaf Compare July 16, 2020 15:59
@owenfarrell
Copy link
Author

I've started putting together a unit test to validate these changes, but I'm running in to a bit of a hurdle with mocking Octokit. Before I get too far down that rabbit hole, I would love some feedback on the overall direction of these changes.

Thanks!
~Owen

@konradpabjan
Copy link
Contributor

konradpabjan commented Jul 30, 2020

Hi @owenfarrell

Thanks for opening this PR! Sharing some information as I'm not entirely sure yet if we want to go down this approach as there have been some recent discussions going on internally.

Better continuous deployment is huge ask that we're starting to pick up work in the area. Artifacts is a big piece of the puzzle and the ability to easily download from other workflows is paramount.

The API you see documented here https://developer.github.com/v3/actions/artifacts/#download-an-artifact is basically an external API. You can use it to download artifacts from any workflow, however it's fairly limited as you can only get a zip. Networking resiliency is a big issue so we need the ability to retry downloads without starting the whole thing over.

The current APIs used in @actions/artifact are special internal APIs that can download files individually from an artifact with retries and everything however they are scoped only to a single workflow run.

There has been some internal discussions about possibly expanding the scope of the internal APIs to allow artifacts from other workflows and runs to be downloaded using the same api token (this is tricky as there are a lot of security implications). There are also considerations to expand the APIs available here: https://developer.github.com/v3/actions/artifacts/ but that poses it's own challenges.

Internally we're still coming up with a plan as there are a lot of architectural & engineering considerations that we have to take into account.

I wanted to offer at least some feedback and transparency regarding the direction of your PR. If there are any new developments I'll make sure to communicate them 😃

@owenfarrell
Copy link
Author

Hi @konradpabjan,

tl;dr I truly appreciate the acknowledgment and response. And I recognize that this isn't a straightforward problem to solve given the blend of internally-, privately-, and publicly-available assets.

Better continuous deployment is huge ask that we're starting to pick up work in the area. Artifacts is a big piece of the puzzle and the ability to easily download from other workflows is paramount.

Your comment here hints at the concept, but I want to call this out explicitly - this isn't just a continuous deployment problem. Continuous deployment is certainly part of it, but the principle of building once applies to lots of aspects across the entire SDLC (e.g. analysis, integration, testing). And users' desire to adhere to that "build once" principle is demonstrated by the fact that this was the very first issue raised against the download-artifact action.

However, I think there is a willingness to take on a truly minimum viable product (or something "fairly limited" as you put it) since users are leveraging workarounds that use the public, external API already. I don't say that in an attempt to endorse my own PR, but rather to highlight the continued cost of delay. Without a de facto standard, we're going to continue to rely on workarounds... and those workarounds aren't going to adhere to the non-functional requirements you've identified (e.g. security concerns like leaking private artifacts).

I'm looking forward to seeing what you and your team come up with in order to help close that gap. Please let me know if I can provide any support.

Cheers,
~Owen

@jimis
Copy link

jimis commented Sep 16, 2020

There has been some internal discussions about possibly expanding the scope of the internal APIs to allow artifacts from other workflows and runs to be downloaded using the same api token (this is tricky as there are a lot of security implications).

+1 on this one, is there a ticket I can follow?

The API you see documented here https://developer.github.com/v3/actions/artifacts/#download-an-artifact is basically an external API. You can use it to download artifacts from any workflow, however it's fairly limited as you can only get a zip.

@konradpabjan Indeed this is restrictive. In my case I have already compressed (tar+zstd) my artifact into one file. The API gives me the choice of downloading it, but with limitations:

  • the response time is slow for big artifacts - is it zipping on the fly?
  • I now need double decompression of my artifacts, and zip is far slower than zstd
  • the extra zip is not needed for single-file artifacts.

I appreciate the team's work, please do let us know of updates as workarounds are getting finicky.

EDIT: I just notice this is a very specific pull request (that is definitely interesting as the start of solving the issues described). I don't want to distract the conversation, if there are github issues tracking the progress I would be happy to comment there, otherwise I'll open new ones, I guess under the upload-artifact project.

aochmann added a commit to thecogworks/Cogworks.Essentials that referenced this pull request Mar 1, 2021
Issue with downloading artifact from another workflow. More info: actions/toolkit#517
@thboop thboop changed the base branch from master to main May 27, 2021 15:13
@thboop thboop requested a review from a team May 27, 2021 15:13
@ghost
Copy link

ghost commented Jul 9, 2021

Created owenfarrell#2 to update this PR's branch with the latest code from main

Signed-off-by: Owen Farrell <owen.farrell@gmail.com>
@owenfarrell
Copy link
Author

@vaughan-clare In order to keep the commit log clean(er), I rebased over the top of main. Thanks for the nudge!

@kbutto
Copy link

kbutto commented Jan 6, 2022

any updates on the support for this?

Copy link

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download from a different workflow
7 participants