-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Cloud Run + Cloud Endpoints #3406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud Run + Cloud Endpoints #3406
Conversation
I'm reassigning to @averikitsch to review since she's been talking w/ @Aubrey-Y - I'd be particularly careful of how this get's tested including that script. |
If we didn't want to go down that route, which is always an option, an alternative is for the user to just download a swagger 2.0 openapi.json but I haven't explored that avenue. Of course nothing's set in stone and the highest priority is making sure everyone is fully satisfied with how everything works. |
@Aubrey-Y sorry for the slow review. I'm hoping to get to this by the EOW. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Aubrey-Y, thank you again for this contribution. I am impressed by the steps you have created to create the yaml file. Although I am debating if this would be too confusing to teach to others. I would argue for simplifying this a bit by removing your plugin and showing how the spring openapi plugin can get you close to what you need.
- Please add a README structured similarly to our other run samples (example).
- This should link to https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-run for further instructions on running this sample.
- It should have a step for replacing the urls needed and running
mvn verify
to get the yaml. Then a note to update the yaml for the swagger 2.0 spec. - It should have a step for using jib to containerize the app.
- Please add unit tests
- Add a file like https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/run/pubsub/src/main/resources/application.properties
Thanks!
@averikitsch is |
Also, for unit testing, since there is not much function to the controller, would a unit test or two suffice? |
Yeah, one for the controller and one for |
I think you missed my earlier question @averikitsch |
a43b523
to
741996f
Compare
741996f
to
9208039
Compare
7e7fca0
to
b086746
Compare
@lesv @averikitsch just giving this a bump I should note this is in Java 11, not Java 8. I saw some activity in another thread about it so let me know if that should change. |
@@ -0,0 +1,15 @@ | |||
# Copyright 2020 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be needed, since found run/endpoints-v2-backend/src/main/resources/application.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, i will delete application.yml - that means theres no properties file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have this both in /src/main/resources
and /src/test/resources
only the file in /src/main/resources
is needed
run/endpoints-v2-backend/README.md
Outdated
file openapi-run.yaml in this demo project. If you are using an IDE like IntelliJ IDEA Ultimate, after switching the | ||
version number to 2.0, it should tell you what's wrong with the file. | ||
1. Follow the [Getting Started with Endpoints for Cloud Run with ESPv2](https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-run) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe at this point it should start at Deploying the Endpoints configuration
run/endpoints-v2-backend/README.md
Outdated
</properties> | ||
``` | ||
1. Update `<YOUR_HOST_HERE>` and `<YOUR_APP_URI_HERE>` in EndpointsApplication.java. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need more information for these variables. Probably should add that the users needs to follow this section first Reserving a Cloud Run hostname
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review.
Co-authored-by: Averi Kitsch <[email protected]>
@averikitsch I made all of the changes requested with the exception of |
|
Co-authored-by: Averi Kitsch <[email protected]>
… into run-endpoints
@@ -0,0 +1,15 @@ | |||
# Copyright 2020 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this file for test purposes? If not delete
i totally forgot to do that (again?) thanks for catching it |
Fixes #3095
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory onlymvn clean verify
mvn -P lint checkstyle:check
mvn -P lint clean compile pmd:cpd-check spotbugs:check
This pull request is not final. I wanted to get the functional part of the code approved before writing a detailed instructional README.