Skip to content

Commit eabab8c

Browse files
matejmatuskapirat89
authored andcommitted
docs: Add doc about community upgrades
The existing coding and PR workflow guidelines are split into separate pages under "Contrbuting" and the new doc is added there as well. Jira: RHEL-110563
1 parent 37a071d commit eabab8c

File tree

5 files changed

+107
-53
lines changed

5 files changed

+107
-53
lines changed

docs/source/contrib-and-devel-guidelines.md renamed to docs/source/contributing/coding-guidelines.md

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Contribution and development guidelines
2-
## Code guidelines
1+
# Coding guidelines
32

43
Your code should follow the [Python Coding Guidelines](https://leapp.readthedocs.io/en/latest/contributing.html#follow-python-coding-guidelines) used for the leapp project. On top of these rules follow instructions
54
below.
@@ -84,53 +83,3 @@ guaranteed to exist and executable.
8483
The use of the {py:mod}`subprocess` library is forbidden in leapp repositories.
8584
Use of the library would require very good reasoning, why the
8685
{py:func}`~leapp.libraries.stdlib.run` function cannot be used.
87-
88-
## Commits and pull requests (PRs)
89-
### PR description
90-
The description should contain information about all introduced changes:
91-
* What has been changed
92-
* How it has been changed
93-
* The reason for the change
94-
* How could people try/test the PR
95-
* Reference to a Jira ticket, Github issue, ... if applicable
96-
97-
Good description provides all information for readers without the need to
98-
read the code. Note that reviewers can decline to review the PR with a poor
99-
description.
100-
101-
### Commit messages
102-
When your pull-request is ready to be reviewed, every commit needs to include
103-
a title and a body continuing a description of the change --- what problem is
104-
being solved and how. The end of the commit body should contain Jira issue
105-
number (if applicable), GitHub issue that is being fixed, etc.:
106-
```
107-
Commit title
108-
109-
Commit message body on multiple lines
110-
111-
Jira-ref: <ticket-number>
112-
```
113-
114-
Note that good commit message should provide information in similar way like
115-
the PR description. Poorly written commit messages can block the merge of PR
116-
or proper review.
117-
118-
### Granularity of commits
119-
The granularity of commits depends strongly on the problem being solved. However,
120-
a large number of small commits is typically undesired. If possible, aim a
121-
Git history such that commits can be reverted individually, without requiring reverting
122-
numerous other dependent commits in order to get the `main` branch into a working state.
123-
124-
Note that commits fixing problems of other commits in the PR are expected to be
125-
squashed before the final review and merge of the PR. Using of `git commit --fixup ...`
126-
and `git commit --squash ...` commands can help you to prepare such commits
127-
properly in advance and make the rebase later easier using `git rebase -i --autosquash`.
128-
We suggest you to get familiar with these commands as it can make your work really
129-
easier. Note that when you are starting to get higher number of such fixing commits
130-
in your PR, it's good practice to use the rebase more often. High numbers of such
131-
commits could make the final rebase more tricky in the end. So your PR should not
132-
have more than 15 commits at any time.
133-
134-
### Create a separate git branch for your changes
135-
TBD
136-
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Community upgrades for Centos-like distros
2+
3+
In the past, this project was solely focused on Red Hat Enterprise Linux upgrades. Recently, we've been extending and refactoring the `leapp-repository` codebase to allow upgrades of other distributions, such as CentOS Stream and also upgrades + conversions between different distributions in one step.
4+
5+
This document outlines the state of support for upgrades of distributions other than RHEL. Note that support in this case doesn't mean what the codebase allows, but what the core leapp team supports in terms of issues, bugfixes, feature requests, testing, etc.
6+
7+
RHEL upgrades and upgrades + conversions *to* RHEL are the only officially supported upgrade paths and are the primary focus of leapp developers. However, we are open to and welcome contributions from the community, allowing other upgrade (and conversion) paths in the codebase. For example, we've already integrated a contribution introducing upgrade paths for Alma Linux upgrades.
8+
9+
This does not mean that we won't offer help outside of the outlined scope, but it is primarily up to the contributors contributing a particular upgrade path to maintain and test it. Also, it can take us some time to get to such PRs, so be patient please.
10+
11+
Upon agreement we can also update the upgrade paths (in `upgrade_paths.json`) when there is a new release of the particular distribution. However note that we might include some upgrade paths required for conversions *to* RHEL on top of that.
12+
13+
Contributions improving the overall upgrade experience are also welcome, as they always have been.
14+
15+
```{note}
16+
By default, upgrade + conversion paths are automatically derived from upgrade paths. If this is not desired or other paths are required, feel free to open a pull request or open a [discussion](https://github.com/oamg/leapp-repository/discussions) on that topic.
17+
```
18+
19+
## How to contribute
20+
21+
Currently, the process for enabling upgrades and conversions for other distributions is not fully documented. In the meantime you can use the [pull request introducing Alma Linux upgrades](https://github.com/oamg/leapp-repository/pull/1391/) as reference. However, note that the leapp upgrade data files have special rules for updates, described below.
22+
23+
### Leapp data files
24+
25+
#### repomap.json
26+
27+
To use correct target repositories during the upgrade automatically, the `repomap.json` data file needs to be updated to cover repositories of the newly added distribution. However, the file cannot be updated manually as its content is generated, hence any manual changes would be overwritten with the next update. Currently there is not straightforward way for the community to update our generators, but you can
28+
29+
- submit a separate PR of how the resulting `repomap.json` file should look like, for an example you can take a look at [this PR](https://github.com/oamg/leapp-repository/pull/1395)
30+
- or provide the list of repositories (possibly also architectures) present on the distribution
31+
32+
and we will update the generators accordingly, asking you to review the result then. We are discussing an improvement to make this more community friendly.
33+
34+
#### pes-events.json and device_driver_deprecation_data.json
35+
36+
Both PES events and device driver deprecation data only contain data for RHEL in the upstream `leapp-repository` and we will not include any data unrelated to RHEL. If you find a bug in the data, you can open a bug in the [RHEL Jira](https://issues.redhat.com/) for the `leapp-repository` component.
37+
38+
Before contributing, make sure your PR conforms to our {doc}`Coding guidelines<coding-guidelines>`
39+
and {doc}`PR guidelines<pr-guidelines>`.

docs/source/contributing/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Contributing
2+
========================================================
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
:caption: Contents:
7+
:glob:
8+
9+
coding-guidelines
10+
pr-guidelines
11+
community-upgrades
12+
13+
.. Indices and tables
14+
.. ==================
15+
..
16+
.. * :ref:`genindex`
17+
.. * :ref:`modindex`
18+
.. * :ref:`search`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Commits and pull requests (PRs)
2+
## PR description
3+
The description should contain information about all introduced changes:
4+
* What has been changed
5+
* How it has been changed
6+
* The reason for the change
7+
* How could people try/test the PR
8+
* Reference to a Jira ticket, Github issue, ... if applicable
9+
10+
Good description provides all information for readers without the need to
11+
read the code. Note that reviewers can decline to review the PR with a poor
12+
description.
13+
14+
## Commit messages
15+
When your pull-request is ready to be reviewed, every commit needs to include
16+
a title and a body continuing a description of the change --- what problem is
17+
being solved and how. The end of the commit body should contain Jira issue
18+
number (if applicable), GitHub issue that is being fixed, etc.:
19+
```
20+
Commit title
21+
22+
Commit message body on multiple lines
23+
24+
Jira-ref: <ticket-number>
25+
```
26+
27+
Note that good commit message should provide information in similar way like
28+
the PR description. Poorly written commit messages can block the merge of PR
29+
or proper review.
30+
31+
## Granularity of commits
32+
The granularity of commits depends strongly on the problem being solved. However,
33+
a large number of small commits is typically undesired. If possible, aim a
34+
Git history such that commits can be reverted individually, without requiring reverting
35+
numerous other dependent commits in order to get the `main` branch into a working state.
36+
37+
Note that commits fixing problems of other commits in the PR are expected to be
38+
squashed before the final review and merge of the PR. Using of `git commit --fixup ...`
39+
and `git commit --squash ...` commands can help you to prepare such commits
40+
properly in advance and make the rebase later easier using `git rebase -i --autosquash`.
41+
We suggest you to get familiar with these commands as it can make your work really
42+
easier. Note that when you are starting to get higher number of such fixing commits
43+
in your PR, it's good practice to use the rebase more often. High numbers of such
44+
commits could make the final rebase more tricky in the end. So your PR should not
45+
have more than 15 commits at any time.
46+
47+
## Create a separate git branch for your changes
48+
TBD

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ providing Red Hat Enterprise Linux in-place upgrade functionality.
2121
upgrade-architecture-and-workflow/index
2222
configuring-ipu/index
2323
libraries-and-api/index
24-
contrib-and-devel-guidelines
24+
contributing/index
2525
faq
2626

2727
.. Indices and tables

0 commit comments

Comments
 (0)