Follow the steps below if you already have a fork and a local repo configured. (What are those?)
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.
Development environment setup
The Development environment consists of
- a GitLab fork of the nordugrid/arc repository: a copy of the nordugrid/arc repo in your personal GitLab space
- a local copy on your computer of your fork, configured to sync with both your GitLab fork, referred as origin, and the nordugrid/arc repository, referred as upstream See this page for a complete overview of the terminology.
- Create your fork from https://source.coderefinery.org/nordugrid/arc/-/forks/new
- Go to
- Type "arcbot" in search field.
- Give arcbot "Maintainer" role permission.
- Click "Add to project"
- Go to
- In "General Settings" find the Timout field and extend it to 120
- Go to: Settings->CI/CD->Runners/li>
- Enable all the runners you see
1. GitLab web-interface preparations - once
Create your fork
Set up arcbot permissions in your fork. G2.Info about arcbot
Extend CI timout on fork - default 1h is not enough
Enable the Gitlab runners in your forks in order to use CI
2. Local repo setup on own computer - once
Get hold of the local copy of your fork
git clone https://source.coderefinery.org/<your-username>/arc.git <my-arc-fork> cd <my-arc-fork>
Add short-name to the remote repos - nordugrid/arc and your fork
git remote add upstream https://source.coderefinery.org/nordugrid/arc.git git remote -v #If no origin is added (should be by default) do git remote add origin https://source.coderefinery.org:<your-username>/arc.git
Fetch all the main branches from your forks remote repo to your forks local repo(actually only one now, but keeping for-loop just for the handiness of easily adding more branches, for instances dev-branches) - here the "next" branch is shown as an example.
cd <my-arc-fork> for remote_branch in origin/next; do local="$(cut -d'/' -f2 <<<"$remote_branch")" && git checkout -b $local --track $remote_branch; done; git checkout master;
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):
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;
If not already done so, create your development branch. Always create a new branch for each planned merge request.
See table of rules for choosing correct parent-branch.
git checkout -b <my-dev-branch> <parent-branch> git push -u origin <my-dev-branch>
It is good practice to keep your development branch up to date with its parent branch (and to keep your parent branch up to date with its upstream branch, see D1). Please create a separate commit when you update your development branch to keep your development commits and the update commits separated (as shown below) - this helps read the history at some point later.
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
Develop, add, commit, push to fork
"do coding" git add . git commit git push -u origin <my-dev-branch>
Repeat steps dev1, dev3, dev4 as needed depending on how long a time-period your development spans.
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 D7 on how to create a merge request.
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.
D7. Create merge request to upstream nordugrid/arc using the web interface and arcbot
Note! Once a merge request has been made, all following commits are recorded into the merge request. You should therefore create a new branch to work on a different task with unrelated commits.
- Make sure you have added the arcbot as member to your fork. See instructions in point G2.
- Go to
- Or navigate from your fork Merge Requests -> New Merge Request
- Source branch:
- Target branch:
nordugrid/arc <parent-branch>(See table of rules for choosing correct target, most often the
- Once the MR is created, select the MergeRequest template from the Description box drop-down menu and follow instructions in the template.
- If you want your changes also to be merged into another branch by arcbot, select label
copy_mr:<other-branch>(See table of rules for choosing correct label, most often the
Find more details for nordugrid-arc-bot here.
D8. Clean-up - optional
After merging to upstream repo and merges have been accepted:
git branch -d <my-dev-branch> git push origin --delete <my-dev-branch>
Rules for parent branch, target branch, merge request branch labelling.
Current release series refers to any release on current major release series. Which at time of writing would be 6.X.Y
Next release series refers to any release on next major release series. Which at time of writing would be 7.X.Y. The "next" branch is created only once it is needed, so ignore all merge-rules to the next branch if the branch does not exist.
|merge into||mr branch
|1||Changes for current release
series and for next
|2||Changes for current release
series but not
for next release series
|3||Changes for next release
but not for current release
Rule table for translations updates
|Case||branch from||merge into||mr
|1||Translation updates for current release||master||master||translations|
|2||Translation updates for next release||next||next||translations|