Skip to content

[Feature] Canary should have incrementing version numbers. #277

Closed
JetBrains/ring-ui
#355

Description

@cpojer

The canary feature is fantastic, however because it uses commit hashes instead of numbers, publishing a canary release with the same basic version number might require the wrong versions when using ^ for all the other package dependencies. Can we either overwrite the dependencies to require explicit canary versions OR properly version canaries so that newer canaries will always be installed over older ones? :)

Activity

  1. hzoo commented on Jul 13, 2016

    @hzoo
    Contributor

    Ah good point.. didn't really think of that at the time..

  2. cpojer commented on Jul 13, 2016

    @cpojer
    ContributorAuthor

    Canary is super useful btw.

    Also, it would be nice if I could select the next version. Right now it uses lerna.json which is the current version but I'd prefer to publish a canary for the next minor or patch release most of the time, so I have to manually edit lerna.json.

  3. jamiebuilds commented on Jul 13, 2016

    @jamiebuilds
    Contributor

    Can we just follow the normal prompting for versions flow for canary?

  4. marcins commented on Oct 5, 2016

    @marcins

    I just ran into this issue, where the "latest" version of a dep was chosen over the canary because the canary version was based on the last released version number not the "next" one.

    If you're automatically building a canary from CI you don't want the prompting flow, so as long as there's still a way to publish a canary with the "next" version number without interactivity then that'd work for my use case.

  5. tdreyno commented on Nov 4, 2016

    @tdreyno

    Bumping this again. This is so broken it hurts.

  6. changed the title [-]Canary should have incrementing version numbers.[/-] [+][Feature] Canary should have incrementing version numbers.[/+] on Nov 16, 2016
  7. Guria commented on Nov 28, 2016

    @Guria

    We should either use incrementing part in canary version before hash, or substitute exact version for controlled packages without caret in front.
    Now our canary builds are definetely broken, because users will get wrong dependencies versions :(

  8. L8D commented on Dec 2, 2016

    @L8D
    Contributor

    Can we please at least add a flag for using exact versions in published packages? It would even be useful for non-canary releases.

  9. KyleAMathews commented on Jan 22, 2017

    @KyleAMathews

    Is there anything holding up a PR fixing these issues? I haven't looked at the Lerna codebase much but would be happy to make a PR a) supporting incrementing number releases and b) add support for specifying a next version.

    I'm using Lerna + canary releases to great effect with Gatsby and am planning on automating canary releases on build passes (anyone doing this btw?) and these two changes would make that much nicer.

  10. evocateur commented on Feb 10, 2017

    @evocateur
    Member

    @tdreyno I'd say #426 covers your hacked-in change, since beta 33.

  11. tdreyno commented on Feb 14, 2017

    @tdreyno

    Thanks @evocateur, I'll try it out!

  12. self-assigned this
    on Mar 17, 2017
  13. ivosabev commented on Apr 12, 2017

    @ivosabev

    Same problem with 2.0.0-rc.0

  14. 2 remaining items

  15. KyleAMathews commented on May 18, 2017

    @KyleAMathews

    For Gatsby I've been telling testers to just use "canary" for their package version.

  16. gaearon commented on May 18, 2017

    @gaearon

    That doesn’t solve the issue with monorepos since two canaries that depend on each other without exact flag will break as soon as the next hash is higher on alphabetic order.

  17. KyleAMathews commented on May 18, 2017

    @KyleAMathews
  18. evocateur commented on May 18, 2017

    @evocateur
    Member

    I was hoping to get around to proper incrementing with better git describe metadata, but implicit --exact sounds like a decent workaround for the time being.

  19. shawnbot commented on Jul 11, 2017

    @shawnbot
    Contributor

    Somewhat related, as reported in #915: --canary and --cd-version don't interact the way I expected them to. I think that if --canary --cd-version=patch didn't drop the meta suffix (-alpha.x) it might help with this issue.

  20. alan-agius4 commented on Jan 18, 2018

    @alan-agius4
    Contributor

    @evocateur I don't know the whole flow around the --canary and why it uses the commit hash but wouldn't it make sense in order to avoid such issue to use Date.now() instead? as a version. it's always incremental and could avoid collision issues.

  21. evocateur commented on Jan 18, 2018

    @evocateur
    Member

    @alan-agius4 Date.now() gives no authoritative information on the state of the tree when the publish was made. The hash is really intended as build metadata (and thus should be after the prerelease id and other dot-separated stuff, e.g. 1.0.4-alpha.0+deadbeef).

    However, until we restore the gitHead property that normally appears in the package tarball's package.json after a "normal" npm publish, we need to keep it there to provide a breadcrumb back to the exact state that the canary version was published from. (gitHead is missing because .git isn't in process.cwd() when we run npm publish from lerna)

  22. added this to the v3.0.0 milestone on Jan 18, 2018
  23. pleunv commented on Feb 27, 2018

    @pleunv

    I'm very interested in getting this to work as currently our desired CI release flow cannot be covered with lerna. However, after playing around a bit I noticed that both 1.0.4-alpha.0+deadbeef and 1.0.4-alpha.0+sha.deadbeef are currently not accepted by the yarn registry.

    Command failed: yarn publish --new-version 2.0.1-build.1519722155+61bd02c2 --tag test
    warning package.json: No license field
    warning package.json: No license field
    error An unexpected error occurred: "https://registry.yarnpkg.com/@company%2fapp-2: New versions must be valid semver.".
    

    According to https://semver.org/#spec-item-10 they definitely are valid semver versions.

    npm publish will go ahead and succeed, but will strip all additional meta (everything behind the +) from the published package's version.

  24. evocateur commented on Feb 27, 2018

    @evocateur
    Member
  25. added a commit that references this issue on Jul 27, 2018
    8b97394
  26. added a commit that references this issue on Dec 18, 2018
    79dd10f
  27. lock commented on Dec 27, 2018

    @lock

    This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  28. locked as resolved and limited conversation to collaborators on Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions