Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

When using Git and GitLab to develop and check-in changes to the RAS codebase, follow this process.

...

This command will push your branch and all of its committed changes to the central GitLab server.

Image Added

4) Create a Merge Request in GitLab

Log into GitLab

...

 

Filter by label (Content by label)
showLabelsfalse
max5
spacesexchange2010
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "exchange2010"
labelskb-how-to-article

...

hiddentrue

...

and go to the project in which you're working. In the 'Push Activity' feed, you should see that your branch has been pushed to the server and is awaiting merging.

Click the 'Create Merge Request' link beneath the push event to begin this process.

Image Added

 

On the New Merge Request page, you can optionally change the title of your merge or add a description, but the most important thing is to assign the merge to someone. RAS policy is that all changes must be reviewed by another developer before they can be merged, so select another team member to assign your merge to.

Image Added

Once an assignee is selected, click the 'Submit Merge Request' button to create the merge request. The person assigned to the request will be notified, and they should review the request as soon as is feasible and either approve it for merging or request further changes. It's a good idea to keep tabs on the status of your merge request to ensure that it doesn't get forgotten or run into merge problems.

Once the reviewer has approved your merge request, GitLab will merge your branch into the

Reviewing a Merge Request

If you are assigned a merge request to review, you will receive an email notification from GitLab. You can also see the number of outstanding merge requests in the navigation bar at the left side of GitLab.

When viewing a merge request, you can review the contents of the branch and leave comments using the tabs at the bottom of the page:

 

  • The 'Discussion' tab can be used to leave high-level comments that aren't specific to a particular file or change.
  • The 'Commits' tab can be used to browse the commits that were made on this branch.
  • The 'Changes' tab can be used to view individual changes and leave comments on a line-by-line basis.

Image Added

Approving a merge request

If you are ready to approve a merge request, check the box for 'Remove source branch' on the main page of the request, then click the 'Accept Merge Request' button.

Image Added

GitLab will merge the branch into the master branch and report on the results. Usually merges will succeed without any further action necessary, but if merge conflicts are reported they'll need to be manually resolved. (Details TBD)Image Added

Rejecting a merge request

If it's determined that a branch pushed to GitLab should not be merged, or needs further work before it can be merged, the reviewer can close the merge request without merging the branch by using the 'Close merge request' button (preferably while also leaving a comment explaining why).

Image Added

The submitter can then make further changes on their branch, if necessary, and push the new commits to GitLab in order to open a revised merge request.

Cleaning up Git branches

Since a new branch is created for each JIRA ticket, you may end up with a large number of branches in your local git repos. Selecting the 'Remove source branch' option when merging in GitLab removes those branches from the server, but not from your local machine.

Once your branch is merged into master, you probably don't need it anymore. Leaving these branches as-is shouldn't hurt anything, but if you'd like to clean them up, you can use the command 'git branch' to print all of the branches that exist in the current repo, and 'git branch -d branch_name' to delete a branch.

Image Added

 

Updating ras-kuali repos

When we want to upgrade to a new Kuali release, we need to update our ras-kuali repos to the latest Kuali revision and then select the appropriate release tags for the new build. Run the following commands in each of the ras-kuali repos:

Create a new branch off of 'master' for merging in the updates

Replace 'kc-1606' with the version of the new release; this will be the branch name used in the merge.

Code Block
languagebash
git checkout master
git checkout -b kc-1606

Add the Kuali github as a remote source, if necessary

Run the git remote command to view the remote repositories linked to this repo.

Code Block
languagebash
git remote -v

Image Added

If the output of this command shows the Kuali github addresses as a remote repo in addition to the GitLab addresses, you can skip to the 'git fetch' step below. Otherwise, you'll need to add the github repo as a remote source, replacing the URL here with the correct github address for the matching repo:

Code Block
languagebash
git remote add github https://github.com/kuali/kc-s2sgen

Fetch the new commits from Github

Once the github address has been set up as a remote repo, you are ready to fetch the changes from github to your local repository:

Code Block
languagebash
git fetch github

This will pull all new commits, branches, and tags that have been added to the github repo since your last fetch into your local repo.

Image Added

Merge the Github changes into the local branch

Run the merge command to merge the contents of the Github 'master' branch into the current local branch.

Code Block
languagebash
git merge github/master

Image Added

Push the new changes to GitLab

Run the following commands to push the new changes and tags to the GitLab server. New tags are not pushed by default, so the second command is necessary to sync those to the server.

Code Block
languagebash
git push origin kc-1606
git push origin --tags

Merge the changes within GitLab

Create a merge request on GitLab as described above, and merge the new branch into the master branch. The repo has now been synced with the Kuali Github repo, and the changes can be pulled down to your local repo using the 'git pull' command.

The repo will be at the latest commit by default, so you may need to checkout a specific release tag in order to build a specific version of the project.