CircleCI-Public / orb-tools-orb

Various tools for authoring and publishing CircleCI orbs
https://circleci.com/orbs/registry/orb/circleci/orb-tools
MIT License
51 stars 76 forks source link

Allow to release a development version of an orb with a custom tag #197

Closed steinwelberg closed 1 year ago

steinwelberg commented 1 year ago

Describe Request

In the old orb tools version (10.x), it was possible to create a development release of an orb with a custom version tag, e.g. dev:<branch-name>. This allowed for easy testing of changes in an orb without having to bump the orb version after every commit to an orb, AND to have a master branch which always published the dev:alpha version.

With the current Orb version, this is a bit more troublesome. There are now 2 tags created:

We could use the dev:alpha tag when working on a branch, however it might be overridden by a pipeline run by another branch. And we would also loose the possibility to use the dev:alpha tag to always get the latest (not released) orb version from master.

I see 2 possible solutions to achieve what I would like:

  1. Depending on the branch that the publish job is run from, create a different tag. For master, use dev:<SHA-1>, for other branches, use dev:<branch_name> (taken from the CIRCLE_BRANCH env var. This is however a bit opinionated, and potentially not backwards compatible.
  2. Allow to specify the additional tag. through a new property e.g. pub-dev-tag By default, the dev:<SHA-1> tag could be used, which preserves backwards compatibility. With the new property, a custom tag can then be specified for versions published from a branch.

Supporting Documentation Links

The documentation still refers to branch versions for a development orb: https://circleci.com/docs/orb-concepts/#development-orbs

KyleTryon commented 1 year ago

Just to be sure, is the goal to test the orb in other existing repositories? In Orb tools 12 we are aiming to do away with the need for publishing development orbs at all, to make testing easier for open-source contributions. Publishing to a tag would still be possible but removing publishing means we do not need an API token for the building portion of the orb, meaning we could run forked PRs and allow the tests to fully run as they are no longer blocked by this access.

https://github.com/CircleCI-Public/orb-tools-orb/pull/181

KyleTryon commented 1 year ago

Multi-tag support confirmed added to #181

steinwelberg commented 1 year ago

Thanks a bunch! 🙏