-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Task #736] Add PR workflow to README #152
base: master
Are you sure you want to change the base?
Conversation
Merge-squash {feature-branch} | ||
|
||
(pull request {pull-request-link}) | ||
[optionally](cherry picked from {commit-sha}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uncoverd do you think we should add a bin/cherry-pick-squash
(or some other name) script to this repository as well? https://app.productive.io/1-infinum/pages/148751
the pull request, when was the branch deployed to staging. | ||
|
||
Run the specs, check if everything is ok, then push 🎉 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a placeholder here for other environments. E.g. some projects have UAT env, so I'd add something like
[TODO] if there is another environment present on the project, define the merge methodology for it.
template.rb
Outdated
Squash and merge way: | ||
|
||
Squash and merge combines all the commits from a feature branch into a single new commit on the master. | ||
The history of individual commits from the feature branch is not preserved in the master branch. | ||
|
||
While on a feature branch: | ||
|
||
```bash | ||
git fetch origin master | ||
git rebase -i origin/master | ||
git push --force | ||
``` | ||
|
||
Check once again that everything was rebased correctly and continue on the master branch: | ||
|
||
```bash | ||
git fetch origin master | ||
git switch master && git pull | ||
git merge --squash {feature-branch} | ||
``` | ||
|
||
Then commit the new changes with a message of this format: | ||
|
||
```bash | ||
{pr-title} ({pr-number}) | ||
|
||
{pr-description} | ||
|
||
|
||
``` | ||
|
||
*Note*: When doing merge-squash through terminal you will need to manually close the PR, | ||
as opposed to using the Squash and merge on GitHub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uncoverd should we force to always use Github button for merging? Ideally we should have a rule in branch protection rules that no one should be able to push to master as everything should be done through PRs on Github. What do you think?
template.rb
Outdated
with `git merge --squash` (squash and merge button on GitHub) or non fast forward merge. | ||
Each of these is project specific and should be agreed upon which one would be used when starting the project. | ||
|
||
Once you agree you should update README accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would somehow transform this into a [TODO] as ideally we'd keep only the information about the actual merge methodology in this Readme file. We can define both options in a Handbook, but only the relevant one should be kept in a readme.
Honest question, shouldn't this be a link to our Handbook chapter? |
@vr4b4c I agree that most of the content is similar to what we already have in our Handbook chapter. I think it would be better to do what Nika mentioned: replace some parts with [TODO]. I’m not sure if you’re questioning the entire idea of adding this to the README 😅, but I do believe we should include this in our default template, even if we already have something similar defined in the Handbook.
That way we would have this information more accessible and it would also encourage people to clearly define these processes in the context of their project. This reduces the risk of important details being overlooked or vaguely considered. |
Correct, I'm questioning the whole idea of having the sizeable amount of content about workflow repeated in projects README. A link(s) to the relevant chapter in the Handbook would be a better approach. But I'm open-minded towards new ideas, feel free to challenge my opinions.
I'm not saying to omit the workflow documentation in the project repo, I'm saying we shouldn't repeat ourselves and link to some extent is more suitable for this use case (more on exact reasons follows). Let me give you some concrete examples of sections where I think link to the Handbook chapter is more suitable. CommitsThe commits section is very concise, generic (not project specific), and stable (not likely to change existing practices, albeit might be extended with some new ones). Keeping it centralized in the Handbook chapter would make it easier to manage and update. Since it's centralized, information propagation is free. I don't think it's likely for something project-specific to come up in this context, but if it does, the link would still be valid and the project would document only deviations from the centralized knowledge base. BranchesThe same as for commits, handbook chapter. Pull RequestsThe same as for commits and branches, handbook chapter, which covers much more than the section in the default template. Solving Change RequestsThis is best practice advice, I don't think it's likely to change on a per-project basis (handbook chapter). Merge methodologyI do see this as something that's more likely to change than any other previously mentioned section. Still, I think it would be better to link it to Handbook chapter and document only the differences to the established practice.
Linking generic topics shouldn't (and doesn't in my opinion) hinder our ability to document project-specific details.
I don't think there is any difference regarding this concern if we link content or not. Depending on the change affiliation it should be added in the project repo (if it's project-specific) or changed in the Handbook chapter if it's globally applicable. I'm now going to add a few comments (which should be fixed in the Handbook chapter), and think about how difficult would it be to propagate those changes if this PR was merged as is and applied to a dozen projects. |
Commits should have a descriptive subject as well as a quick explanation of the reason for the change in the commit | ||
body. | ||
This makes it easier to check changes in the code editor as you do not have to find the pull request and open it | ||
on github. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on github. | |
on GitHub. |
|
||
### Branches | ||
|
||
Branches should be opened from the master branch. Naming convention is {type}/{task-number}{descriptive-task-name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branches should be opened from the master branch. Naming convention is {type}/{task-number}{descriptive-task-name} | |
Branches should be opened from the main branch. Naming convention is {type}/{task-number}{descriptive-task-name} |
|
||
### Branches | ||
|
||
Branches should be opened from the master branch. Naming convention is {type}/{task-number}{descriptive-task-name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using folder-like structure in the branch names makes it more difficult to adopt git worktree's in practice. I'd personally suggest sticking to {task-number}-{descriptive-task-name}
naming convention (this also matches naming strategy of task management systems that integrate with source control systems).
#### Solving Change Requests | ||
|
||
Change requests should be fixed in separate fixup or squash commits. Rebasing the branch during an ongoing review is not | ||
appreciated unless there is a good reason for it, like pulling in some new and necessary changes from master, because it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appreciated unless there is a good reason for it, like pulling in some new and necessary changes from master, because it | |
appreciated unless there is a good reason for it, like pulling in some new and necessary changes from the main branch, because it |
|
||
### Staging | ||
|
||
Once the PR is opened, the feature can be merged into staging, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the PR is opened, the feature can be merged into staging, | |
Once the PR is opened, the feature can be integrated into staging, |
|
||
##### Merge Methodology | ||
|
||
We are doing merge-squashes to staging, as well of resets of the staging branch to master after each |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are doing merge-squashes to staging, as well of resets of the staging branch to master after each | |
We are doing merge-squashes to staging, as well of resets of the staging branch to the main branch after each |
[optionally](cherry picked from {commit-sha}) | ||
``` | ||
|
||
Including the pull request link makes github pick up that commit in the pull request, so we can know directly in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including the pull request link makes github pick up that commit in the pull request, so we can know directly in | |
Including the pull request link makes GitHub pick up that commit in the pull request, so we can know directly in |
|
||
[TODO] If there is another environment present on the project, define the merge methodology for it. | ||
|
||
### Master (Production) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Master (Production) | |
### Main branch (Production) |
### Master (Production) | ||
|
||
Once the PR has at least 1 approval, the branch was successfully deployed to staging, tested, | ||
and there are no failing specs, it can be merged into master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and there are no failing specs, it can be merged into master. | |
and there are no failing specs, it can be merged into the main branch. |
Once the PR has at least 1 approval, the branch was successfully deployed to staging, tested, | ||
and there are no failing specs, it can be merged into master. | ||
|
||
##### Merge methodology |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
##### Merge methodology | |
##### Integration methodology |
Task: #736
Aim
Extract the NLBL workflow, combine with the survey results and add it to default rails template
Solution