summaryrefslogtreecommitdiffstats
path: root/tests/lcitool/libvirt-ci/docs/platforms_and_mappings.rst
blob: 4351da30ca2a08d509dcf0a92a48c802771924ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Contributing platforms && package mappings
==========================================

In case we don't know about the OS distro/build pre-requisite that is desired
to be tested, please file an
`issue <https://gitlab.com/libvirt/libvirt-ci/-/issues/new>`__ . It's important
to file an issue first to avoid duplication of work since it will alert other
people who might have an interest in the same area. The other benefit is that
you'll get feedback from the maintainers on any tips to ease the addition.

The process of adding a new OS distribution is largely the same as adding a
package dependency with only a few differing details, but for the sake of
clarity and simplicity we document both processes separately.
Assuming there is agreement to the change you wish to make and you're willing
to take up on the task then depending on the type of contribution please
proceed with the following.

Adding a new OS distribution
----------------------------

In case you'd like to add a new OS distribution then:

#. Fork the project.

#. Add metadata under ``lcitool/facts/targets/``
   for the new OS distro. Have a look at the structure we use, pick a target
   OS that's closest to what you're adding, copy-paste the configuration and
   edit the relevant bits.
   Note that further code changes may be needed as well if the OS distro
   you're adding uses a package format we currently don't know about.
   Maintainers will advise on what to do in that case.

#. Edit the ``lcitool/facts/mappings.yml`` file to update all the
   existing package entries, providing details of the new OS distro.

#. Run the unit tests with::

   $ python3 -m pytest --regenerate-output

   Note that ``--regenerate-output`` serves at your convenience because it will
   automatically add a valid test output for your newly-added OS so that
   you don't have to dump the ordered list of all the correct package names
   by hand. Be careful though as you could inject other invalid test output
   data as well and proclaiming them as valid!

#. Commit the changes and submit a merge request. Try splitting the changes
   logically into multiple commits.

#. CI pipeline will run to validate the changes to the ``mappings.yml``
   are correct by attempting to install all the packages from the file on all
   OS distributions this project currently knows about
   (including the one you're adding)

#. Once the merge request is accepted, go back to your original project's
   repo where you want to consume your change and update the
   ``ci/manifest.yml`` file there to reflect the change you have made in this
   project.

#. From the root of the original project's git repository run::

   $ lcitool manifest

Adding a new package mapping
----------------------------

In order to simply add a new package mapping:

#. Fork the project.

#. Edit the ``lcitool/facts/mappings.yml`` file to add your desired
   mapping.

#. Add the package mapping to the respective project's config file under
   ``lcitool/facts/projects/``.

#. Run the unit tests with::

   $ python3 -m pytest --regenerate-output

   Note that ``--regenerate-output`` serves at your convenience because it will
   automatically add a valid test output for your newly-added mapping so that
   you don't have correct the list of package mappings in the test output
   by hand. Be careful though as you could inject other invalid test output
   data as well and proclaiming them as valid!

#. Commit the changes and submit a merge request. Try splitting the changes
   logically into multiple commits.

#. CI pipeline will run to validate the changes to the ``mappings.yml``
   are correct by attempting to install all the packages from the file
   (including the one you're adding) on all OS distributions this project
   currently knows about.

#. Once the merge request is accepted, go back to your original project's
   repo  and from the root of the original project's git run::

   $ lcitool manifest