Code Monkey home page Code Monkey logo

Comments (4)

edbzn avatar edbzn commented on August 22, 2024

We should also add the tag prefix <project>-latest for independent versions to avoid conflicts.

from semver.

yjaaidi avatar yjaaidi commented on August 22, 2024

The more I think about this, the more I wonder if it's up to the builder to tag.
There is a real challenge with independent mode. If we use a different tag for each project then we won't be able to use nx affected and we'll have to build our own mechanism to check which projects should be bumped.

If we use nx affected then we can tag latest but if we run version manually then we shouldn't tag latest.

I can see two different approaches:

  1. Let the CI handle the tagging. This is more flexible as users can run version then ngx-deploy-npm then anything and finally tag latest but it's less convenient and out of the box.
  2. nx run workspace:version should run nx affected --target version --base latest

from semver.

edbzn avatar edbzn commented on August 22, 2024

One other approach would be to simply avoid the latest tag with independent mode, it does not have a meaning to have one single tag for many packages at the same time.

Regarding the nx affected command, we can simply replace the need of the latest tag using GitHub refs.

nx affected:build --base=origin/master --head=${{ github.event.pull_request.head.ref }}

or

nx affected:build --base=origin/master --head=${{ github.event.push.head.ref }}

Do we bring this feature for the synced mode at least? This discussion raise doubts about the whole thing.

from semver.

yjaaidi avatar yjaaidi commented on August 22, 2024

I think that we have to find a solution that solves the following issues:

1. The nx affected base

The problem with the origin/master approach is failing builds.
Suppose one or more builds fail (e.g. libs a, b, c should bump but as something goes wrong with a, they don't), then we fix that in one commit that only affects one of them (e.g. lib a) then some libs won't be bumped (e.g. b & c) while they should.

We need a latest tag that marks the last time that we were able to bump & deploy all apps and libs... or any other generic solution but I can't think of anything easier and as robust as a tag.

2. Publishable packages

We have to publish all packages before tagging & pushing the latest tag.

3. Deployable apps

We have to deploy apps before tagging & pushing the latest tag.
As apps deployment is out of our scope, we have to separate the version & tag-latest steps.


I think that the CI workflow should look something like:

nx affected --base refs/tags/latest version
nx affected --base refs/tags/latest deploy
nx run workspace:tag-latest

... or maybe, we should forget about tags, make version idempotent and run it on all projects:

nx run-many --all --target version
nx affected --base refs/tags/latest deploy

It feels wrong to run version on all projects all the time instead of enjoying the benefits of nx affected but at least we don't pollute git with additional tags. What do you think @edbzn? I'll rename the issue to be less influencing.

from semver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.