Create a fork of ApiOpenStudio. You can then work as much as you want on that fork.
Login to GitLab and navigate to ApiOpenStudio.
Click on the Fork
button on the top right of the page:
This will create a copy of ApiOpenStudio in your repository.
In your fork, navigate to settings -> Repository.
Set Default branch
to develop.
Click on Clone
button on your fork, and download this to local computer
and copy the clone path and clone to your computer:
git clone git@gitlab.com:<my_user>/<my_repo_name>.git
git clone https://gitlab.com/<my_user>/<my_repo_name>.git
upstream
remoteThis will allow you to regularly rebase and ensure that you have the latest version of master and develop branch from the main repository:
cd /path/to/apiopenstudio
git remote add upstream git@gitlab.com:apiopenstudio/apiopenstudio.git
git fetch upstream
This is required so that the GitLab CI runner can run in your fork. The runner instance needs to install the composer dependencies in order to run.
GitLab is configured to prevent any merge requests being merged until tests are passed.
This variable is safe and masked, and will never be revealed in your runner logs.
Settings
-> CI/CD
.Variables
section.Add Variable
.
SSH_PRIVATE_KEY
in Key
.Value
.Protect variable
flag. This will allow the variable to
be used in the feature branch CI.Add Variable
.Add Variable
.
Value
.Protect variable
flag. This will allow the variable to
be used in the feature branch CI.Mask variable
flag. This will mask the variable in the
logs.Add Variable
.Ensure that your develop
branch is up-to-date with upstream/develop
:
git checkout develop
git fetch upstream develop
git rebase upstream/develop
git push origin develop
Create your new feature branch:
git checkout -b feature/nn-description-of-the-feature
git push origin feature/nn-description-of-the-feature
Commit any changes that you've made to your branch to your origin (fork).
By prefixing your comment with #<ticket_no>
(e.g. #103), the commit will
be automatically added to your ticket as a comment:
git commit -a -m "#<ticket_no> <commit_comment>"
git push origin feature/nn-description-of-the-feature
Before you make a Merge Request, ensure that you've updated the wiki and any other documentation to reflect your changes.
Click on Merge Requests
in the left menu in your fork.
Click on the New merge request
button.
Select your source and target branch by clicking on the Change branches
link.
The target branch is always apiopenstudio/apiopenstudio
develop
. If you
select master
as your target, your merge request will be denied, and you
will need to make another.
Click on Compare branches and continue
.
Review your changes and submit.
Your changes will then be reviewed and hopefully merged.