Skip to content

Commit

Permalink
[Backport 2.x] Switch to standard OpenSearch gradle build (opensearch…
Browse files Browse the repository at this point in the history
…-project#1903)

* Switch to standard OpenSearch gradle build (opensearch-project#1888)

* Rewrote build.gradle to follow OpenSearch plugin standards
  * Enabled license headers check on the repository
  * Did not enable several new repository checks
  * Added maven publishing for security
  * Removed excess forced dependency resolutions
  * Rebuilt projects dependencies, release plugin binary has the exact same dependencies and versions
  * Converted dependencies into runtime dependencies to avoid use during coding
  * Converted dependencies from project wide to test only dependencies
  * jackson-databind version comes from OpenSearch
  * Replaced handmade build manifest with git properties to automated version used by OpenSearch
* Added license headers to files that were missing them
* Checkstyle improvements
  * Disable checkstyle checks that are not errors
  * Moved checkstyle file into directory off of the project root
* Moved standard configuration directory
* Using default test running from OpenSearch
  * Switched to RandomizedTest as the base test class
  * Parameterized test runner cannot be used with RandomizedTest converted test functionality
  * Fixed tests resource issues, added new fields to make this consistent in the codebase
  * Fixed issue with leaky environment variable for security root directory, refactored usage
  * Removed unneeded setDefaultUncaughtExceptionHandler in tests
  * Fixed issues with deprecated internal reflection from Mockito
  * Disabled ThreadLeak detection as it is catching real issues that are mitigated by retries
* Initial pass on non-inclusive terminology, commented out exclusions
* Removed test dependency on scala
* Removed test dependency on legacy xmlsecurity library

Signed-off-by: Peter Nied <petern@amazon.com>
(cherry picked from commit 03a224d)

* Fix build break from cluster manager changes

Signed-off-by: Peter Nied <petern@amazon.com>

Co-authored-by: Peter Nied <petern@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and peternied authored Jun 24, 2022
1 parent 681b4a8 commit 3acc29f
Show file tree
Hide file tree
Showing 89 changed files with 2,104 additions and 1,693 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ jobs:
echo ${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}
echo ${{ env.TEST_QUALIFIER }}
- run: ./gradlew clean assemble && test -s ./build/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION }}.jar
- run: ./gradlew clean assemble && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION }}.zip

- run: ./gradlew clean assemble -Dbuild.snapshot=false && test -s ./build/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_NO_SNAPSHOT }}.jar
- run: ./gradlew clean assemble -Dbuild.snapshot=false && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_NO_SNAPSHOT }}.zip

- run: ./gradlew clean assemble -Dbuild.snapshot=false -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}.jar
- run: ./gradlew clean assemble -Dbuild.snapshot=false -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}.zip

- run: ./gradlew clean assemble -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}-SNAPSHOT.jar
- run: ./gradlew clean assemble -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}-SNAPSHOT.zip

- name: List files in the build directory if there was an error
run: ls -al ./build/
run: ls -al ./build/distributions/
if: failure()
Loading

0 comments on commit 3acc29f

Please sign in to comment.