question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: Redesign tagging input/outputs to be independent

See original GitHub issue

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:

      -
        id: buildxy
        run: echo '::set-output name=buildxy::${{ (github.event.action == 'deploy'|| github.event.action == 'released') && github.event.client_payload.tag_name == steps.stable-octoprint.outputs.release }}'
      -
        name: Tagging Strategy
        id: tagging
        uses: HackerHappyHour/tagging-strategy@v3
        with:
          image_name: octoprint/octoprint
          tag_name: ${{ github.event.client_payload.tag_name }}
          tags: |
            %X%::${{ steps.buildxy.outputs.buildxy }}
            %X.Y%::${{ steps.buildxy.outputs.buildxy }}
            %X.Y.Z%
          extra_tags: |
            latest::${{ steps.stable-octoprint.outputs.release == github.event.client_payload.tag_name }}
            edge::${{ github.event.action == 'prereleased' || github.event.client_payload.tag_name == steps.latest-octoprint.outputs.release }}
            canary::${{ github.event.action == 'canary' }}
            bleeding::${{ github.event.action == 'bleeding' }}

This one snippet demonstrates the how i think the approach to tagging should work in ghaction-dockermeta:

  • explicit control over the conditions of each and every tag,
  • semver parsing
  • no interdependent input parameters,
  • output compatible with docker/build-push-action
  • supports tag suffixes #15
  • supports additional non-semver custom tags #24 via extra_tags
  • compatible with externally triggered events
  • sha tags (via extra_tags parameter in a similar way to your {{raw}} usage

Bonus

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:

  • #29 (since the base tag input isn’t resolved by the action but passed in by the user, the user can pass in whatever they want)
  • #27 (simply changing the order in the tags or extra_tags of HackerHappyHour/tagging-strategy accomplishes this)
  • #25 (you can see in the example above how HackerHappyHour/tagging-strategy already does this)
  • #13 (HackerHappyHour/tagging-strategy already supports this, examples here, here and in the testing fixtures)

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!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
crazy-maxcommented, Mar 20, 2021

@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:

  • tags
  • labels

Kept:

  • images
  • sep-tags
  • sep-labels

Removed:

  • tag-sha
  • tag-edge
  • tag-edge-branch
  • tag-semver
  • tag-match
  • tag-match-group
  • tag-latest
  • tag-schedule
  • tag-custom
  • tag-custom-only
  • label-custom

Migration

tag-sha

tags: |
  type=sha,enable=true,latest=false,prefix=sha-,suffix=

Defaults:

  • enable=false
  • latest=false
  • prefix=sha-
  • suffix=

tag-edge / tag-edge-branch

tags: |
  type=edge,enable=true,latest=false,branch=${default_branch}

Defaults:

  • enable=false
  • latest=false
  • branch=${default_branch}

tag-semver

tags: |
  type=semver,enable=true,latest=true,pattern=,prefix=,suffix=

Defaults:

  • enable=true
  • latest=true
  • pattern=
  • prefix=
  • suffix=

tag-match / tag-match-group

tags: |
  type=match,enable=true,latest=true,group=,prefix=,suffix=

Defaults:

  • enable=false
  • latest=true
  • group=
  • prefix=
  • suffix=

tag-latest

Will be available for all types through latest=true|false keypair.

tag-schedule

tags: |
  type=schedule,enable=true,latest=false,pattern=,prefix=,suffix=

Defaults:

  • enable=false
  • latest=false
  • pattern=
  • prefix=
  • suffix=

tag-custom / tag-custom-only

tags: |
  type=tag,enable=true,latest=false,acustomtag
# or
tags: |
  acustomtag

Defaults:

  • enable=false
  • latest=false

labels

labels: |
  maintainer=CrazyMax

Flavor

We could also add a new flavors input to handle suffix/prefix/… for all tags:

Prefix and suffix all tags

flavors: |
  type=prefix,foo-
  type=suffix,-bar

Prefix and suffix a specific tag

tags: |
  type=sha,enable=true,latest=false,prefix=foo-,suffix=-bar

Optional keys

enable, latest, prefix, suffix inputs are optional.

0reactions
crazy-maxcommented, Mar 25, 2021

@LongLiveCHIEF Ok I changed things a bit. I have opened a PR #50 still WIP where we can continue to discuss it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select/Change order of tags. · Issue #27 · docker/metadata-action ...
If you have latest and/or sha tagging enabled, then they get pushed to the registry last. ... Proposal: Redesign tagging input/outputs to be...
Read more >
ACL's Logic Model Guidance
Your INTENDED RESULTS include all of the program's desired results (outputs, outcomes, and ultimate outcome). Inputs (i.e., resources) include human, financial,.
Read more >
What is Lean Six Sigma - GoSkills
What is Lean Six Sigma? A guide to the principles, tools, and benefits of this powerful methodology to improve your business processes and...
Read more >
Micro Frontends - Martin Fowler
"An architectural style where independently deliverable frontend applications are composed into a greater whole".
Read more >
All You Need To Know About Procurement - The Beroe Guide
Procurement is the process of purchasing goods or services in reference to business spending. Check out our complete guide on procurement, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found