Skip to content

[Feature/extensions] Removed Job Scheduler dependencies from AD#647

Merged
saratvemulapalli merged 31 commits intoopensearch-project:feature/extensionsfrom
owaiskazi19:remove-js
Sep 9, 2022
Merged

[Feature/extensions] Removed Job Scheduler dependencies from AD#647
saratvemulapalli merged 31 commits intoopensearch-project:feature/extensionsfrom
owaiskazi19:remove-js

Conversation

@owaiskazi19
Copy link
Copy Markdown
Member

@owaiskazi19 owaiskazi19 commented Aug 30, 2022

Description

This PR:

  • Removes Job Scheduler dependency from build.gradle dependencies
  • Removes Job Scheduler dependency from the codebase
  • Removes Job Scheduler from extended plugin
  • Removes all features except Creating Detector from AD
  • Removes test related to other features
  • Fixes running GHA build on feature branches
  • Publish OpenSearch feature/extensions branch in GHA
  • Used custom distribution url to build AD
  • Deleted DCO check since we have the DCO app now

Before running the feature/extensions branch of AD:

  1. The feature/extensions branch of OpenSearch with 3.0.0-SNAPSHOT should be published to mavenLocal.
  2. Assemble OpenSearch feature/extensions branch
  3. Run AD with the custom distribution url
./gradlew build -PcustomDistributionUrl=/home/ubuntu/OpenSearch/distribution/archives/linux-tar/build/distributions/opensearch-min-3.0.0-SNAPSHOT-linux-x64.tar.gz 

Issues Resolved

opensearch-project/opensearch-sdk-java#113

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
@owaiskazi19 owaiskazi19 requested a review from a team August 30, 2022 23:51
@owaiskazi19 owaiskazi19 changed the title Removed Job Scheduler dependencies from AD [Feature/extensions] Removed Job Scheduler dependencies from AD Aug 30, 2022
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
@saratvemulapalli
Copy link
Copy Markdown
Member

@owaiskazi19 is this ready for review?

@owaiskazi19
Copy link
Copy Markdown
Member Author

@owaiskazi19 is this ready for review?

Still working on the build errors.

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 2, 2022

Codecov Report

❗ No coverage uploaded for pull request base (feature/extensions@572fd8d). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                  Coverage Diff                  @@
##             feature/extensions     #647   +/-   ##
=====================================================
  Coverage                      ?   53.80%           
  Complexity                    ?     2679           
=====================================================
  Files                         ?      288           
  Lines                         ?    16004           
  Branches                      ?     1703           
=====================================================
  Hits                          ?     8611           
  Misses                        ?     6768           
  Partials                      ?      625           
Flag Coverage Δ
plugin 53.80% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@minalsha
Copy link
Copy Markdown

minalsha commented Sep 8, 2022

@saratvemulapalli @dbwiddis this PR is ready for review. Please help reviewing this to unblock other dependent workitems. Thanks

Copy link
Copy Markdown
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Overall the changes look good to me.
Just put in tags for the commented piece of code, it will help when we get back to AD main merging to feature/extensions

@@ -212,93 +212,93 @@ test {

// Commented this code until Job Scheduler is published to https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/ with OpenSearch 3.0.0-SNAPSHOT

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a tag for every piece of commented code which should help understand why we have removed it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment for rest of the code changes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done!

description 'OpenSearch anomaly detector plugin'
classname 'org.opensearch.ad.AnomalyDetectorPlugin'
extendedPlugins = ['lang-painless', 'opensearch-job-scheduler']
extendedPlugins = ['lang-painless']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🥳

Copy link
Copy Markdown
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

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

Approved with suggestions.

// XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);
// return AnomalyDetectorJob.parse(parser);
// };
// }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FYI, mentioning this once but applies for most of the files. Using /*- at the start of a block comment preserves the formatting of everything until */ and reduces the diff noise. Not sure whether that makes it easier or harder to review, but something to consider in the future when commenting out large blocks.

}

}
/// *
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like we commented out the entire file (including the copyright header). Some q's:

  1. Will that break license header checks?
  2. Pretty sure we should keep at least the package definition and class name. Surprised this compiles otherwise.
  3. If this is totally unneeded, is it ever actually called by anything? Why not delete it or give it a name like "UnusedIndexAnomaly...."

Copy link
Copy Markdown
Member Author

@owaiskazi19 owaiskazi19 Sep 8, 2022

Choose a reason for hiding this comment

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

  1. No, the build passed
  2. ^^
  3. The reason I didn't delete it because we will rebase feature/extensions with the latest main later and these files will be needed. Even, I thought of having a different name for these files but since they import dependencies from Job Scheduler it fails during compile.

return profileList.stream().map(profile -> profile.getName()).collect(Collectors.toSet());
}
}
/// *
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same questions as before re: commenting out an entire file vs. just leaving it (possibly renaming) and not using it.

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
@saratvemulapalli saratvemulapalli merged commit b176ae5 into opensearch-project:feature/extensions Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants