|
| 1 | +--- |
| 2 | +stage: Systems |
| 3 | +group: Distribution |
| 4 | +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments |
| 5 | +--- |
| 6 | + |
| 7 | +# Upgrading software components |
| 8 | + |
| 9 | +The Linux package is created from a series of software components, some of which |
| 10 | +are developed by GitLab and others which are sourced from free and open source |
| 11 | +projects. Software components can be updated individually as new features, bug |
| 12 | +fixes, and security vulnerabilities become available. |
| 13 | + |
| 14 | +Software component upgrades can be risky, especially when non-backwards |
| 15 | +compatible changes are made. Considering [Semantic versioning](https://semver.org/)], examining changelogs, and examining release |
| 16 | +notes can give a sense of the amount of risk involved in an upgrade. In all |
| 17 | +cases, upgrades should be thoroughly tested before merging. |
| 18 | + |
| 19 | +The [CNG](https://gitlab.com/gitlab-org/build/CNG) project uses some of these |
| 20 | +same software components. Components common to both projects should be updated |
| 21 | +in both. |
| 22 | + |
| 23 | +## Types of software components |
| 24 | + |
| 25 | +There are two types of software components used in the Linux package: |
| 26 | + |
| 27 | +- External software components |
| 28 | +- Internal software components |
| 29 | + |
| 30 | +### External software components |
| 31 | + |
| 32 | +External software components source is downloaded directly from an external site |
| 33 | +or copied from the |
| 34 | +[`omnibus-mirror`](https://gitlab.com/gitlab-org/build/omnibus-mirror) repository. |
| 35 | +A component can be provided using a `git clone`, extracting from a source |
| 36 | +tarball, performing a `gem install` (for Ruby modules), or performing a `pip |
| 37 | +install` (for Python modules). |
| 38 | + |
| 39 | +### Internal software components |
| 40 | + |
| 41 | +Internal software component are developed by GitLab and external contributors. |
| 42 | +Source for internal software components is downloaded from a project's GitLab |
| 43 | +repository. Versions used in a build are set by the Git reference contained in |
| 44 | +the project's corresponding `*VERSION` files. These versions can be overridden |
| 45 | +by environment variables. For more information, see |
| 46 | +[Use specific branches or versions of a GitLab component](../build/team_member_docs.md#use-specific-branches-or-versions-of-a-gitlab-component). |
| 47 | + |
| 48 | +Updates to internal software components are done by merge requests in the |
| 49 | +corresponding repository. |
| 50 | + |
| 51 | +## Internal software component update workflow |
| 52 | + |
| 53 | +A typical workflow for updating an internal software component. |
| 54 | + |
| 55 | +### Create a fork/branch |
| 56 | + |
| 57 | +External contributors should create a fork of the |
| 58 | +[`gitlab-org/omnibus-gitlab`](https://gitlab.com/gitlab-org/omnibus-gitlab) repository. |
| 59 | + |
| 60 | +Create a new branch from the target branch (usually `master` of the |
| 61 | +[`gitlab-org/omnibus-gitlab`](https://gitlab.com/gitlab-org/omnibus-gitlab) repository. |
| 62 | + |
| 63 | +### Modify `config/software/<component.rb>` |
| 64 | + |
| 65 | +1. Find the corresponding configure file for the component that you want to |
| 66 | + update in the `config/software` directory. For example |
| 67 | + `config/software/prometheus.rb` is used for the Prometheus component. |
| 68 | + |
| 69 | +1. Change the version to the version you want to update to. If applicable, also |
| 70 | +change the corresponding `sha256` to the value of the corresponding version |
| 71 | +source tarball. |
| 72 | + |
| 73 | +### Add or modify any required patches |
| 74 | + |
| 75 | +The new component version may require: |
| 76 | + |
| 77 | +- Adding new patches. |
| 78 | +- Removing existing patches. |
| 79 | +- Changing existing patches. |
| 80 | + |
| 81 | +All patch files go in `config/patches/<component name>`. They are then |
| 82 | +referenced in the corresponding `config/software/<component name>.rb` file. |
| 83 | +Examples can be found at: |
| 84 | + |
| 85 | +- [unzip component](https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/master/config/software/unzip.rb) |
| 86 | +- [unzip patches](https://gitlab.com/gitlab-org/omnibus-gitlab/-/tree/master/config/patches/unzip). |
| 87 | + |
| 88 | +### Push branch |
| 89 | + |
| 90 | +Push the branch to the to the upstream repository. |
| 91 | + |
| 92 | +### Create merge request (MR) |
| 93 | + |
| 94 | +Create a merge request using your development branch and the target branch. |
| 95 | + |
| 96 | +### Build |
| 97 | + |
| 98 | +Build the Linux package either: |
| 99 | + |
| 100 | +- Using the CI/CD system. |
| 101 | +- Building locally using [Build local Linux package](../build/build_package.md). |
| 102 | + |
| 103 | +You must build on all architectures using the CI/CD system before a merge |
| 104 | +request for an updated software component can be accepted. |
| 105 | + |
| 106 | +### Test |
| 107 | + |
| 108 | +Install the resulting Linux package and test the component changes. |
| 109 | + |
| 110 | +## Testing software component updates |
| 111 | + |
| 112 | +### Minimum test requirements |
| 113 | + |
| 114 | +At a minimum, the following tests should be performed when updating a software |
| 115 | +component. |
| 116 | + |
| 117 | +- Perform a successful GitLab Enterprise Edition (EE) build on all supported platforms. |
| 118 | +- Run `qa-test` CI/CD test job for both GitLab Enterprise Edition and GitLab Community Edition. |
| 119 | +- Install and verify that component version has been upgraded. |
| 120 | +- Verify basic functionality of the software component. |
| 121 | + |
| 122 | +Additional testing is almost always required and varies depending on the |
| 123 | +software component. |
| 124 | + |
| 125 | +### Test plans |
| 126 | + |
| 127 | +Here are test plans for individual components. They are meant to be copied into |
| 128 | +the merge request where their execution can be recorded. |
| 129 | + |
| 130 | +Not every component is listed here. Please consider creating a merge request to |
| 131 | +add one for a component upgrade that you are working on. Use |
| 132 | +`test-plans/upgrade-component-testplan-template.md` as a starting point. |
| 133 | + |
| 134 | +These test plans are not exhaustive. The might need to be supplemented depending |
| 135 | +on the degree of change made to the component. Record these additions in the |
| 136 | +merge request and consider adding them here. Use the following filename pattern |
| 137 | +when creating the test plan file: |
| 138 | + |
| 139 | +```plaintext |
| 140 | +upgrade-<component-name>-testplan.md |
| 141 | +``` |
| 142 | + |
| 143 | +And add a link in `test-plans/index.md`. |
0 commit comments