Difference between revisions of "Gitlab"

From Public PIC Wiki
Jump to navigation Jump to search
Line 43: Line 43:
 
* '''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 (see above).
 
* '''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 (see above).
 
* '''Use .gitignore to track only relevant files''' [https://git-scm.com/docs/gitignore official docs] and [https://github.com/github/gitignore/tree/main some examples]  
 
* '''Use .gitignore to track only relevant files''' [https://git-scm.com/docs/gitignore official docs] and [https://github.com/github/gitignore/tree/main some examples]  
* '''Do not track  jupyter notebooks (.ipynb)''' pair them with a script using [[JupyterHub#jupytext]]
+
* '''Do not track  jupyter notebooks (.ipynb)''' pair them with a script using [[JupyterHub#jupytext|jupytext]]
 
* '''Do not upload confidential data''' passwords, ssh keys, etc will be there forever
 
* '''Do not upload confidential data''' passwords, ssh keys, etc will be there forever

Revision as of 11:06, 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 (see above).
  • Use .gitignore to track only relevant files official docs and some examples
  • Do not track jupyter notebooks (.ipynb) pair them with a script using jupytext
  • Do not upload confidential data passwords, ssh keys, etc will be there forever