-
Notifications
You must be signed in to change notification settings - Fork 6
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
GitHub Flow Migration #330
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,9 @@ This article will give you an overview of how the `{admiral}` project is utilizi | |
|
||
# Branches | ||
|
||
- The `main` branch contains the latest **released** version and should not be used for development. You can find the released versions [here](https://GitHub.com/pharmaverse/admiral/releases) | ||
- The `devel` branch contains the latest development version of the package. You will always be branching off and pulling into the `devel` branch. This is set as the default branch on GitHub. | ||
- The `main` branch contains the latest development version of the package. | ||
- The `gh-pages` branches contains the code used to render this website you are looking at right now! | ||
- The `patch` branch is reserved for special hot fixes to address bugs. More info in [Hot Fix Release](release_strategy.html#hot-fix-release) | ||
- The `main`, `devel`, `gh-pages`, `patch` branches are under protection. If you try and push changes to these branches you will get an error unless you are an administrator. | ||
|
||
- **Feature** branches are where actual development related to a specific issue happens. Feature branches are merged into `devel` once a pull request is merged. Check out the [Pull Request Review Guidance](pr_review_guidance.html) for more guidance on merging into `devel`. | ||
|
||
- **Feature** branches are where actual development related to a specific issue happens. Feature branches are merged into `main` once a pull request is merged. Check out the [Pull Request Review Guidance](pr_review_guidance.html) for more guidance on merging into `main`. | ||
|
||
# Working with Feature Branches | ||
|
||
|
@@ -43,23 +38,23 @@ Each feature branch must be related to an issue. We encourage new developers to | |
|
||
### Naming Branches | ||
|
||
The name of the branch must be prefixed with the issue number, followed by a short but meaningful description and the `@<target_branch>` suffix. The latter would be `@devel` in most cases. As an example, given an issue #94 "Program function to derive `LSTALVDT`", the branch name would be `94_derive_var_lstalvdt@devel`. | ||
The name of the branch must be prefixed with the issue number, followed by a short but meaningful description and the `@<target_branch>` suffix. The latter would be `@main` in most cases. As an example, given an issue #94 "Program function to derive `LSTALVDT`", the branch name would be `94_derive_var_lstalvdt@main`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed the detail about main as it's not needed |
||
|
||
The `@<target_branch>` suffix is used in our CI/CD pipelines, e.g. when running `R CMD check`. It ensures that `{admiral}`'s dependencies such as `{pharmaversesdtm}` and `{admiraldev}` are installed from the specified target branch. So when the target branch is set to `@devel` the dependencies will be installed from those package's respective `devel` branches rather than installing the latest released version. This ensures that we test the development version of `{admiral}` against the development versions of its dependencies. That way all packages are kept in sync. | ||
The `@<target_branch>` suffix is used in our CI/CD pipelines, e.g. when running `R CMD check`. It ensures that `{admiral}`'s dependencies such as `{pharmaversesdtm}` and `{admiraldev}` are installed from the specified target branch. So when the target branch is set to `@main` the dependencies will be installed from those package's respective `main` branches rather than installing the latest released version. This ensures that we test the development version of `{admiral}` against the development versions of its dependencies. That way all packages are kept in sync. | ||
|
||
### Create a New Feature Branch from the Terminal (from `devel`) | ||
### Create a New Feature Branch from the Terminal (from `main`) | ||
|
||
- Checkout the devel branch: `git checkout devel` | ||
- Checkout the main branch: `git checkout main` | ||
- Pull the latest changes from GitHub: `git pull` | ||
- Create a new branch off the devel branch and switch to it: `git checkout -b <new_branch_name>` | ||
- Create a new branch off the main branch and switch to it: `git checkout -b <new_branch_name>` | ||
|
||
### Create a New Feature Branch from GitHub (from `devel`) | ||
### Create a New Feature Branch from GitHub (from `main`) | ||
|
||
You can also create a feature branch in GitHub. | ||
|
||
- Switch to the `devel` branch | ||
- Switch to the `main` branch | ||
- Type in your new feature branch name | ||
- Click Create branch: `<your_branch_name>@devel` from `devel` | ||
- Click Create branch: `<your_branch_name>@main` from `main` | ||
- Be Sure to Pull down newly created branch into RStudio | ||
|
||
```{r, echo = FALSE} | ||
|
@@ -113,7 +108,7 @@ We recommend a thorough read through of the articles, [Pull Request Review Guida | |
Once all changes are committed, push the updated branch to GitHub: | ||
`git push -u origin <branch_name>` | ||
|
||
In GitHub, under **Pull requests**, the user will either have a "Compare and pull request" button and/or a "Create Pull Request". The first button will be created for you if GitHub detects recent changes you have made. The branch to merge with must be the `devel` branch (base = `devel`) and the compare branch is the new branch to merge - as shown in the below picture. Please **pay close attention** to the branch you are merging into! | ||
In GitHub, under **Pull requests**, the user will either have a "Compare and pull request" button and/or a "Create Pull Request". The first button will be created for you if GitHub detects recent changes you have made. The branch to merge with must be the `main` branch (base = `main`) and the compare branch is the new branch to merge - as shown in the below picture. Please **pay close attention** to the branch you are merging into! | ||
|
||
The issue must be linked to the pull request in the "Development" field of the | ||
Pull Request. In most cases, this will linkage will automatically close the issue and move to the Done column on our project board. | ||
|
@@ -153,10 +148,10 @@ knitr::include_graphics("github_done.png", dpi = 144) | |
Merge conflict is a situation where `git` cannot decide which changes to apply since there were multiple updates in the same part of a file. This typically happens when multiple people update the same part of code. Those conflicts always need to be handled manually (as some further code updates may be required): | ||
|
||
``` | ||
git checkout devel | ||
git checkout main | ||
git pull | ||
git checkout <feature_branch> | ||
git merge devel | ||
git merge main | ||
``` | ||
|
||
This provides a list of all files with conflicts In the file with conflicts the conflicting sections are marked with `<<<<<<<`, `=======`, and `>>>>>>>`. The code between these markers must be updated and the markers be removed. Source files need to be updated manually. Generated files like NAMESPACE or the generated documentation files should not be updated manually but recreated after the source files were updated. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,37 +41,29 @@ updates via the community meetings, especially any anticipated breaking changes. | |
|
||
## Quarterly Release | ||
|
||
A package release is done in five parts: | ||
A package release is done in four parts: | ||
|
||
1) Create a Pull Request from `devel` into the `main` branch. Issues identified in this Pull Request should have work done in separate branches and merged once again into `devel`. | ||
1) Verify that all CI/CD checks are passing for the `devel` into the `main` Pull Request, merge and then bundle up and send off to CRAN. See the [chapter](https://r-pkgs.org/release.html#decide-the-release-type) in R Packages for more details. | ||
1) Verify that all CI/CD checks and then bundle up and send off to CRAN. See the [chapter](https://r-pkgs.org/release.html#decide-the-release-type) in R Packages for more details. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need a PR into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that depends on the workflow one uses. the PR checklist from usethis, has you keep your version bump to the release version local until CRAN accepts. But others do different things. |
||
1) If CRAN asks for modifications, repeat steps 1-2 as necessary. | ||
1) Once the package is accepted and available on CRAN, a [GitHub action](https://github.com/pharmaverse/admiral/actions/workflows/pages/pages-build-deployment) is set up to rebuild the `{admiral}` website with all the updates for this release. | ||
1) Use the release button on GitHub to "release" the package onto GitHub. This release onto Github archives the version of code within the `main` branch, attaches the News/Changelog file, bundles the code into a `tar.gz` file and makes a validation report via the GitHub action `validation` from [insightsengineering/validatoR](https://github.com/insightsengineering/thevalidatoR). Please see past [admiral releases](https://github.com/pharmaverse/admiral/releases) for reference and the [Releasing to Github](release_strategy.html#releasing-to-github) section for more details. | ||
1) Any issues fixed in the `main` branches should be merged back into `devel`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a PR to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we make releases, we should follow the checklist issue created from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use |
||
1) Once a release is completed the `main` branch should be merged into `patch` to be ready for hotfixes. | ||
|
||
**Quarterly Release:** | ||
|
||
* `devel >> main` | ||
* `main >> patch` (To be prepared in case of a needed hotfix) | ||
|
||
Be on the look out for an automated check PR whenever `devel` goes into `main` as a future upcoming feature. | ||
|
||
## Hot Fix Release | ||
|
||
Occasionally we will need to release a hot fix to address a package breaking bug. A hot fix release is done in 6 parts: | ||
Occasionally we will need to release a hot fix to address a package breaking bug. A hot fix release is done in eight parts: | ||
|
||
1) Identify all the bugs that need to be fixed for this hot fix release and label with hot fix label. | ||
1) Branches addressing the bugs should have Pull Requests merged into the `patch` branch **NOT** the `devel` branch. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add that the |
||
1) When naming the branch follow the [naming conventions](git_usage.html#implementing-an-issue) guide but use the `@main` suffix | ||
1) Branches addressing the bugs should have Pull Requests merged into a single `patch` branch **NOT** the `main` branch, where the `patch` branch has been created from the most recent release of the package. | ||
1) When naming the branch follow the [naming conventions](git_usage.html#implementing-an-issue) guide but use the `@main` suffix. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
1) Create a Pull Request from `patch` into the `main` branch. Verify that all CI/CD checks are passing, merge and them bundle up and send off to CRAN. See the [chapter](https://r-pkgs.org/release.html#decide-the-release-type) in R Packages for more details. | ||
1) If CRAN asks for modifications, repeat steps 1-4 as necessary. | ||
1) Once the package is accepted and available on CRAN, a [GitHub action](https://github.com/pharmaverse/admiral/actions/workflows/pages/pages-build-deployment) is set up to rebuild the `{admiral}` website with all the updates for this release. | ||
1) Use the release button on GitHub to "release" the package onto GitHub. This release onto Github archives the version of code within the `main` branch, attaches the News/Changelog file, bundles the code into a `tar.gz` file and makes a validation report via the GitHub action `validation` from [insightsengineering/validatoR](https://github.com/insightsengineering/thevalidatoR). Please see past [admiral releases](https://github.com/pharmaverse/admiral/releases) for reference and the [Releasing to Github](release_strategy.html#releasing-to-github) section for more details. | ||
1) These hot fixes should then be merged into the `devel` branch through an additional Pull Request. | ||
|
||
**Hot Fix Release**: `patch >> main >> devel` | ||
1) Create a GitHub release on the `patch` branch. Please see past [admiral releases](https://github.com/pharmaverse/admiral/releases) for reference and the [Releasing to Github](release_strategy.html#releasing-to-github) section for more details. | ||
1) These hot fixes should then be merged into the `main` branch through an additional Pull Request. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to add that the development version needs to be added again in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
|
||
# Releasing to Github | ||
Under the [Releases](https://github.com/pharmaverse/admiral/releases) section in the main repo, select `Draft a New Release`. Proceed by creating the appropriate release tag and header, denoted as `vX.X.X` and `admiral X.X.X` respectively, for the release: | ||
|
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 think we should keep these two items and just remove
devel
from the second one.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.
added back (but in a new PR). All comments are regarding the new PR