Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/CONTRIBUTING.md is written in an unsupported language. File is not indexed.

0001 # Contribution guidelines
0002 
0003 Contributions to the Acts project are very welcome and feedback on the
0004 documentation is greatly appreciated.
0005 
0006 ## đŸ—Ŗī¸ Communication channels
0007 
0008 - [âœ‰ī¸ acts-developers@cern.ch](https://e-groups.cern.ch/e-groups/Egroup.do?egroupName=acts-developers):
0009   For discussions about
0010 
0011   - Announcement of about developer meetings and workshops
0012   - Occasionally news about the project
0013 
0014 - [đŸ’Ŧ Mattermost channel](https://mattermost.web.cern.ch/acts/)
0015   - Informal discussion on ACTS
0016   - The *General* general is the best place to ask questions!
0017 
0018 ## 🐛 Bug reports and feature requests
0019 
0020 To report an issue and before starting work, please create an issue in the
0021 [GitHub issue tracker](https://github.com/acts-project/acts/issues). A
0022 comprehensive explanation will help the development team to respond in a timely
0023 manner. Verbalising the issue before starting work allows the other contributors
0024 to chime in and avoids disagreements how to progress.
0025 
0026 - The title should summarise the issue
0027 - Describe the issue in as much detail as possible in the comment
0028 
0029 GitHub does not allow editing labels, assignees or setting milestone to
0030 non-members of a project with at least "Triage" permission. These will have to
0031 be set by members with Triage permission after an issue/PR is created.
0032 Guidelines regarding labels, assignees and milestone therefore only concern
0033 members of acts-project with the necessary rights and can be ignored by others.
0034 
0035 - Assign to yourself or leave empty
0036 - Choose labels as appropriate
0037 
0038   - Type of issue
0039   - Which component is affected
0040   - Urgency
0041   - Fix versions
0042 
0043 - Bug reports
0044 
0045   - Mention affected version(s)
0046   - Issue type: `Bug`
0047   - A detailed description of the bug including a recipe on how to
0048     reproduce it and any hints which may help diagnosing the problem
0049 
0050 - Feature requests
0051 
0052   - Issue type: `Improvement` or `Feature`
0053   - A detailed description of the feature request including possible
0054     use cases and benefits for other users
0055 
0056 ## đŸ› ī¸ Make a contribution
0057 
0058 Anyone is welcome to contribute to Acts. Below is a short description how to
0059 contribute. If you have any questions, feel free to ask [acts-developers@cern.ch](mailto:acts-developers@cern.ch) for help or guidance.
0060 
0061 Please always fork the Acts repository you want to work on and create branches
0062 only in your own fork. Once you want to share your work, create a Pull Request
0063 (PR) (for gitlab users: equivalent to merge request) to the main branch of the
0064 upstream acts-project repository. If it is not yet ready to be merged in, please
0065 create a draft pull request (by clicking on the small arrow on the green "create
0066 pull request" button) to mark it work in progress. Once you want your branch to
0067 be merged in, request a review from the [reviewers team](https://github.com/orgs/acts-project/teams/reviewers). Once a draft merge
0068 request is reviewed, it can be merged in.
0069 
0070 To get started with git, please refer to the [short introduction](https://git-scm.com/docs/gittutorial) as well as the [full git documentation](https://git-scm.com/doc). Tutorials as well as explanations of concepts and
0071 workflows with git can also be found on [Atlassian](https://www.atlassian.com/git/).
0072 
0073 ### âœ”ī¸ Checklist for pull requests
0074 
0075 - Your branch has been rebased on the target branch and can be
0076   integrated through a fast-forward merge.
0077 - A detailed description of the pull request is provided.
0078 - The issue the PR closes is linked.
0079 - All CI jobs pass.
0080 - All newly introduced functions and classes have been documented
0081   properly with doxygen.
0082 - Unit tests are provided for new functionalities.
0083 - For bugfixes: a test case has been added to avoid the re-appearance
0084   of this bug in the future.
0085 
0086 ### 🔁 Workflow recommendations
0087 
0088 In the following a few recommendations are outlined which should help you to get
0089 familiar with development process in the Acts project.
0090 
0091 1. **Each development in its own branch of your private fork!**
0092 
0093    Write access for developers has been disabled for developers on
0094    acts-project. Therefore, always start by creating your own fork and
0095    creating branches there. You should start a new branch for every
0096    development and all work which is logically/conceptually linked
0097    should happen in one branch. Try to keep your branches short. This
0098    helps immensely to understand the git history if you need to look at
0099    it in the future and helps reviewers of your code. If projects are
0100    complex (e.g. large code refactoring or complex new features), you
0101    may want to use *sub*-branches from the main development branch.
0102 
0103 2. **Never, ever directly work on any "official" branch!**
0104 
0105    Though not strictly necessary and in the end it is up to you, it is strongly
0106    recommended that you never commit directly on a branch which tracks
0107    an "official" branch. As all branches are equal in git, the
0108    definition of "official" branch is quite subjective. In the Acts
0109    project you should not work directly on branches which are
0110    **protected** in the repository. Usually, these are the *main* and
0111    *release/X.Y.Z* branches. The benefit of this strategy is that you
0112    will never have problems to update your fork. Any git merge in your
0113    local repository on such an "official" branch will always be a
0114    fast-forward merge.
0115 
0116 3. **Use atomic commits!**
0117 
0118    Similarly to the concept of branches, each
0119    commit should reflect a self-contained change. Try to avoid overly
0120    large commits (bad examples are for instance mixing logical change
0121    with code cleanup and typo fixes).
0122 
0123 4. **Write good commit messages!**
0124 
0125    Well-written commit messages are key
0126    to understand your changes. There are many guidelines available on
0127    how to write proper commit logs (e.g.
0128    [here](https://alistapart.com/article/the-art-of-the-commit),
0129    [here](https://cbea.ms/git-commit/), or
0130    [here](https://wiki.openstack.org/wiki/GitCommitMessages#Information_in_commit_messages)).
0131    As a short summary:
0132 
0133    - Structure your commit messages into short title (max 50
0134      characters) and longer description (max width 72 characters)! This
0135      is best achieved by avoiding the `commit -m` option. Instead
0136      write the commit message in an editor/git tool/IDE...
0137    - Describe why you did the change (git diff already tells you what
0138      has changed)!
0139    - Mention any side effects/implications/consequences!
0140 
0141 5. **Prefer git pull --rebase!**
0142 
0143    If you work with a colleague on a new
0144    development, you may want to include their latest changes. This is
0145    usually done by calling `git pull` which will synchronise your
0146    local working copy with the remote repository (which may have been
0147    updated by your colleague). By default, this action creates a merge
0148    commit if you have local commits which were not yet published to the
0149    remote repository. These merge commits are considered to contribute
0150    little information to the development process of the feature and they
0151    clutter the history (read more e.g.
0152    [here](https://www.atlassian.com/blog/it-teams/stop-foxtrots-now)
0153    or
0154    [here](https://fangpenlin.com/posts/2013/09/30/keep-a-readable-git-history/)).
0155    This problem can be avoided by using `git pull --rebase` which
0156    replays your local (un-pushed) commits on the tip of the remote
0157    branch. You can make this the default behaviour by running
0158    `git config pull.rebase true`. More about merging vs rebasing can
0159    be found
0160    [here](https://www.atlassian.com/git/tutorials/merging-vs-rebasing/).
0161 
0162 6. **Update the documentation!**
0163 
0164    Make sure that the documentation is
0165    still valid after your changes. Perform updates where needed and
0166    ensure integrity between the code and its documentation.
0167 
0168 #### â„šī¸ Example: Make a bugfix while working on a feature
0169 
0170 During the development of a new feature you discover a bug which needs
0171 to be fixed. In order to not mix bugfix and feature development, the
0172 bugfix should happen in a different branch. The recommended procedure
0173 for handling this situation is the following:
0174 
0175 1. Get into a clean state of your working directory on your feature
0176    branch (either by committing open changes or by stashing them).
0177 2. Checkout the branch the bugfix should be merged into (either *main*
0178    or *release/X.Y.Z*) and get the most recent version.
0179 3. Create a new branch for the bugfix.
0180 4. Fix the bug, write a test, update documentation etc.
0181 5. Open a pull request for the bug fix.
0182 6. Switch back to your feature branch.
0183 7. Merge your local bugfix branch into the feature branch. Continue your
0184    feature development.
0185 8. Eventually, the bugfix will be merged into *main*. Then, you can
0186    rebase your feature branch on main which will remove all duplicate
0187    commits related to the bugfix.
0188 
0189 #### â„šī¸ Example: Backporting a feature or bugfix
0190 
0191 Suppose you have a bugfix or feature branch that is eventually going to
0192 be merged in `main`. You might want to have the feature/bugfix
0193 available in a patch (say `0.25.1`) tag. To to that, find the
0194 corresponding release branch, for this example that would be
0195 `release/v0.25.X`. You must create a dedicated branch that **only**
0196 contains the commits that relate to your feature/bugfix, otherwise the
0197 PR will contain all other commits that were merged into main since the
0198 release was branched off. With that branch, open a PR to that branch,
0199 and make it clear that it is a backport, also linking to a potential
0200 equivalent PR that targets `main`.
0201 
0202 ### 💄 Coding style and guidelines
0203 
0204 The Acts project uses
0205 [clang-format](https://clang.llvm.org/docs/ClangFormat.html) for
0206 formatting its source code. A `.clang-format` configuration file comes
0207 with the project and should be used to automatically format the code.
0208 Developers can use the provided Docker image to format their project or
0209 install clang-format locally. Developers should be aware that
0210 clang-format will behave differently for different versions, so
0211 installing the same clang version as used in the
0212 CI is recommended. There are several instructions available on how to
0213 integrate clang-format with your favourite IDE (e.g. [Xcode](https://github.com/travisjeffery/ClangFormat-Xcode),
0214 [emacs](https://clang.llvm.org/docs/ClangFormat.html#emacs-integration)).
0215 The Acts CI system will automatically check code formatting using the
0216 provided clang-format configuration and will notify incompatible formatting.
0217 
0218 In addition, some conventions are used in Acts code, details can be
0219 found [here](https://acts.readthedocs.io/en/latest/codeguide.html).
0220 For Doxygen documentation, please follow these recommendations:
0221 
0222 - Put all documentation in the header files.
0223 - Use `///` as block comment (instead of `/* ... */`).
0224 - Doxygen documentation goes in front of the documented entity (class,
0225   function, (member) variable).
0226 - Use the `@<cmd>` notation.
0227 - Document all (template) parameters using @(t)param and explain the
0228   return value for non-void functions. Mention important conditions
0229   which may affect the return value.
0230 - Use `@remark` to specify pre-conditions.
0231 - Use `@note` to provide additional information.
0232 - Link other related entities (e.g. functions) using `@sa`.
0233 
0234 ### 💡 Tips for users migrating from GitLab
0235 
0236 - The most obvious difference first: What is called Merge Request
0237   in GitLab is called Pull Request (PR) in GitHub.
0238 - Once your PR is ready to be merged, request a review by the users in
0239   the [reviewers team](https://github.com/orgs/acts-project/teams/reviewers)
0240 - As Acts started enforcing using your own fork with the switch to
0241   GitHub, developers no longer have write access to the upstream
0242   repository.
0243 - The CI will fail if a PR does not yet have the required approvals.
0244 
0245 ## đŸ›‹ī¸ Review other contributions
0246 
0247 Acts requires that every pull request receives at least one review by a member
0248 of the reviewers team before being merged but anyone is welcome to contribute
0249 by commenting on code changes. You can help reviewing proposed contributions by
0250 going to the
0251 ["pull requests" section](https://github.com/acts-project/acts/pulls)
0252 of the Acts (core) GitHub repository.
0253 
0254 As some of the guidelines recommended here require rights granted to the
0255 reviewers team, this guide specifically addresses the people in this
0256 team. The present contribution guide should serve as a good indication
0257 of what we expect from code submissions.
0258 
0259 ### Approving a pull request
0260 
0261 - Does its title and description reflect its contents?
0262 - Do the automated continuous integration tests pass without problems?
0263 - Have all the comments raised by previous reviewers been addressed?
0264 
0265 If you are confident that a pull request is ready for integration,
0266 please make it known by clicking the "Approve pull request" button of
0267 the GitHub interface. This notifies other members of the Acts team of
0268 your decision, and marks the pull request as ready to be merged.
0269 
0270 ### Merging a pull request
0271 
0272 If you have been granted write access on the Acts repository, you can
0273 merge a pull request into the Acts main branch after it has been
0274 approved.
0275 
0276 GitHub may warn you that a "Fast-forward merge is not possible". This
0277 warning means that the pull request has fallen behind the current Acts
0278 main branch, and should be updated through a rebase. Please notify the
0279 pull request author in order to make sure that the latest main changes
0280 do not affect the pull request, and to have it updated as appropriate.
0281 
0282 For a PR that is behind main, a button "Update branch" may appear.
0283 This should NOT be used as it merges instead of rebasing, which is not
0284 our workflow.