Replies: 7 comments 7 replies
-
Is this very different from the scheme in place but with some renames? If so, I think
I completely agree with this, and think that an automated trigger to open a PR and assign it to the prior PR's owner is necessary to enforce this.
I don't have a particularly strong opinion on this-- I'd be fine either way with the repo enforcing this. |
Beta Was this translation helpful? Give feedback.
-
I'm generally onboard with this as well. It won't remove all merge conflicts, but it'll cut down on their frequency.
I'd like to know more about the advantages/disadvantages of this. Does it reduce the number of merge conflicts? |
Beta Was this translation helpful? Give feedback.
-
This is a fantastic suggestion. Squash Merges leaves PRs as a single, self-contained unit of work that can be more cohesively referenced in the future while keeping the history clean. Sometimes, developers do small commits with fixes like "chore: fix comment typo" and these end up polluting the parent branch if committed linearly. Those commits are better off encapsulated in the context of the PR while having one big squash commit with a summary (which can be auto-generated by GitHub) on Just be aware that squash merging, while it's more convenient history-wise, can require risky rebases and force pushes of the PR or the parent branch if GitHub is not able to do it automatically.
"staging" is often more appropriate for apps deployed to a staging environment.
IMHO, the more you automate rules the less burden it is to maintain order and the more streamlined the developer experience is. Among other thoughts, I'm not sure if Stacks is using feature flags or anything similar? They are quite useful to keep risky features from breaking the existing code even if accidentally committed to |
Beta Was this translation helpful? Give feedback.
-
There's a fair bit of information in CONTRIBUTING.md in regards to the current branching strategy, but to summarize:
It took me a little bit to really "get it" how things were setup, but after getting used to it I think the setup in principal is actually pretty good. I like that there's a separate development cycle for non-consensus-critical and consensus-critical paths. The problem is that these branches aren't synced often enough and we end up with giant & risky merges. I think this structure could work quite well GIVEN:
On squashing I'm generally a proponent of squashing PR's because I personally use git as a bit of a undo-tool when I'm developing new features where I'm not sure how exactly it'll pan out code-wise. I'm probably not alone there ;) PR's should aim to be small enough that the feature can be described in a line or two. Re: commit messages (this is just a thought), there's a lot which can be done to help ensure uniformity - one idea would be enforcing Conventional Commits via i.e. commitizen, which can use pre-commit-msg hooks in git to ensure that a commit meets the guidelines before the commit is actually accepted by git. Using |
Beta Was this translation helpful? Give feedback.
-
It's easy to keep a linear history if you only have one persistent branch. If you only have
|
Beta Was this translation helpful? Give feedback.
-
From @cylewitruk : |
Beta Was this translation helpful? Give feedback.
-
I'm a fan of rebases over merge commits as well. I find requiring squash commits can be a bit overkill, as there are often legitimate reasons for multiple separate commits as part of one PR. I strongly support the automation of master -> develop and develop -> next PRs. |
Beta Was this translation helpful? Give feedback.
-
One of the biggest challenges with working with the stacks-core codebase is the current branching structure/merge strategy.
This discussion is to propose some improvements to the current workflow and to discuss the pros and cons.
Proposed branch strategy:
MAIN -> this is the release branch
DEVELOP -> This should be all changes slated for release (this essentially is a testing branch) (preferably this should be named STAGING)
NEXT -> Built on DEVELOP plus hardfork changes (preferably this should be called DEVELOP)
One issue is that NEXT and DEVELOP often diverge substantially resulting in out of date code with a plethora of merge conflicts. To prevent these conflicts growing to unmaintainable amounts, if someone merges into DEVELOP, there should be an immediate (maybe automatically triggered?) PR opened into the NEXT branch. This will ensure that NEXT is always up to date with DEVELOP.
Additionally, due to the fact that both NEXT and DEVELOP contain multiple merge commits, there is no linear history. This makes it impossible to bisect for bugs/have proper code attribution/makes it impossible to properly rebase feature or chore branches.
If we enforced rebasing (preferably with squash commits on all PRs), we would have linear history with all of the advantages listed above. Unfortunately github does not provide a rebase button so these must be done manually in your own local terminal/IDE. However, github does provide a squash merge button and can enforce linear history. I highly recommend enabling this and making it default.
-> In protected branches, enable "require linear history" and it will enforce rebasing and squash commits https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-linear-history
-> For enabling squash/rebase: see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github for how to configure the PR configurations
Please comment below if there are other improvements you think should be mentioned or if you have issues with this proposal.
I am not 100% sure what the actual intended purpose of DEVELOP vs NEXT is so clarity on that would be great.
@wileyj @xoloki @soju-drinker @obycode @jcnelson @kantai @AshtonStephens
Beta Was this translation helpful? Give feedback.
All reactions