Giter VIP home page Giter VIP logo

Comments (1)

jasonkuhrt avatar jasonkuhrt commented on May 27, 2024

Investigated the issue tonight.

The problem is with our use of git tag. It is returning tags in lexical order. We want semver order. This is somewhat possible it turns out:

example git repo on my machine

❯ git tag --sort -version:refname --list 'v*.*.*' '*.*.*' '*.*.*-next.*'
2.0.0
1.2.0
1.0.1-next.1
1.0.1
1.0.0

The problems:

  • still loading all tags in repo
  • mixing v prefix style would break ordering, problem for a project that ever migrates between styles
  • pre-releases are not handled correctly (they appear as being newer)

Solution is to work based off of git log. Benefits are:

  • doing this in a streaming manner permits working backwards from head to get the current release series. While the scale of a project is unbounded the scale of a release is in practice a lot less so. E.g. weekly releases. Even 6 months of work isn't so bad compared to e.g. 10 year old project.
  • tag ordering is logically tied to commit ordering, no surprise for the user, what they would expect
  • v prefix style changes in project no problem
  • handle pre-releases correctly by virtue of commit ordering being what matters now.

example script on my machine

async function main() {
  for await (const log of CP.spawn('git', [
    'log',
    '--format=%H ___ %D ___ %B |||',
    '--no-merges',
  ]).stdout) {
    process.stdout.write('==>  ' + log)
  }
}

main()
❯ yarn -s ts-node src/stream-log
==>  db89270e10f22ec73f14072814f7ca381d22c1c1 ___ HEAD -> master, tag: next, tag: 0.2.8-next.1, origin/master, origin/HEAD ___ refactor: remove semver dep (#17)

 |||
==>  6e649f7fc8026f914a90e2b5998ccbd952fe4de8 ___  ___ refactor: release series concept (#16)

 |||
078efa624dc425d569a2d0c577e43599a522a03c ___  ___ chore: fix tests
 |||
7b727eb438b2b895b1950f0a36470fa25e6ffee8 ___ origin/feat/foo-37571159528463616 ___ tests: cover bump func
 |||
370e75ce279eb4ff4130072ef0d51e1eb92903e0 ___  ___ begin unit tests
 |||
916ff2a939cc8bc6264a3b4658bfdb85b703e044 ___  ___ chore: ignore vscode file
 |||
02089fae1f895bad560767f9621c339d462ee0ba ___ tag: latest, tag: 0.2.8 ___ fix: find latest stable releases
 |||
29e76b7259fb663d048ea22a6155494ccdf6b116 ___ tag: 0.2.0 ___ fix: proper application of bump type
 |||
9fef5b2518abc0873d1d467668dab6cf6c61d4ce ___ tag: 0.2.7 ___ feat: rename project to dripip
 |||
5a76f626973d3c8a088520a88c851759cb183dfc ___ tag: 0.1.7 ___ fix: fake work to try publish
 |||
e34502da1c61ef6e41fb1b8bedc51f4568ab7cfc ___ tag: 0.1.6 ___ fix: publish stable with git tags set
 |||
81e2109beed167ac54061fe390f0c480e1d8e85c ___ tag: 0.1.5 ___ fix: cleanly update remote tag updates when publishing
 |||
455bc82b8be2ed2e31d9877b93999fd5085618d0 ___ tag: 0.1.4 ___ fix: await promises while publishing stable
 |||
98563556f59908d1e7003c113893bce3d4036808 ___ tag: 0.1.3 ___ fix: no race on dist-tag add on stable release
 |||
013a28d0b4fd885a80a58664c7c6609e1ffc5621 ___ tag: 0.1.2 ___ fix: dist-tag invocation on stable release again
 |||
da8cac832e5d68d560d0cca531589b2371c6a29e ___ tag: 0.1.1 ___ fix: dist-tag invocation on stable release
 |||
5dd4866768a3190112527a6b5272cbf9d5a9f17c ___ tag: 0.1.0 ___ chore: fix build script
 |||
69dd5ce8198d911b6b756b5eb3378891470d9eb9 ___  ___ chore: build using tsc
 |||
1aecc2078ef985d90407438d51487a177597eac9 ___  ___ deps: update all to latest
 |||
77f24b59d73391ae6fb6e4f5e6061ff980d9e4a0 ___  ___ feat: stable release command (#12)

 |||
740a43f2b10d20498bbba750263e64fe64a09dec ___  ___ chore: remove unused identifier
 |||
02df0937ab4a1a5bd8f5f7f3fbb0951c0097cbf1 ___ tag: 0.1.0-next.4 ___ fix: force push next tag
 |||
f5e284615f5438855d62a2a91de69ef9ebf01f23 ___ tag: 0.1.0-next.3 ___ fix: return after stable publishing
 |||
14ee78409503aa6b86a76f0c3afc668af65d3caf ___ tag: 0.1.0-next.2 ___ fix: await package.json read
 |||
42310bce0a11c774afacc4ce20ce1e89892d1d4c ___ tag: 0.1.0-next.1 ___ feat: publish stable preview
 |||
0830d209c972a2af972562dea1c04493c3a5a84e ___  ___ feat: opt-in output json (#10)

 |||
5af4544054b145a07aa33d92d4ce4b8615c0c6fb ___  ___ feat: calculate next preview ver (#9)

 |||
d181c7005ab958b6998215f27920851a7a4f458f ___  ___ feat: guard no preview on not pr or trunk
 |||
1d1bd5a6a297dbfe703628cda081f44889b8a0fb ___  ___ feat: detect if current branch is a pr (#7)

 |||
a04b3533fec4d97b884ec94940296126e2fbad93 ___  ___ feat: better feedback on failed preview pre-flight
 |||
1a3a18f69b8756bbb8aeaa30c17170d823185d11 ___  ___ deps: update all to latest
 |||
b77dc0554c4e0bbd424fb60e24536b2df6e42432 ___  ___ refactor: higher level tests helper
 |||
7b206e765f1f5915ce18560752ffc6d22b3cb672 ___  ___ refactor(tests): helpers into lib
 |||
634e276d45d1e9bef121a7251f8a1b6da0be9fe5 ___  ___ refactor: co-locate export
 |||
188566fd9cab628fa92b95b2584826c616bd3369 ___  ___ tests: refactor with new workspace module
 |||
b1f26c7b9a90c66762e555aac647faffa4edd2a6 ___  ___ feat(preview): preflight assert not already released (#4)

 |||
b99354d4bcd21498f9bbe9da0641ad1981ecc721 ___  ___ feature: scaffold cli (#2)

closes #1  |||
9bae56c08121bd7b69fda0511026da0e41bd1e19 ___  ___ Initial commit |||

links:

from dripip.

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.