-
Notifications
You must be signed in to change notification settings - Fork 3
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
Understand best practices for collaborative development workflows #41
Comments
Tagging @bquan0 to investigate this further |
From what I can tell so far, it's not possible to push a package from a forked repo to the upstream repo's package space. In this workflow run, I changed the repository space that the multistage action pushes to from I also looked in package settings, but there doesn't seem to be an option to allow permissions for forked repos. |
Thanks for bringing up these questions! The initial design was based around a centralized image repository for all contributors - I've used both Github's GHCR as well as Google's GCR in this sort of workflow. Authentication to the repository is consequently specific to the container registry - Github does some automatically to their own system, but GCR and others require additional steps/actions in order to authenticate. I think some of this will depend on your development model as well - if all contributors are working on their own forks (more common with OSS/public repos), you'll probably end with different strategies than if they're all direct contributors to your repository (more common for private repos). Notably, the availability of GHA secrets for fork-based workflows is pretty restricted, since you likely wouldn't want someone forking your repo to be able to extract those secrets. This probably doesn't answer any of your questions yet, but I'm hoping we can discuss further to suss out some of the edge cases and hopefully find a path forward! Are you able to share more details about your workflow specifics? |
I'm digging into this a little more in this PR in our repo. Our development model does have contributors working in their own forks and then issuing PR's from those forks. In that model, we have choices about when the action runs and under what terms. This allows workarounds for seeing whether builds are successful, but maybe not the ideal behavior. If I set the repo to use
If I set the repo to use
I am not sure if this latter error is a GH/GHCR configuration problem, or expected behavior - the internet seems to offer conflicting opinions...?? One idea: a version of this that has a variable to toggle whether it pushes or not? In my use case, I might set it to push images when run as |
While we are at it... it might also be useful to have a variable to specify the a tag name. |
I did some research (ie. systematically tried a lot of combinations) today and learned that it is outside of normal practice to allow workflows initiated by public forked repositories to write packages. In summary, GH strongly encourages the use of the This means that it will not be practical to use the multistage-docker-build-action to manage routine CI for pull requests, as far as I can tell. |
We have started using the
multistage-docker-build-action
for some collaborative development projects. We'd like to use it for PR testing as part of our continuous integration strategy. We have a validDockerfile
with about 6 stages including two final stages related to building and then testing the software in question. (Prior stages are for installing dependencies and since some are long we want multiple stages for ultimate efficiency in building.)Historically, we have had one workflow that uses this
Dockerfile
to build images with the dependencies, and then test that this images is suitable for building/testing a known-to-work version of the software. These images then become the basis for PR-based testing of modifications to the software itself. This strategy was based on the challenges in setting up the GH action environment in all the ways that this action resolves! 🎉It now seems attractive for every PR to be tested with the same
Dockerfile
used to build the full stack because we can rely on pulling earlier stages from the GH container repo (GHCR) and having them in the cache to accelerate the build process for all the dependences prior to testing the build of the software.This does raise some questions, however:
Normally, the tests will be run as the PR author. This may require that the images being pushed to GHCR mush be pushed to that author's/user's GHCR package space.
This action retrieves images from GHCR to a local cache to accelerate docker builds.
With answers to these, and perhaps related questions, we can update documentation to identify best practice (or any practice) for using this action for collaborative development projects.
The text was updated successfully, but these errors were encountered: