GitLab

= Git repo

+ Git web view

+ Gerrit code review

+ Jenkins CI

+ OpenALM tracker

+ more

SES GitLab Flow

Develop in branch
Never push to main stream directly

  • Develop in branch

  • Release on main stream

  • Never push to main stream directly

Create a branch

The branch can be in original repo or in your fork

Add commits

CI pipeline automatically run on every commit

Create a Merge Request

Discuss and review code

New submits will be included in MR

Merge

Component owner accepts the MR

Fork

A new concept in GitHub/GitLab

Project forking

Fork a project to your own namespace

project

<id>/project

local

fork

MR

pull

pull / push

upstream

origin

Remotes: origin & upstream

Merge Request

The core part in GitLab flow

Create Merge Request

From branch in your namespace to which in official

Fill in Merge Request template

MR acceptance

  • Be able to fast-forward merge

  • CI pipeline success

  • Code review comments
    are addressed

  • Change log is required

Cooperation on GitLab

Master
has no change

Fast-forward merge

Master has changes

Other Merge Requests have been accepted before you merge back

?

No Merge

Merge is not allowed when source branch doesn't contain master changes

Rebase

After rebase, branch can be fast-forward merged

Fast-forward, why?

CI has been passed on commit,
no risk of merge failure.

 

Fixing merge issue
is your own job!!!

To work smoothly

Keep MRs small

Begin new task on master latest commit
Rebase frequently

A good tool helps

Windows GUI Git client: SourceTree

CI on GitLab

Built-in supported

CI pipeline runs on every branch

No need to create job

Declarative: .gitlab-ci.yml

Ready to use

SES node.js preset has prepared everything for you

{
  ...
  "repository": "gitlab:ses/ses-nodejs-common",
  ...
}

package.json

Auto publish

Publish npm or build rpm

Run on official master branch only

Skip if version is not changed

Thanks

GitLab

By Leo Liang

GitLab

GitLab workflow introduction

  • 687