cli/CONTRIBUTING.md

134 lines
4.4 KiB
Markdown
Raw Normal View History

## Developer Certificate of Origin + License
2020-07-29 00:38:46 +00:00
Contributions to this repository are subject to the [Developer Certificate of Origin](https://docs.gitlab.com/ee/legal/developer_certificate_of_origin.html#developer-certificate-of-origin-version-11).
2020-07-29 00:38:46 +00:00
All Documentation content that resides under the [docs/ directory](/docs) of this
repository is licensed under Creative Commons:
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
2020-07-29 00:38:46 +00:00
_This notice should stay as the first item in the CONTRIBUTING.md file._
---
Thank you for your interest in contributing to the GitLab CLI! This guide details how to contribute
to this extension in a way that is easy for everyone. These are mostly guidelines, not rules.
Use your best judgement, and feel free to propose changes to this document in a merge request.
2020-07-29 00:38:46 +00:00
Please do:
2020-10-09 14:49:26 +00:00
* Check existing issues to verify that the bug or feature request has not already been submitted.
* Open an issue if things aren't working as expected.
* Open an issue to propose a significant change.
2022-09-23 13:53:50 +00:00
* Open an issue to propose a feature.
* Open a merge request to fix a bug.
* Open a merge request to fix documentation about a command.
* Open a merge request for an issue and leave a comment claiming it.
2020-10-09 14:49:26 +00:00
Please avoid:
* Opening merge requests for issues marked `blocked`.
* Opening merge requests for documentation for a new command specifically. Manual pages are auto-generated from source after every release
## Code of Conduct
We want to create a welcoming environment for everyone who is interested in contributing. Visit our [Code of Conduct page](https://about.gitlab.com/community/contribute/code-of-conduct/) to learn more about our commitment to an open and welcoming environment.
2020-07-29 00:38:46 +00:00
## Getting Started
### Building the project
2020-07-29 00:38:46 +00:00
Prerequisites:
2021-11-03 23:57:08 +00:00
- Go 1.16+
2020-07-29 00:38:46 +00:00
2021-06-10 20:11:21 +00:00
Build with: `make` or `go build -o bin/glab ./cmd/glab/main.go`
2020-07-29 00:38:46 +00:00
Run the new binary as: `./bin/glab`
2021-06-21 06:30:22 +00:00
Run tests with: `make test` or `go test ./...`
2020-10-09 14:49:26 +00:00
2021-06-21 06:30:22 +00:00
> WARNING: Do not run `make test` outside of an isolated environment, it will overwrite your global config.
### Submitting a merge request
2020-07-29 00:38:46 +00:00
1. Create a new branch: `git checkout -b my-branch-name`
2020-10-09 14:49:26 +00:00
1. Make your change, add tests, and ensure tests pass
1. Submit a merge request
2020-07-29 00:38:46 +00:00
## Commit Messages
2020-07-29 00:38:46 +00:00
2021-06-21 06:30:22 +00:00
### TL;DR: Your commit message should be semantic
2020-07-29 00:38:46 +00:00
A commit message consists of a header, a body and a footer, separated by a blank line.
2022-09-13 19:30:16 +00:00
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read as well as in various git tools.
2021-06-21 06:30:22 +00:00
```sh
<type>[optional scope]: <description>
<BLANK LINE>
[optional body]
<BLANK LINE>
<footer>
```
### Message Header
Ideally, the commit message heading which contains the description, should not be more than 50 characters
The message header is a single line that contains a succinct description of the change containing a type, an optional scope, and a subject.
2021-06-21 06:30:22 +00:00
#### `<type>`
This describes the kind of change that this commit is providing
- feat (feature)
- fix (bug fix)
- docs (documentation)
- style (formatting, missing semicolons, …)
- refactor(restructuring codebase)
- test (when adding missing tests)
- chore (maintain)
2021-06-21 06:30:22 +00:00
#### `<scope>`
Scope can be anything specifying the place of the commit change. For example events, kafka, userModel, authorization, authentication, loginPage, etc
#### `<description>`
2021-06-21 06:30:22 +00:00
This is a very short description of the change
* `use imperative, present tense: “change” not “changed” nor “changes”`
* `don't capitalize the first letter`
* `no dot (.) at the end`
### Message Body
- just as in subject use imperative, present tense: “change” not “changed” nor “changes”
- includes motivation for the change and contrasts with previous behavior
2021-06-21 06:30:22 +00:00
<http://365git.tumblr.com/post/3308646748/writing-git-commit-messages>
2021-06-21 06:30:22 +00:00
<http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>
### Message Footer
Finished, fixed or delivered stories should be listed on a separate line in the footer prefixed with "Finishes", "Fixes" , or "Delivers" keyword like this:
`[(Finishes|Fixes|Delivers) #ISSUE_ID]`
### Message Example
2021-06-21 06:30:22 +00:00
```sh
feat(kafka): implement exactly once delivery
- ensure every event published to kafka is delivered exactly once
- implement error handling for failed delivery
Delivers #065
```
2021-06-21 06:30:22 +00:00
```sh
fix(login): allow provided user preferences to override default preferences
- This allows the preferences associated with a user account to override and customize the default app preference like theme, timezone e.t.c
Fixes #025
```