You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/gettingstarted/contributingtocode.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,13 @@ Before starting to write your first piece of code, please get familiar with the
19
19
and also check for more detailed instructions from your [PWG](../advanced-specifics/README.md).
20
20
```
21
21
22
-
```tip
23
-
See the [Tools](../tools/README.md) section for suggestions on tools that can make your work with the O2Physics analysis framework much more effective.
22
+
```note
23
+
See the [Tools](../tools/README.md) section for further instructions and for suggestions on tools that can make your work with the O2Physics analysis framework much more effective.
24
24
```
25
25
26
26
In order to contribute new code to the central repository, please follow these steps:
27
27
28
+
- Update your O2Physics installation.
28
29
- If you are adding a new workflow:
29
30
- Place your `cxx` file in the appropriate directory (see the [O2Physics repository structure](theo2physicsrepo.md)).
30
31
- Add the workflow compilation instructions in the `CMakeLists.txt` (you can clone one of the existing `o2physics_add_dpl_workflow` blocks).
@@ -33,7 +34,10 @@ In order to contribute new code to the central repository, please follow these s
33
34
- Make sure the compilation of your code does not produce any errors or warnings.
34
35
- In case you added a new workflow, the newly created executable will have the name you specified on the `o2physics_add_dpl_workflow` line, prefixed with `o2-analysis-<xx>-`, where `<xx>` corresponds to the `PWG<XX>` folder your file is in.
35
36
- Test your code.
37
+
- Verify that the new code runs successfully and without warnings or errors.
38
+
- Validate the output of the new code.
36
39
- Commit your changes and push them to your remote fork repository on GitHub.
40
+
- See [How to write a Git commit message](../gettingstarted/gitbasics.md#how-to-write-a-git-commit-message).
37
41
-[Create a pull request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
38
42
from your fork repository to the main repository.
39
43
@@ -64,9 +68,19 @@ __Keep pull requests small and focused.__
64
68
65
69
__Give your pull request a short and meaningful title.__
66
70
67
-
- The title should be informative enough to give an idea of _what_ was changed and _where_.
71
+
- The title should be a brief summary of _what_ was changed and _where_.
72
+
- To specify _where_, you can use a prefix with the name of the file or of the analysis or of the framework component.
73
+
- A tag prefix with names of concerned directories is added automatically. (See [Automatic checks](#automatic-checks).) It can be extended with additional details using `,` (e.g. JIRA ticket) or `/` (for subdirectory names).
- Further details (e.g. _why_ this change is needed or related links) can be provided in the description below the title.
69
76
- Examples of too vague titles: "Test", "Fix bug", "Add new parameter", "Update cuts", "Improve code".
77
+
- See [How to write a Git commit message](../gettingstarted/gitbasics.md#how-to-write-a-git-commit-message).
78
+
79
+
__Do not duplicate pull requests.__
80
+
81
+
- Duplicating a PR duplicates review efforts and usage of testing resources and it almost certainly does not solve your problem.
82
+
- Use `git push` to update your PR. (Avoid `--force` if possible. See [Pull request review](#pull-request-review).)
83
+
- Exception: Replacing a PR makes sense, if the PR contains unwanted unrelated changes which have notified unrelated code owners and you want to stop spamming them further.
70
84
71
85
### Automatic checks
72
86
@@ -83,6 +97,8 @@ The CI checks evaluate:
83
97
- Labeler: Assigns [labels](https://github.com/AliceO2Group/O2Physics/labels) to the PR based on which parts of the code base were modified.
84
98
- Title prefix checker: Verifies that the title of the PR has a valid prefix with tags corresponding to the labels. If a valid prefix is not found, it is created.
85
99
100
+
__In general, a PR should not be merged if it does not pass all checks, unless there are good reasons to ignore the errors and warnings.__
101
+
86
102
Checks flagged as "Required" must succeed before a PR can be merged.
87
103
88
104
The compilation checks ("build/...") run only on PRs marked as ready for review (i.e. not on draft PRs).
@@ -100,6 +116,9 @@ _You do not have to format your (C++ and Python) code manually_.
100
116
- Or you can use [pre-commit hooks](../tools/README.md#pre-commit-hooks) to format your code automatically when you make a commit.
101
117
```
102
118
119
+
PRs are marked as stale after 30 days of no activity and closed 5 days later if still inactive.
120
+
(Events unrelated to the commit history (e.g. automatic comments from failed builds) can reset the timestamp which can prevent obsolete PRs from getting closed automatically.)
0 commit comments