Skip to content

Commit bb14058

Browse files
balasankarcAlexand
andcommitted
Merge branch '7807-clarify-when-we-are-safe-to-remove-omnibus-deprecation-messages' into 'master'
Clarify and track removal of deprecation messages and features Closes #7807 See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6914 Merged-by: Balasankar 'Balu' C <[email protected]> Approved-by: Evan Read <[email protected]> Approved-by: Balasankar 'Balu' C <[email protected]> Reviewed-by: Balasankar 'Balu' C <[email protected]> Reviewed-by: Evan Read <[email protected]> Co-authored-by: João Cunha <[email protected]>
2 parents 1c9a748 + b670416 commit bb14058

File tree

2 files changed

+113
-9
lines changed

2 files changed

+113
-9
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Read me first!
3+
4+
Before you create a new issue, please make sure to search in https://gitlab.com/gitlab-org/omnibus-gitlab/issues,
5+
to verify that the issue you are about to submit isn't a duplicate.
6+
-->
7+
8+
## Remove deprecation messages
9+
10+
<!--
11+
List here the deprecation messages you want to remove.
12+
-->
13+
14+
### Preparation when creating the Issue
15+
16+
- [ ] List all the [Remove deprecation messages](#remove-deprecation-messages) section all the deprecations you want to remove.
17+
- [ ] Set the milestone of this issue to [next planned required stop](https://docs.gitlab.com/ee/update/index.html#upgrade-paths), which should be after
18+
the milestone when the configuration will be removed.
19+
20+
### Preparation when executing the Issue
21+
22+
- [ ] Verify that the related configuration got indeed removed in a previous milestone.
23+
- [ ] Make sure the MR removing the deprecation message is released on a [required stop](https://docs.gitlab.com/ee/update/index.html#upgrade-paths)
24+
which is later than the removal of the configuration.

doc/development/adding-deprecation-messages.md

Lines changed: 89 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,31 @@ group: Distribution
44
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
55
---
66

7-
# Adding deprecation messages
7+
# Omnibus GitLab deprecation process
8+
9+
Besides following the [GitLab deprecation guidelines](https://about.gitlab.com/handbook/product/gitlab-the-product/#deprecations-removals-and-breaking-changes), we should also add deprecation messages
10+
to the Omnibus GitLab package.
11+
12+
Notifying GitLab administrators of the deprecation and removal of features through deprecation messages consists of:
13+
14+
1. [Addding deprecation messages](#adding-deprecation-messages).
15+
1. [Tracking the removal of deprecation messages](#tracking-the-removal-of-deprecation-messages).
16+
1. [Tracking the removal of the feature](#track-the-removal-of-the-feature).
17+
1. [Removing deprecation messages](#removing-deprecation-messages).
18+
19+
## You must know
20+
21+
Before you add a deprecation message, make sure to read:
22+
23+
- [When can a feature be deprecated](https://docs.gitlab.com/ee/development/deprecation_guidelines/#when-can-a-feature-be-deprecated).
24+
- [Omnibus GitLab deprecation policy](https://docs.gitlab.com/ee/administration/package_information/deprecation_policy.html).
25+
26+
## Adding deprecation messages
827

928
We store a list of deprecations associated with it in the `list` method of
1029
[`Gitlab::Deprecations` class](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/package/libraries/deprecations.rb)
1130
If a configuration has to be deprecated, it has to be added to that list with
12-
proper details.
13-
14-
## Example
31+
proper details. For example:
1532

1633
```ruby
1734
deprecations = [
@@ -33,18 +50,81 @@ deprecations = [
3350

3451
### `config_keys`
3552

36-
`config_keys` represents a list of keys, which can be used to traverse the configuration hash available from `/opt/gitlab/embedded/nodes/{fqdn}.json` to reach a specific configuration. For example `%w(mattermost log_file_directory)` means `mattermost['log_file_directory']` setting. Similarly, `%w(gitlab nginx listen_addresses)` means `gitlab['nginx']['listen_addresses']`. We internally convert it to `nginx['listen_addresses']`, which is what we use in `/etc/gitlab/gitlab.rb`.
53+
`config_keys` represents a list of keys, which can be used to traverse the configuration hash available
54+
from `/opt/gitlab/embedded/nodes/{fqdn}.json` to reach a specific configuration.
55+
For example `%w(mattermost log_file_directory)` means `mattermost['log_file_directory']` setting.
56+
Similarly, `%w(gitlab nginx listen_addresses)` means `gitlab['nginx']['listen_addresses']`.
57+
We internally convert it to `nginx['listen_addresses']`, which is what we use in `/etc/gitlab/gitlab.rb`.
3758

3859
### `deprecation`
3960

40-
`deprecation` is where you set the `<major>.<minor>` version that deprecated the change. Starting in that version, running `gitlab-ctl reconfigure` will warn that the setting is being removed in the `removal` version, and it will display the provided `note`.
61+
`deprecation` is where you set the `<major>.<minor>` version that deprecated the change.
62+
Starting in that version, running `gitlab-ctl reconfigure` will warn that the setting is being removed in the `removal`
63+
version, and it will display the provided `note`.
4164

4265
### `removal`
4366

44-
`removal` is where you set the `<major>.<minor>` version that will no longer support the change at all. This should almost always be a major release. The Omnibus package runs a script at the beginning of installation that ensures you don't have any removed configuration in your settings. The install will fail early, before making any changes, if it finds configuration that is no longer supported.
67+
`removal` is where you set the `<major>.<minor>` version that will no longer support the change at all.
68+
This should almost always be a major release. The Omnibus package runs a script at the beginning of installation that ensures you don't have any removed configuration in your settings. The install will fail early, before making any changes, if it finds configuration that is no longer supported. Similarly, running `gitlab-ctl reconfigure` will also check the `gitlab.rb` file for removed configs. This is to tackle situations where users simply copy `gitlab.rb` from an older instance to a newer one.
4569

4670
### `note`
4771

48-
`note` is part of the deprecation message provided to users during `gitlab-ctl reconfigure`. Use this area to inform users of how to change their settings, often by linking to new documentation, or in the case of a settings rename, telling them what the new setting name should be.
72+
`note` is part of the deprecation message provided to users during `gitlab-ctl reconfigure`.
73+
Use this area to inform users of how to change their settings, often by linking to new documentation,
74+
or in the case of a settings rename, telling them what the new setting name should be.
75+
76+
## Tracking the removal of deprecation messages
77+
78+
Deprecation messages **should not** be cleaned up together with removals, because even after the removal they protect upgrades
79+
where an administrator tries to upgrade to the version where the key got removed, but they have not yet migrated all
80+
the old configuration.
81+
82+
Upgrades do this by running the `Gitlab::Deprecations.check_config` method, which compares existing
83+
configuration against their scheduled removal date, before allowing the GitLab package to be updated.
84+
85+
Additionaly, we have users who might skip multiple GitLab versions when upgrading. For that reason, we recommend deprecation
86+
messages to only be removed in the next planned required stop following the removal milestone, as per our
87+
[upgrade paths](https://docs.gitlab.com/ee/update/index.html#upgrade-paths). For example:
88+
89+
- A deprecation message was added in 15.8.
90+
- The old configuration was removed from the codebase in 16.0.
91+
- The deprecation messages should be removed in 16.3, as this is the next planned required stop.
92+
93+
To track the removal of deprecation messages:
94+
95+
1. Create a follow-up issue using the `Remove Deprecation Message` issue template.
96+
1. Add a comment next to your deprecation message with a link to the follow-up issue to remove the message. For example:
97+
98+
```ruby
99+
{
100+
config_keys: ...
101+
deprecation: '15.8', # Remove message Issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/XYZ
102+
removal: '16.0',
103+
note: "..."
104+
},
105+
```
106+
107+
## Track the removal of the feature
108+
109+
Define the correct milestone to remove the feature you want to deprecate, based on the [you must know](#you-must-know)
110+
section above. Then create a follow-up issue to track the removal of the feature, and add a comment
111+
beside the `removal` key informing which issue is tracking its removal. For example:
112+
113+
```ruby
114+
{
115+
config_keys: ...
116+
deprecation: '15.8', # Remove message Issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/1
117+
removal: '16.0', # Removal issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/2
118+
note: "..."
119+
},
120+
```
121+
122+
The follow-up issue should be set to the milestone in which the feature is expected to be removed.
123+
124+
## Removing deprecation messages
125+
126+
When the messages are ready to be removed you should:
49127

50-
Once the version where the setting is removed is out of the [maintenance window](https://docs.gitlab.com/ee/policy/maintenance.html#gitlab-release-and-maintenance-policy), the deprecation message can be removed from the codebase.
128+
1. Make sure the deprecated configuration was indeed removed in a previous milestone.
129+
1. Make sure the message removal is being released in a required stop milestone later than the one that removed the configuration.
130+
1. Open an MR to remove the deprecation messages and to close the follow-up issue.

0 commit comments

Comments
 (0)