Difference between revisions of "Gitlab"

From Public PIC Wiki
Jump to navigation Jump to search
(Created page with "= Introduction = [https://about.gitlab.com/ Gitlab] is a Dev(Sec)Ops platform to handle all the elements in the software development life cycle. Main features: * Git reposit...")
 
Line 25: Line 25:
 
* [https://docs.gitlab.com/ee/user/project/web_ide/index.html Web IDE]
 
* [https://docs.gitlab.com/ee/user/project/web_ide/index.html Web IDE]
 
* [https://docs.gitlab.com/ee/ci/yaml/ CI/CD .yaml file syntax reference]
 
* [https://docs.gitlab.com/ee/ci/yaml/ CI/CD .yaml file syntax reference]
 +
 +
= Best practices / recommendations =
 +
 +
== General rules ==
 +
 +
* '''Make small and atomic changes''' Commit / push often.
 +
* '''Use branches for dedicated/long developments'''
 +
* '''Keep the main branch stable''' the tests should always pass (yes you should have tests!!)
 +
* '''Write descriptive commit messages''' Avoid messages like “changes”, “test”  or “.”
 +
* '''Adopt a branching strategy''' [https://nvie.com/posts/a-successful-git-branching-model/ gitflow], trunk-based,...
 +
* '''Do code reviews if possible''' Specially if working in a team
 +
 +
== Our contributions ==
 +
 +
* '''Use git!!''' If you work alone or in a team, use it!
 +
* '''Do not upload big binary files to a git repository''' Git is not for data, it is for code. If you still want to do it you can use git LFS.
 +
Use .gitignore to track only relevant files
 +
Do not track  jupyter notebooks (.ipynb) directly, pair them with a script
 +
Do not upload confidential data (NEVER!) passwords, ssh keys, etc will be there forever

Revision as of 10:56, 3 November 2023

Introduction

Gitlab is a Dev(Sec)Ops platform to handle all the elements in the software development life cycle.

Main features:

  • Git repository management
  • Software development planning
  • Continuous Integration and Continuous Deployment (CI/CD)

The service can be accessed at [1] with your PIC account.

The groups inside gitlab are not synced with the LDAP groups, if you want to have access to some specific group or project in gitlab you have to request it through the application.


Official Gitlab documentation

The official Gitlab documentation can be found here: https://docs.gitlab.com/

Make sure that the documentation you are viewing applies to the Free (Community Edition) distribution and the version deployed at gitlab.pic.es. You can easily find the version number in the Help menu.

The official documentation can be overwhelming, here are some useful links:

Best practices / recommendations

General rules

  • Make small and atomic changes Commit / push often.
  • Use branches for dedicated/long developments
  • Keep the main branch stable the tests should always pass (yes you should have tests!!)
  • Write descriptive commit messages Avoid messages like “changes”, “test” or “.”
  • Adopt a branching strategy gitflow, trunk-based,...
  • Do code reviews if possible Specially if working in a team

Our contributions

  • Use git!! If you work alone or in a team, use it!
  • Do not upload big binary files to a git repository Git is not for data, it is for code. If you still want to do it you can use git LFS.

Use .gitignore to track only relevant files Do not track jupyter notebooks (.ipynb) directly, pair them with a script Do not upload confidential data (NEVER!) passwords, ssh keys, etc will be there forever