-
Notifications
You must be signed in to change notification settings - Fork 121
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
Proposal: Redesign tagging input/outputs to be independent #30
Comments
@crazy-max what are your thoughts on this? |
@LongLiveCHIEF Sorry for the delay! I like the idea of conditional assignment. I will make a quick review of the current implementation and see if this can fit this project. Keep you in touch. |
Any progress on this? I'm interested in prefix/suffixes as this is would make it possible to use multiple Dockerfiles in one project. |
@mblaschke this is fully implemented in https://github.com/marketplace/actions/tagging-strategy, and you could always use that in the meantime until @crazy-max makes a final decision. It doesn't do label generation, so you'd still need this action if you want labels. If you want to see some examples of a robust implementation, check out https://github.com/OctoPrint/octoprint-docker/blob/master/.github/workflows/octoprint-release.yml#L160-L174 ... there are several examples of all the features in the github.com/OctoPrint/octoprint-docker github actions. Edit, the tag name passed into it comes from an event payload from the OctoPrint/Octoprint workflow: https://github.com/OctoPrint/OctoPrint/blob/master/.github/workflows/trigger_docker.yml |
@LongLiveCHIEF I have started to work on this yesterday. Here is a draft of what I plan to put in place for a v2: New:
Kept:
Removed:
Migration
|
I also thought about removing the tags: |
type=image,username/app,ghcr.io/user-name/app As everything would be now in the |
You've given this a lot of thought. I like how you took what had done and have made it even more powerful (which is what I was hoping for!) What I can't tell is where the tag itself fits into the |
To make sure I'm reading your implementation details correctly, i took my original example, and re-did it using your proposed implementation. Let me know if it looks right? tags: |
type=tag,latest=true,enable=${{ steps.stable-octoprint.outputs.release == github.event.client_payload.tag_name }}
type=tag,enable=${{steps.buildxy.outputs.buildxy}},pattern={{major}}
type=tag,enable=${{steps.buildxy.outputs.buildxy}},pattern={{major}}.{{minor}}
type=tag,pattern={{version}}
type=tag,enable=${{ github.event.action == 'prereleased' || github.event.client_payload.tag_name == steps.latest-octoprint.outputs.release }},edge
type=tag,enable=${{ github.event.action == 'canary' }},canary
type=tag,enable=${{ github.event.action == 'canary' }},bleeding |
I really, really like this, assuming I'm reading it correctly. Let me know how I can help. |
One thing I'm not sure I've seen yet, is this requirement:
In my action, i have a |
or maybe: New Feature: Manual/Externally controlled version tagstags: |
type=external,tag=${{ github.event.client_payload.tag_name}} Defaults:
Optional Keys
|
Actually, I propose we get rid of DescriptionI think the thing that's missing is that the basic implication of this action is that the Dockerfile is building the project from within that project. This works well if you're building the official image of a project. Say my project is However, the other major use case that this action has been unable to be used for is when a community wants to build their own version of an image. For example, let's say my organization is called However, I think supporting this ability would actually make things easier for the maintainers and users of this action. ProposalHere are the
What I'm thinking, is that the default behavior for each list item is what you are currently envisioning for for tags: |
tag=$(date + '%Y-%m-%d') (This uses the core for for Complete ExampleThe example below is each type of tag, but eliminates steps:
- id: match
// some step (action or run command) that parses some input against desired regex and outputs desired tag to use
- id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
tags: |
pattern={{version}} #outputs foo/foo:X.Y.Z
tag=${{ steps.date.outputs.date }},prefix=foo- #outputs foo/foo:foo-YYY-mm-dd
tag=edge,enable=${{ some.user.specified.condition == conditions.for.edge }} #will create foo/foo:edge if conditions match
tag=${{steps.match.outputs.tag}} #will create foo/foo:<whatever steps.match.outputs.tag resolves to>
tag=${{ github.sha }} #will create foo/foo:<sha-hash-of-commit-that-triggered-workflow>
tag=<input from arbitrary payload>,pattern={{major}},prefix=foo #will create whatever arbitrary input your expression resolves to and treat it as a semver tag due to non-null value of `pattern`, with result being foo/foo:foo-<major> |
@LongLiveCHIEF Ok I changed things a bit. I have opened a PR #50 still WIP where we can continue to discuss it. |
I still use this action for labeling features, but if you're open to it, I'd really like you to consider importing my actions tag handling capabilities due to their power, simplicity, and flexibility.
To give you an example, here's a snippet from a repo where I'm using the latest functionality I've implemented, snippet pulled from https://github.com/OctoPrint/octoprint-docker/blob/master/.github/workflows/octoprint-release.yml#L69-L87:
This one snippet demonstrates the how i think the approach to tagging should work in ghaction-dockermeta:
extra_tags
extra_tags
parameter in a similar way to your{{raw}}
usageBonus
As far as I can tell, refactoring tag inputs to work as they do in HackerHappyHour/tagging-strategy@v3+ would close the following open issues as well:
tags
orextra_tags
of HackerHappyHour/tagging-strategy accomplishes this)I doubt my action will ever get any users (even though I obviously have a super high opinion of it 😏 ), but you've got the benefit of having been in the docker action space since actions launched, and the have visibility and reach. I'd love for the work I did to benefit your users and carry over here.
Would you be willing to consider a redesign to bring support for this usage technique? I'd really love to be able to archive my project and merge it with yours!
The text was updated successfully, but these errors were encountered: