Skip to content

Commit

Permalink
Switch to standard OpenSearch gradle build (opensearch-project#1888)
Browse files Browse the repository at this point in the history
* Switch to standard OpenSearch gradle build

* 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>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
  • Loading branch information
peternied authored and stephen-crawford committed Nov 10, 2022
1 parent 09304de commit 9bd0fbf
Show file tree
Hide file tree
Showing 91 changed files with 2,107 additions and 1,696 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 9bd0fbf

Please sign in to comment.