|
|
Follow the steps below if you already have a <i title="your own GitLab remote copy of the upstream repo">fork</i> and a <i title="the local copy on your computer of any git repo">local repo</i> configured. (<i><a href="https://source.coderefinery.org/nordugrid/arc/wikis/contributing/Overview" target="_blank">What are those?</a></i>)
|
|
|
|
|
|
Currently master holds all commits relevant for releases in the ARC 6 release series. The "next" branch is created when needed, and holds the same commits in addition to commits that are backward incompatible to ARC 6 and therefore will go into the next major release: ARC 7.
|
|
|
|
|
|
<details>
|
|
|
<summary>
|
|
|
Otherwise <b><a>click here to learn how to setup the development environment</a></b></summary>
|
... | ... | @@ -70,16 +68,23 @@ for remote_branch in origin/next; do local="$(cut -d'/' -f2 <<<&qu |
|
|
|
|
|
# Everyday workflow/development
|
|
|
|
|
|
|
|
|
Currently master holds all commits relevant for releases in the ARC 6 release series. The "next" branch is created when needed, and holds the same commits in addition to commits that are backward incompatible to ARC 6 and therefore will go into the next major release: ARC 7.
|
|
|
|
|
|
#### D1.
|
|
|
It is good practice to update your forks branches so that they are not behind the upstream branches. For each branch checkout, pull from upstream, push to your forks remote repo, then go back to branch you were on. In this example we assume the "next" branch exists (which is does not always - see details below):
|
|
|
Before you start a development branch on your fork, update your forks branches with the upstream branches. Below shows how to do this for the master and next branch.
|
|
|
|
|
|
You can add or remove the branches as needed (i.e. if the next branch does not exist, omit that branch)
|
|
|
|
|
|
|
|
|
```
|
|
|
cd <my-arc-fork>
|
|
|
current_branch=$(git rev-parse --abbrev-ref HEAD); for branch in master next; do git checkout $branch && git pull upstream $branch;git push -u origin $branch; git checkout $current_branch; done;
|
|
|
```
|
|
|
|
|
|
|
|
|
#### D2.
|
|
|
If not already done so, create your development branch. Always create a new branch for each planned merge request.
|
|
|
If not already done so, create your development branch. Always create a new branch for each planned merge request. NB! Update your fork first (see D1.)
|
|
|
|
|
|
See [table of rules](/contributing/cheat-sheet#rule-table) for choosing correct parent-branch.
|
|
|
|
... | ... | @@ -92,39 +97,44 @@ git push -u origin <my-dev-branch> |
|
|
#### D3.
|
|
|
Keeping your development branch up to date.
|
|
|
|
|
|
If you dont need to, it is simplest (and cleanest) to not update your development branch. This will avoid extra merge commits if the merge request is automatically merged into the next branch.
|
|
|
If you don't need to, it is simplest (and cleanest) to not update your development branch. This will avoid extra merge commits on your dev branch.
|
|
|
|
|
|
If you need to, here is how to do it:
|
|
|
However, if you need to (e.g. to include some relevant code from the upstream parent branch), this is how to:
|
|
|
|
|
|
1. update the master and next branches on your fork with the upstream branches
|
|
|
```
|
|
|
#update the master and next branches on your fork with the upstream branches
|
|
|
current_branch=$(git rev-parse --abbrev-ref HEAD); for branch in master next; do git checkout $branch && git pull upstream $branch;git push -u origin $branch; git checkout $current_branch; done;
|
|
|
```
|
|
|
|
|
|
#update your development branch
|
|
|
2. update your development branch
|
|
|
```
|
|
|
git checkout <my-dev-branch>
|
|
|
git merge --no-ff <parent-branch>
|
|
|
git add .
|
|
|
git commit
|
|
|
git push -u origin <my-dev-branch>
|
|
|
```
|
|
|
See technical note about `git add` [here](/contributing/Useful-git-technical-information#git-add)
|
|
|
|
|
|
See technical note about `git add` [here](/contributing/Useful-git-technical-information#git-add).
|
|
|
|
|
|
#### D4.
|
|
|
Develop, add, commit, push to fork
|
|
|
|
|
|
```
|
|
|
"do coding"
|
|
|
git add .
|
|
|
git commit
|
|
|
git add <specific file - or all changes>
|
|
|
git commit -m "<commit message>"
|
|
|
git push -u origin <my-dev-branch>
|
|
|
```
|
|
|
|
|
|
If you need to add everything or just specific files is up to you to sort out (https://git-scm.com/docs/git-add)
|
|
|
|
|
|
#### D5.
|
|
|
Repeat steps dev1, dev3, dev4 as needed depending on how long a time-period your development spans.
|
|
|
|
|
|
|
|
|
#### D7. Create merge request to upstream nordugrid/arc using the web interface and arcbot
|
|
|
#### D6. Create a merge request to upstream nordugrid/arc using the web interface and arcbot
|
|
|
|
|
|
**Note! Once a merge request has been made, all following commits to the source branch are recorded into the merge request.** You should therefore create a new branch to work on a different task with unrelated commits.
|
|
|
|
|
|
|
... | ... | @@ -134,12 +144,13 @@ Repeat steps dev1, dev3, dev4 as needed depending on how long a time-period your |
|
|
- Or go to `https://source.coderefinery.org/<your-user-name>/arc/merge_requests/new`
|
|
|
- Or navigate from your fork Merge Requests -> New Merge Request
|
|
|
* Source branch: `<your-user-name>/arc <your-dev-branch>`
|
|
|
* Target branch: `nordugrid/arc <target-branch>` (See [table of rules](/contributing/cheat-sheet#rule-table) for choosing correct target, most often the `master` branch.)
|
|
|
* Target branch: `nordugrid/arc <target-branch>` (See [table of rules](/contributing/cheat-sheet#rule-table) for choosing correct target)
|
|
|
* Once the MR is created, select the *MergeRequest* template from the Description box drop-down menu and follow instructions in the template.
|
|
|
* If the changes are also for another branch (typically `next`) tell arcbot to automatically create a MR.
|
|
|
* Add the label `cherrypick:<other-branch>` (See [table of rules](/contributing/cheat-sheet#rule-table) for choosing correct label, most often the `next` branch.)
|
|
|
|
|
|
Find more details for [nordugrid-arc-bot here](/contributing/overview#1-using-the-web-interface-and-arcbot).
|
|
|
Find more details for [nordugrid-arc-bot here](/https://source.coderefinery.org/nordugrid/arc/-/wikis/Contributing/Arcbot).
|
|
|
|
|
|
|
|
|
##### Draft MR
|
|
|
If you have already created a MR, but you are not done yet, communicate that you are working on development by creating a "Draft Merge request". See [step D6](/contributing/cheat-sheet#d7-create-merge-request) on how to create a merge request.
|
... | ... | @@ -147,8 +158,8 @@ If you have already created a MR, but you are not done yet, communicate that you |
|
|
* Add `Draft:` to the beginning of your title.
|
|
|
* The merge request will just stay open and not be mergeable, as long as the "Draft" keyword is in the title. The merge request will act as a communication platform, and a display of what you are currently working on.
|
|
|
* Commits that are pushed to your fork will be continuously recorded to the merge request.
|
|
|
* Only once you remove the "Draft" keyword, the merge request can actually be treated.
|
|
|
*
|
|
|
* Only once you remove the "Draft" keyword, the merge request can actually be merged.
|
|
|
|
|
|
|
|
|
#### D8. Clean-up - optional
|
|
|
|
... | ... | @@ -168,9 +179,9 @@ Next release series refers to any release on next major release series. Which at |
|
|
|
|
|
| | Case | branch from<br>(parent) | merge into (target) | mr branch<br>labels<br> |
|
|
|
| ---- | -------- | ---------------| ------------- | ------- |
|
|
|
| 1 | Changes for current release <br>series and for next <br>releases series | master | master<br>next | copy_mr:next |
|
|
|
| 2 | Changes for current release<br> series but not<br> for next release series| master| master | - |
|
|
|
| 3 | Changes for next release<br> series, <br>but **not for** current release<br>series | next | next | - |
|
|
|
| 1 | Changes for current release <br>series and for next <br>releases series | master | master<br>next | cherrypick:next |
|
|
|
| 2 | Changes for current release<br> series but not<br> for next release series| master| master | only:master |
|
|
|
| 3 | Changes for next release<br> series, <br>but **not for** current release<br>series | next | next | only:next |
|
|
|
|
|
|
|
|
|
|
... | ... | |