backdrop-issues icon indicating copy to clipboard operation
backdrop-issues copied to clipboard

Remove all instances of master/slave terminology from core

Open jackaponte opened this issue 4 years ago • 16 comments

As mentioned in the comments on #4441, in another effort to remove language that is evocative of or drawn from systemic racism, I propose that we remove all instances of "master" and "slave" terminology from Backdrop core. I would suggest using "primary" and "replica" instead, as Drupal did.


State of current PR:

Search for slave

> grep -R "slave" .
./core/includes/database/database.inc:  $legacy = $options['target'] == 'slave';
./core/includes/database/database.inc:  $legacy = $options['target'] == 'slave';
./core/includes/database/database.inc:  $legacy = $options['target'] == 'slave';
./core/includes/database/database.inc:  $legacy = $options['target'] == 'slave';
./core/includes/database/database.inc:  $legacy = $options['target'] == 'slave';
./core/includes/database/database.inc:function db_ignore_slave() {
./core/modules/system/system.module:  if (isset($_SESSION['ignore_slave_server'])) {
./core/modules/system/system.module:    $_SESSION['ignore_replica_server'] = $_SESSION['ignore_slave_server'];
./core/modules/system/system.module:    unset($_SESSION['ignore_slave_server']);

search for master

> grep -R "master" .
core/includes/common.inc:  // https://github.com/GerHobbelt/nicejson-php/blob/master/nicejson.php.
core/includes/file.mimetypes.inc:      58 => 'application/vnd.oasis.opendocument.text-master',
core/misc/ckeditor/CHANGES.md:  Please note that the [`tests/`](https://github.com/ckeditor/ckeditor4/tree/master/tests) directory which contains editor tests is not available in release packages. It can only be found in the development version of CKEditor on [GitHub](https://github.com/ckeditor/ckeditor4/).
core/misc/ckeditor_old/CHANGES.md:  Please note that the [`tests/`](https://github.com/ckeditor/ckeditor4/tree/master/tests) directory which contains editor tests is not available in release packages. It can only be found in the development version of CKEditor on [GitHub](https://github.com/ckeditor/ckeditor4/).
core/misc/jquery.timeentry.js: Licensed under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
core/modules/ckeditor/js/plugins/backdropimage/plugin.js:    // https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/uploadimage/plugin.js
core/modules/file/file.module:    case 'application/vnd.oasis.opendocument.text-master':
core/modules/layout/css/grid-float.css: * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
core/modules/simpletest/tests/system_test.module:  // https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/ServerBag.php#L61
core/modules/views_ui/views_ui.install: * Rename the 'always show master' display setting to 'always show default'.
core/modules/views_ui/views_ui.install:  $value = $config->get('views_ui_show_master_display');
core/modules/views_ui/views_ui.install:  $config->clear('views_ui_show_master_display');
  • NEEDS TESTING WITH REPLICA DATABASE

jackaponte avatar Jun 22 '20 20:06 jackaponte

I can't figure out how to change the labels on this issue; was going for the "milestone candidate - bug" and "type - task" labels that Jen used on #4441!

jackaponte avatar Jun 22 '20 20:06 jackaponte

@jenlampton Any thoughts on how to move this ticket forward similarly to #4441?

jackaponte avatar Jun 29 '20 19:06 jackaponte

@jackaponte I was able to add the labels (though, I had to try three times, they didn't stick at first?) I'll also double check that you are a member of the "Documentation and Organization" team, so that you can add milestones and labels to all issues in this repo. This is supposed to happen automatically any time anyone leaves a comment, but the bot has been broken for years :(

jenlampton avatar Jun 29 '20 19:06 jenlampton

Any thoughts on how to move this ticket forward similarly to #4441?

I think all we need is for someone to file a PR, so... https://github.com/backdrop/backdrop/pull/3177

There are a TON of instances of Master in views, as that's the human-readable name of the default display. This PR attempts to change all the views that are created in .install files, or when installing default views from .json files (so that on a Fresh install, all displays would be named Default instead) but I did not attempt to update all the views that are in tests, or add an update for existing views.

I expect some tests will fail where they are comparing a view in the test to a view that was created by one of the two methods above.

jenlampton avatar Jun 29 '20 20:06 jenlampton

Thanks @jenlampton 🙏 ...the PR LGTM 👍

I cannot speak for any instances not picked up by the PR though - I'm assuming that this was the result of a search/replace initially, so also assuming that we caught them all.

klonos avatar Jun 29 '20 23:06 klonos

Thanks for moving this forward @jenlampton and @klonos!

jackaponte avatar Jul 06 '20 18:07 jackaponte

I'm assuming that this was the result of a search/replace initially, so also assuming that we caught them all.

There are still some instances of "master" referring to views displays, and specific branches of various GitHub repositories (ckeditor, etc) but all instances of "slave" have been removed, with the exception of the backwards-compatible database handling, and a check for the old session variable $_SESSION['ignore_slave_server'] which should both be removed in 2.x.

jenlampton avatar Jul 13 '20 18:07 jenlampton

Cool, let's get this in then. We can always iterate in the future if more instances need to be removed.

klonos avatar Jul 13 '20 19:07 klonos

I found some issues in the current implementation where "replica" was accidentally used in Views config values instead of "default"; that would cause a setting to not be respected.

I think some of @klonos's suggestions are also worthwhile and not too difficult. Feedback left in the PR: https://github.com/backdrop/backdrop/pull/3177

quicksketch avatar Jul 31 '20 04:07 quicksketch

Also at least one documentation page needs tweaking to replace "master/slave" terminology:

  • https://docs.backdropcms.org/database-configuration

laryn avatar Oct 12 '21 13:10 laryn

Wonder how this could fit into our GHA/CI automation. We could look for implementations of linting that allows specifying a list of disallowed words, and make sure that such words (as well as words already removed with the various PRs in #3351) do not slowly creep back into our code.

klonos avatar Oct 12 '21 20:10 klonos

I've cloned @jenlampton's PR and made fixes. Ready for review and testing. https://github.com/backdrop/backdrop/pull/3892

herbdool avatar Jan 04 '22 06:01 herbdool

Is there a good way to test the PR in the sandbox? I can look for terms or phrases I know of in the UI, e.g. the former "Master display" vs. "Default display" in Views, but I guess I don't know more places :-/

olafgrabienski avatar Feb 27 '22 16:02 olafgrabienski

Is there something I can do to help us complete and merge this issue? I'm not really sure if there is much testing to do, mostly I think it needs code review.

stpaultim avatar May 11 '22 05:05 stpaultim

Not much testing, just code review.

herbdool avatar May 11 '22 05:05 herbdool

Which of the 2 PRs available is the one to test/review here? Been a couple of years, and both of them now have conflicts that need to be resolved. Also, we have an instance of master/slave in our settings.php file (thankfully in the comments - not any setting), but none of the PRs fixes that.

Back to "needs work" then.

klonos avatar Aug 23 '22 12:08 klonos

Hey, I would like to get this issue moving again, since it seems to have drifted out of our radar. I'll rebase one of the PRs over the weekend, and I'd like us to iteratively make changes with subsequent PRs rather than expecting to fix everything in one go (which obviously won't work).

klonos avatar May 03 '23 23:05 klonos

It looks like this is pretty close although the PR is expired. It looks like the changes are essentially to replace master/slave with primary/replica or where appropriate default/replica and the one additional place is the settings.php file where it is just in a comment.

izmeez avatar Oct 09 '23 16:10 izmeez

I went ahead and closed https://github.com/backdrop/backdrop/pull/3177 since it's the older PR and improvements have been made in the second PR by @herbdool.

I resolved the conflicts in https://github.com/backdrop/backdrop/pull/3892 so this should be back to ready for review.

quicksketch avatar Oct 09 '23 16:10 quicksketch

Ready for review again. I added a couple words to cspell that it caught - since this PR affects little bits of lots of files, it's not surprising.

herbdool avatar Oct 10 '23 14:10 herbdool

This looks good to me. We need to update the @since line for the version of Backdrop we're targeting, but I can do that on merge.

I would expect this to be a 1.27.0 change, but it is entirely backwards-compatible, so we could do the next bugfix release. What do folks think?

quicksketch avatar Oct 10 '23 18:10 quicksketch

What do folks think?

The former milestones were also bugfix releases, and I think that's okay. But there will be many translation updates, so a minor release seems more appropriate. Also, in a minor release the change will get more visibility.

olafgrabienski avatar Oct 10 '23 19:10 olafgrabienski

I read through the PR and there are actually only 3 changed translations, all of which are administrative-only:

This change in Contact module: [email protected] => [email protected]

And these two strings in Views:

- This will make the query attempt to connect to a slave server if available.  If no slave server is defined or available, it will fall back to the default server.
+ This will make the query attempt to connect to a replica server if available. If no replica server is defined or available, it will fall back to the default server.
- t('Use slave server')
+ t('Use replica server')

There are quite a few changes from Master to Default, but all sites would already have that single word translated. So string-wise I don't think this is a big concern.

quicksketch avatar Oct 10 '23 23:10 quicksketch

So string-wise I don't think this is a big concern.

I agree! (And thanks for looking into it.)

olafgrabienski avatar Oct 11 '23 07:10 olafgrabienski

I have merged this into 1.x and 1.26.x! Yay, this is great. Thanks to everyone in helping remove this language. The final solution is also backwards-compatible until 2.x, when the old settings keys will be removed.

quicksketch avatar Oct 11 '23 20:10 quicksketch

... I'd like us to iteratively make changes with subsequent PRs rather than expecting to fix everything in one go ...

Follow-up issue and PR here: #6262

klonos avatar Oct 13 '23 00:10 klonos

I found a variable name typo that might cause undefined variable notices: https://github.com/backdrop/backdrop-issues/issues/6338. Simple problem for which I filed a PR.

quicksketch avatar Dec 19 '23 21:12 quicksketch