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.

`pre mode` will cause conflict and blocking our collaborate on git flow (merge / rebase / cherry-pick)

See original GitHub issue

Problem

One of the greatest strengths of the changesets is that all the xxx-changeset.md files are distributed, so we can easily collaborate on merge / rebase / cherry-pick without any worry about conflict in changesets.

But in our git flow ([trunk-based development])(https://trunkbaseddevelopment.com/), we will continue to create some pre-release version (with different “tag”) in different release-branches and publish for testing.

Due to the pre mode will always create pre.json file, and it’s a “single point”, not like distributed changeset files, so when we try to merge our branches, pre.json will always cause conflict ☹️.

image

Proposed solution

Maybe deprecate the design of pre.json in changesets v3?

IMHO the pre.json only record two things, which changeset files consumed (as changelog) by bump pre version with which pre-release id (“pre-id” same as “tag” in changesets).

I think both of two can record in changeset files themselves, in yaml front-matter, like

---
"@changesets/cli": patch
pre-release-tag: alpha
pre-consumed: true
---

...

In that design, pre-release-tag(or any other key word) is created in changeset add, pre-consumed is marked in like changeset version --pre-release if it has pre-release-tag, otherwise bump to prod version and delete changeset file as current behavior.

And the changeset publish design to always respect current “version” in package.json, the default “publish tag” need parsed from current version, so that the publish is nothing about pre mode at all.


propose links to #665 [[Umbrella] Changesets v3]

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Andaristcommented, Mar 7, 2022

The conflict is most likely to happen within a list of changeset IDs - where each new line contains a new changeset ID. So yeah, the situation related to conflicts potentially could be improved with yaml there but I would consider this to not be that big of a problem and something that shouldn’t happen too often. So I’m not really sure if it’s worth it to support a different file format there. Especially that different solutions could be chosen here - like for instance, those changesets could just be moved to a different directory and the list of “committed” changesets wouldn’t have to live the pre.json at all.

0reactions
zthxxxcommented, Jun 21, 2022

UPDATE after use rushjs in 6 months: rushjs works well without pre mode or pre.json.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git: Merge, Cherry-Pick & Rebase | An unconventional guide
You can use this guide to get a deep understanding of how Git's merges, rebases & cherry-picks work under the hood, so that...
Read more >
why does git conflict occur during cherry-pick? - Stack Overflow
The most common explanation is the same code region was changed by 2 different commits and now git cannot decide which one to...
Read more >
Introduction to GitLab Flow
Merge requests always create a merge commit, even when the branch could be merged without one. This merge strategy is called “no fast-forward”...
Read more >
I want the 'merge' function completely deprecated. I simply don ...
I want the 'merge' function completely deprecated. I simply don't trust it anymore. If there are no conflicts, you might as well rebase...
Read more >
[SIP-12] Proposal for Branch Management and Release Process
We propose a regular release cadence of every two weeks. This period is a tradeoff between stability and flexibility ensuring that new features ......
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