-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
How to contribute to Glances ?
Glances development factory uses the spirit of the 'git flow' workflow: http://danielkummer.github.io/git-flow-cheatsheet/.
The following branches are available:
- master: this is the master and stable branch, all the continuous integration is based on this branch. Nothing should be pulled request on this branch.
- develop: this is the main development branch for Glances 4.x. The pull request for new features should be done on this branch.
- release/glances2: this is the maintenance branch for Glances 3.x. Only hotfix pull request could be done on this branch.
Taking a few minutes before writing any code will save everyone time — yours and the maintainers'.
- Find or create an issue. All contributions (bug fixes, new features, refactoring) must be linked to an open issue. Browse the issue tracker and look for issues tagged with the next milestone.
- Claim the issue. Leave a short message in the issue thread to let the community know you are working on it. This avoids duplicate efforts and wasted PRs.
- Discuss the scope first for large changes. If your contribution involves a significant architectural change, a new plugin, or a modification to the public API, please describe your approach in the issue before writing code. A quick alignment with the maintainers avoids having a large PR rejected late in the review process.
- One issue = one branch = one PR. Keep your contribution focused. A PR that fixes a bug and adds an unrelated feature at the same time is much harder to review and more likely to introduce regressions.c.
First of all, you have to fork the Glances repository to your computer using the Fork button on the upper right side of the Github Web site.
Then clone locally using the following command line:
git clone git@github.com:USERNAME/glances.git
Note: replace USERNAME by your Github login name.
Add the main repository as upstream
git remote add upstream git@github.com:nicolargo/glances.git
Uv should be installed on your system (if it is not the case, follow this link: https://docs.astral.sh/uv/getting-started/installation/)!
make uv
Create the development environment:
make venv-dev
make venv
Run the unit-test locally:
make test
Run Glances locally:
make run
or run-webserver, ru-server, run-client, run-browser.
Update your repository with the upstream:
git fetch upstream
All new features should be made from the DEVELOP branch.
git checkout develop
Create bug/feature branch:
git checkout -b BRANCHNAME
Note: replace BRANCHNAMEby your bug/feature name (ex: bug/issue666 or feature/issue666)
It's time to code...
Before submitting your PR, please make sure all of the following are true:
-
Linting passes —
make lintandmake formatruns without errors -
All tests pass —
make testruns without failures -
New behaviour is tested — if you fixed a bug or added a feature, add or update the relevant unit tests in
unitest.py -
Configuration changes are documented — if you added a new config key, document it in
glances/config/glances.confwith a comment -
API changes are reflected in the OpenAPI spec — if you modified a REST endpoint, update
docs/api/openapi.jsonaccordingly -
Your commit messages are meaningful — use the format
Short description - #ISSUE_NUMBER(e.g.Fix AMD GPU plugin under Snap confinement - #1234)
If all the points are ok, commit your branch:
git commit -a -m "Description - #6666"
Get latest works from others developer:
git fetch
git rebase develop feature/issue666
Push it:
git push -u origin feature/issue666
Send a message (in the relative issue thread), your code will be review by the Glances team. When all is good, use the pull request function in GitHub to propose your new feature.
Use uv:
uv add --optional <optional group> <newdep>
See optional groups list in the pyproject.toml file (project.optional-dependencies section).
Be sure that:
- the dependency is compliant with Glances license
- is up to date (for cyber security reason)
- is compatible with all operating system (if not, it should be managed in the code)