opensearch-project / opensearch-oci-object-storage

OpenSearch Repository Plugin For Oci Object Storage
Apache License 2.0
7 stars 19 forks source link

[BUG] opensearch gradle utility plugin doesn't resolve transient dependencies #35

Closed samuel-oci closed 1 year ago

samuel-oci commented 1 year ago

What is the bug?

OpenSearch gradle plugin seems to be avoiding resolution of transient dependencies for implementation/api configurations. This results in NoClassFound exceptions and other classes missing during operation.

How can one reproduce the bug?

./gradlew :oci-repository-plugin:run then attempt to create a repository

curl -XPUT "http://localhost:9200/_snapshot/oci_repository" -H 'Content-Type: application/json' -d"
{
  \"type\": \"oci\",
  \"settings\": {
    \"client\": \"default\",
    \"region\": \"${OCI_REGION}\",
    \"endpoint\": \"https://objectstorage.${OCI_REGION}.oraclecloud.com\",
    \"bucket\": \"${OCI_BUCKET}\",
    \"namespace\": \"bmc_siem_prod\",
    \"forceBucketCreation\" : true,
    \"bucket_compartment_id\": \"${OCI_BUCKET_COMPARTMENT}\",
    \"userId\" : \"ocid1.user.oc1..aaaaaaaa5vtbkg4omdvni7t67izxphsvmqdnkfhhspn54hvo7n5no65332yq\",
    \"tenantId\" : \"ocid1.tenancy.oc1..aaaaaaaafi4l6qecddifs7kew5uzc24xwvtraosoiyvjgc5rq26nciigrhtq\",
    \"fingerprint\" : \"89:36:28:98:a4:ed:0b:ad:46:90:a8:12:7d:2e:1a:a1\",
    \"credentials_file\": \"${CREDENTIALS_FILE_PATH}\"
  }
}
"

open search logs will show errors such as:

Caused by: java.util.NoSuchElementException: No http provider available; add dependency on one of the oci-java-sdk-common-httpclient-* choices, e.g. oci-java-sdk-common-httpclient-jersey

What is the expected behavior?

expected behavior is for everything in the readme.md examples to just work

What is your host/environment?

will happen on any environment

Do you have any additional context?

It seems that during the tests the transient dependencies from the fixture compensate, therefore it means we will have to add an IT class that perform an external test.

samuel-oci commented 1 year ago

PR merged https://github.com/opensearch-project/opensearch-oci-object-storage/pull/36