|
| 1 | +# Contributing to GrimoireLab Sorting Hat |
| 2 | + |
| 3 | +These are some general guidelines and information related to how we contribute to |
| 4 | +GrimoireLab. You can read about it from the [CONTRIBUTING.md](https://github.com/chaoss/grimoirelab/blob/master/CONTRIBUTING.md). |
| 5 | + |
| 6 | +## Changelog Entries |
| 7 | + |
| 8 | +Some of your contributions will require a changelog entry which explains |
| 9 | +the motivation of the change. These entries would be included in the |
| 10 | +release notes to explain users and developers about the new features |
| 11 | +or bugs fixed in the software. This is an example of changelog entry: |
| 12 | + |
| 13 | +``` |
| 14 | +title: 'Fix bug casting spells on magicians' |
| 15 | +category: fixed |
| 16 | +author: John Smith <[email protected]> |
| 17 | +issue: 666 |
| 18 | +notes: > |
| 19 | + The bug was making impossible to cast a spell on |
| 20 | + a magician. |
| 21 | +``` |
| 22 | + |
| 23 | +Changelog entries will be written to explain *what* was changed and *why*, |
| 24 | +not *how*. Take into account not everybody is a developer and they are |
| 25 | +meant to reach a wider audience. |
| 26 | + |
| 27 | +### What warrants a changelog entry |
| 28 | + |
| 29 | +Changelog entries are **required** for: |
| 30 | +- Code changes that directly affects the GrimoireLab users. |
| 31 | +- Bug fixes. |
| 32 | +- New updates. |
| 33 | +- Performance improvements. |
| 34 | + |
| 35 | +Changelog entries are **not required** for |
| 36 | +- Docs-only (e.g., README.md) changes. |
| 37 | +- Developer-facing change (e.g., test suite changes). |
| 38 | +- Code refactoring. |
| 39 | + |
| 40 | +### Writing changelog entries |
| 41 | + |
| 42 | +These changelog entries should be written to the `releases/unreleased/` |
| 43 | +directory. The file is expected to be a [YAML](https://yaml.org/) file |
| 44 | +in the following format: |
| 45 | + |
| 46 | +``` |
| 47 | +title: 'Fix bug casting spells on magicians' |
| 48 | +category: fixed |
| 49 | +author: John Smith <[email protected]> |
| 50 | +issue: 666 |
| 51 | +notes: > |
| 52 | + The bug was making impossible to cast a spell on |
| 53 | + a magician. |
| 54 | +``` |
| 55 | + |
| 56 | +The `title` field has the name of the change. This is a mandatory field. |
| 57 | + |
| 58 | +The `category` field maps the category of the change, valid options are: |
| 59 | +added, fixed, changed, deprecated, removed, security, performance, other. |
| 60 | +This field is mandatory. |
| 61 | + |
| 62 | +The `author` key (format: `Your Name <[email protected]>`) is used to |
| 63 | +give attribution to community contributors. This is an optional field but |
| 64 | +the Community contributors are encouraged to add their names. |
| 65 | + |
| 66 | +The `issue` value is a reference to the issue, if any, that is targeted |
| 67 | +with this change. This is an optional field. |
| 68 | + |
| 69 | +The `notes` field should have a description explaining the changes in the |
| 70 | +code. Remember you can write blocks of text using the `>` character at the |
| 71 | +beginning of each block. See the above given example. |
| 72 | + |
| 73 | +Contributors can use the interactive [changelog](https://github.com/Bitergia/release-tools#changelog) |
| 74 | +tool for this purpose which generates the changelog entry file automatically. |
| 75 | + |
| 76 | +### Tips for writing good changelog entries |
| 77 | + |
| 78 | +A good changelog entry should be descriptive and concise. It should explain |
| 79 | +the change to a reader who has *zero context* about the change. If you have |
| 80 | +trouble making it both concise and descriptive, err on the side of descriptive. |
| 81 | + |
| 82 | +Use your best judgment and try to put yourself in the mindset of someone |
| 83 | +reading the compiled changelog. Does this entry add value? Does it offer |
| 84 | +context about *what* and *why* the change was made? |
| 85 | + |
| 86 | +#### Examples |
| 87 | + |
| 88 | +- **Bad:** Go to a project order. |
| 89 | +- **Good:** Show a user’s starred projects at the top of the “Go to project” dropdown. |
| 90 | + |
| 91 | +The first example provides no context of where the change was made, or why, or |
| 92 | +how it benefits the user. |
| 93 | + |
| 94 | +- **Bad:** Copy (some text) to clipboard. |
| 95 | +- **Good:** Update the “Copy to clipboard” tooltip to indicate what’s being copied. |
| 96 | + |
| 97 | +Again, the first example is too vague and provides no context. |
| 98 | + |
| 99 | +- **Bad:** Fixes and Improves CSS and HTML problems in mini pipeline graph and builds dropdown. |
| 100 | +- **Good:** Fix tooltips and hover states in mini pipeline graph and builds dropdown. |
| 101 | + |
| 102 | +The first example is too focused on implementation details. The user doesn’t care |
| 103 | +that we changed CSS and HTML, they care about the result of those changes. |
| 104 | + |
| 105 | +- **Bad:** Strip out `nil`s in the Array of Commit objects returned from `find_commits_by_message_with_elastic` |
| 106 | +- **Good:** Fix 500 errors caused by Elasticsearch results referencing garbage-collected commits |
| 107 | + |
| 108 | +The first example focuses on *how* we fixed something, not on *what* it fixes. |
| 109 | +The rewritten version clearly describes the *end benefit* to the user |
| 110 | +(fewer 500 errors), and *when* (searching commits with Elasticsearch). |
0 commit comments