Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Non-Inclusive Language] Replace isDevClusterMaster with isDevClusterManager #1719

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

manasvinibs
Copy link
Member

@manasvinibs manasvinibs commented Jun 10, 2022

Signed-off-by: manasvis manasvis@amazon.com

Description

Coming from opensearch-project/OpenSearch#2589.

OpenSearch repository is going to replace the terminology "master" with "cluster manager".
issue: opensearch-project/OpenSearch#472 (comment), with the plan for its terminology replacement.

In this change we are replacing the instances of the terminology "isDevClusterMaster" with "isDevClusterManager".

Issues Resolved

#1690

Parent #1318

Check List

  • New functionality includes testing.
    • All tests pass
      • yarn test:jest
      • yarn test:jest_integration
      • yarn test:ftr
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

@manasvinibs manasvinibs requested a review from a team as a code owner June 10, 2022 22:31
@joshuarrrr
Copy link
Member

link checker failure can be ignored as false positive; https://sass-lang.com/blog/libsass-is-deprecated still works fine.

@@ -113,7 +113,7 @@ export class Env {
* Indicates that this OpenSearch Dashboards instance is run as development Node Cluster master.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should also be updated to match the new property name.

@@ -82,7 +82,7 @@ export async function bootstrap({
const env = Env.createDefault(REPO_ROOT, {
configs,
cliArgs,
isDevClusterMaster: isMaster && cliArgs.dev && features.isClusterModeSupported,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the update to isMaster covered by a different issue/PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! I've added alias to the 'isMaster' referenced from @types/node modules.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change or use alias for isMaster? I think it is defined in node cluster index which is not the code we write/control. If it is something we import, do we have to rename?

Reference: https://nodejs.org/docs/latest-v14.x/api/cluster.html#cluster_cluster_ismaster

@manasvinibs
Copy link
Member Author

link checker failure can be ignored as false positive; https://sass-lang.com/blog/libsass-is-deprecated still works fine.

Thanks Josh! Where can I find more information on the exact link that has failed the link check?

@manasvinibs manasvinibs force-pushed the Issue-1690 branch 2 times, most recently from 3b9461b to 1fe6799 Compare June 13, 2022 21:11
@kavilla
Copy link
Member

kavilla commented Jun 14, 2022

Thanks for this @manasvinibs,

One immediate feedback would be can we add the details that you add in the PR in the commit details? This is more inclusive on details without having to navigate to the PR.

Copy link
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Please add support for isDevClusterMaster and isDevClusterManager for minor version change. Mark the master one as deprecated and update the commit description to have more information.

Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @manasvinibs for starting the cleaning up. I agree with Rocky that we need to keep both env.isDevClusterMaster and env.isDevClusterManager in env.options to not break current cx usage. Meanwhile, I think isMaster doesn't need to rename. Because it is a function from node which is not controlled by us and is imported from node cluster index.

import { isMaster } from 'cluster';

@@ -82,7 +82,7 @@ export async function bootstrap({
const env = Env.createDefault(REPO_ROOT, {
configs,
cliArgs,
isDevClusterMaster: isMaster && cliArgs.dev && features.isClusterModeSupported,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change or use alias for isMaster? I think it is defined in node cluster index which is not the code we write/control. If it is something we import, do we have to rename?

Reference: https://nodejs.org/docs/latest-v14.x/api/cluster.html#cluster_cluster_ismaster

src/core/server/http/http_service.ts Show resolved Hide resolved
kavilla
kavilla previously approved these changes Jun 15, 2022
@kavilla
Copy link
Member

kavilla commented Jun 15, 2022

LGTM thanks! Only thing I'm a little bit confused about is the Unverified on the commit. I would just make sure you are signing the commit with the email and name you signed up with Github.

Just another NIT, the commit message exceeds the 50 character limit. But I wouldn't block this PR for that.

Comment on lines 149 to 150
this.isDevClusterMaster = options.isDevClusterMaster;
this.isDevClusterManager = options.isDevClusterManager;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to add too many cooks to this, because this PR is in fine shape, but I think it's worthwhile for us as a team to have a good playbook for deprecating public interfaces, because this isn't the only time we're going to have to do this (and we will still have more PRs for non-inclusive language). But generally the approach I'd favor is

  1. Add the new external interfaces (isDevClusterManager, in this case)
  2. Mark the old interfaces deprecated (isDevClusterMaster)
  3. Make all internal properties read from both, with a priority of the new interface (this.isDevClusterManager = options.isDevClusterManager || options.isDevClusterMaster). That way the fallback logic is not spread throughout the codebase.
  4. Duplicate any existing tests of the old interface for the new one, so that, until we deprecate, both are covered independently. (Depending on the type of deprecation, we may also want to test that the priority order from 3. works correctly if both interfaces are used and they conflict.)

We're already doing steps 1 and 2, so the difference is in 3 and 4. There's an argument that this approach may make the eventual removal/cleanup more difficult, but I think it's a bit of a toss up. Curious for the rest of the team's perspective on the above.

For this purpose of this PR, it would mean changing this line, removing subsequent fallbacks (!(this.coreContext.env.isDevClusterMaster || this.coreContext.env.isDevClusterManager);) and adding additional tests.

Copy link
Member Author

@manasvinibs manasvinibs Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial thought with this was if I have a new interface field introduced without having to touch the old one, felt more safer option to not break things for the downstream dependencies which might be consuming the old field as it is! But thinking through it and realizing the 'internal' tag on the internal properties, it make sense to go with 3rd point to be more clean and precise. Good call out on point 4 to include tests for the new interface property added. I can update the PR.

For this purpose of this PR, it would mean changing this line, removing subsequent fallbacks (!(this.coreContext.env.isDevClusterMaster || this.coreContext.env.isDevClusterManager);) and adding additional tests.

@manasvinibs
Copy link
Member Author

LGTM thanks! Only thing I'm a little bit confused about is the Unverified on the commit. I would just make sure you are signing the commit with the email and name you signed up with Github.

Just another NIT, the commit message exceeds the 50 character limit. But I wouldn't block this PR for that.

Yeah I think it was an issue with conflicting user name used while creating GPG key. I got this one fixed. It should be 'verified' when I update my PR.

@manasvinibs manasvinibs marked this pull request as draft June 16, 2022 21:30
@manasvinibs manasvinibs marked this pull request as ready for review June 16, 2022 22:59
ananzh
ananzh previously approved these changes Jun 17, 2022
Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

})
);

expect(defaultEnv).toMatchSnapshot('env properties');
expect(defaultEnv.isDevClusterManager).toBeTruthy();
Copy link
Member

@kavilla kavilla Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 62 says false but this is expected to be truthy this is because isDevClusterMaster is true then we expect isDevClusterManager to be true right? That's great. Can we have a test for the invert. Like isDevClusterManager is set to true. What's the expected behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 62 says false but this is expected to be truthy this is because isDevClusterMaster is true then we expect isDevClusterManager to be true right? That's great. Can we have a test for the invert. Like isDevClusterManager is set to true. What's the expected behavior?

Updated

…evClusterManager

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
@joshuarrrr joshuarrrr merged commit 1dda730 into opensearch-project:main Jun 17, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 17, 2022
…evClusterManager (#1719)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
(cherry picked from commit 1dda730)
kavilla pushed a commit that referenced this pull request Jun 20, 2022
…evClusterManager (#1719)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
(cherry picked from commit 1dda730)
kavilla pushed a commit that referenced this pull request Jun 22, 2022
…evClusterManager (#1719)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
(cherry picked from commit 1dda730)
kavilla pushed a commit that referenced this pull request Jun 22, 2022
…evClusterManager (#1719) (#1762)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
(cherry picked from commit 1dda730)

Co-authored-by: Manasvini B Suryanarayana <manasvis@amazon.com>
cliu123 pushed a commit to cliu123/OpenSearch-Dashboards that referenced this pull request Jun 30, 2022
…evClusterManager (opensearch-project#1719) (opensearch-project#1762)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
(cherry picked from commit 1dda730)

Co-authored-by: Manasvini B Suryanarayana <manasvis@amazon.com>
cliu123 pushed a commit to cliu123/OpenSearch-Dashboards that referenced this pull request Jun 30, 2022
…evClusterManager (opensearch-project#1719) (opensearch-project#1762)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories

In this change we are deprecating the terminology "isDevClusterMaster" and adding  "isDevClusterManager" for future usages.

Signed-off-by: manasvinibs <manasvis@amazon.com>
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
(cherry picked from commit 1dda730)

Co-authored-by: Manasvini B Suryanarayana <manasvis@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Non-Inclusive Language] Replace isDevClusterMaster with isDevClusterManager
4 participants