You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/05/27 12:02:56 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request, #3815: Test aws-secrets-manager extension with Localstack #3741

JiriOndrusek opened a new pull request, #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815

   fixes https://github.com/apache/camel-quarkus/issues/3741
   
   This is not a complete coverage of the aws-secrets-manager component:
   
   - Test for operation `replicateSecretToRegions` is commented, because it causes internal error on localStack (it might be caused by missing configuration - needs to be investigated)
   - class `SecretsManagerPropertiesFunction` is not covered. As you can see [here](https://github.com/apache/camel/blob/main/components/camel-aws/camel-aws-secrets-manager/src/main/java/org/apache/camel/component/aws/secretsmanager/SecretsManagerPropertiesFunction.java#L91), aws client is configured from properties and url_override is not there. It has to be investigated how to cover this functionality.
   
   I changed `quarkus/test/support/aws2/Aws2TestEnvContext.java]` to support secrets-manager, but it means that it supports **aws-** (not aws**2**-..) component. I think that better approach would be to rename module to support/aws/ or create a new module for aws(not 2). On the other hand it would be a bigger change because a few lines of the code.
   
   I'm keeping this PR as draft and would like to ask, whether I should: 
   
   1. Create separated module for support-aws(not 2)
   2. Rename current suuport/aws2/ to support/aws/
   3. Keep changes as it is
   
   Before I mark this draft as prepared to merge, I'll create tickets for missing parts of the test coverage.
   
   
   <!-- Uncomment and fill this section if your PR is not trivial
   [ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
   [ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] jamesnetherton merged pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
jamesnetherton merged PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#issuecomment-1155112365

   The follow-up ticket is https://github.com/apache/camel-quarkus/issues/3848


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] jamesnetherton commented on pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#issuecomment-1149905175

   > but it means that it supports **aws-** (not aws**2**-..) component
   
   Could we not deal with this in `AwsSecretsManagerTestEnvCustomizer`? And do the property renaming in there (I.e remove old put new)?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] zbendhiba commented on pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
zbendhiba commented on PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#issuecomment-1166982947

   > @zbendhiba This PR is prepared to be merged. James suggested to move part of the code to a different location, which renders my question obsolete. I already switched from draft to ready for merge and i created a ticket with follow-up work - #3848
   
   thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#issuecomment-1161636630

   @zbendhiba  This PR is prepared to be merged.
   James suggested to move part of the code to different location, which renders my question obsolete.
   I already switched from draft to ready for merge and i created a ticket with follow-up work - https://github.com/apache/camel-quarkus/issues/3848


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] jamesnetherton commented on a diff in pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on code in PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#discussion_r896764048


##########
integration-tests-jvm/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.aws.secrets.manager.it;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvContext;
+import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer;
+import org.testcontainers.containers.localstack.LocalStackContainer.Service;
+
+public class AwsSecretsManagerTestEnvCustomizer implements Aws2TestEnvCustomizer {
+
+    @Override
+    public Service[] localstackServices() {
+        return new Service[] { Service.SECRETSMANAGER };
+    }
+
+    @Override
+    public void customize(Aws2TestEnvContext envContext) {
+
+        //get all properties from the context
+        Map<String, String> props = envContext.getProperies();

Review Comment:
   Yes, exactly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#issuecomment-1161641210

   There might be problem with the failing CDI tests, I will look at it in the next days. (the change of the common part of aws-test-support seems like it shouldn't cause this error, but I'll verify it)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] zbendhiba commented on pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
zbendhiba commented on PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#issuecomment-1161595240

   Hello @JiriOndrusek. What are the pending tasks for this PR?
   Are there any responses for these questions mentioned in your PR message
   ```
   1. Create separated module for support-aws(not 2)
   2. Rename current suuport/aws2/ to support/aws/
   3. Keep changes as it is
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] JiriOndrusek commented on a diff in pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on code in PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#discussion_r898113719


##########
integration-tests-jvm/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.aws.secrets.manager.it;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvContext;
+import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer;
+import org.testcontainers.containers.localstack.LocalStackContainer.Service;
+
+public class AwsSecretsManagerTestEnvCustomizer implements Aws2TestEnvCustomizer {
+
+    @Override
+    public Service[] localstackServices() {
+        return new Service[] { Service.SECRETSMANAGER };
+    }
+
+    @Override
+    public void customize(Aws2TestEnvContext envContext) {
+
+        //get all properties from the context
+        Map<String, String> props = envContext.getProperies();

Review Comment:
   Thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] JiriOndrusek commented on a diff in pull request #3815: Test aws-secrets-manager extension with Localstack #3741

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on code in PR #3815:
URL: https://github.com/apache/camel-quarkus/pull/3815#discussion_r896736883


##########
integration-tests-jvm/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.aws.secrets.manager.it;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvContext;
+import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer;
+import org.testcontainers.containers.localstack.LocalStackContainer.Service;
+
+public class AwsSecretsManagerTestEnvCustomizer implements Aws2TestEnvCustomizer {
+
+    @Override
+    public Service[] localstackServices() {
+        return new Service[] { Service.SECRETSMANAGER };
+    }
+
+    @Override
+    public void customize(Aws2TestEnvContext envContext) {
+
+        //get all properties from the context
+        Map<String, String> props = envContext.getProperies();

Review Comment:
   @jamesnetherton I put the logic into the test customizer. Is this the place you are suggesting?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org