Skip to content
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

feat(scripts): use bash to call openapi #3980

Merged

Conversation

Anilople
Copy link
Contributor

@Anilople Anilople commented Sep 12, 2021

What's the purpose of this PR

Provide basic functions to call openapi with bash scripts.

User can use it directly without write by self.

Which issue(s) this PR fixes:

Fixes #3941

Brief changelog

file:

  • .gitattributes: add *.sh text eol=lf, let .sh file end with *nix style line \n.
  • scripts/openapi/bash/openapi.sh: bash functions, user can use them.
  • scripts/openapi/bash/openapi-usage-example.sh: a example to show how to use those bash functions.

run

cd scripts/openapi/bash
bash -x openapi-usage-example.sh

to view the result of bash scripts.

In bash scripts, use here document to make json string more readable.

Only cluster's get and create, if it is ok, more functions will be added in the feature.

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

@Anilople Anilople added the area/openapi apollo-openapi label Sep 12, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2021

Codecov Report

Merging #3980 (5ed18d8) into master (0b5d227) will increase coverage by 0.34%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3980      +/-   ##
============================================
+ Coverage     50.76%   51.11%   +0.34%     
- Complexity     2468     2482      +14     
============================================
  Files           475      476       +1     
  Lines         14600    14681      +81     
  Branches       1521     1521              
============================================
+ Hits           7412     7504      +92     
+ Misses         6661     6651      -10     
+ Partials        527      526       -1     
Impacted Files Coverage Δ
...openapi/client/service/AbstractOpenApiService.java 92.85% <0.00%> (-0.90%) ⬇️
...enapi/client/exception/ApolloOpenApiException.java 100.00% <0.00%> (ø)
.../apollo/openapi/client/url/OpenApiPathBuilder.java 90.74% <0.00%> (ø)
...ollo/openapi/client/service/AppOpenApiService.java 48.27% <0.00%> (+0.27%) ⬆️
.../openapi/client/service/ClusterOpenApiService.java 93.10% <0.00%> (+1.43%) ⬆️
...penapi/client/service/NamespaceOpenApiService.java 83.07% <0.00%> (+3.83%) ⬆️
.../openapi/client/service/ReleaseOpenApiService.java 82.00% <0.00%> (+5.07%) ⬆️
...llo/openapi/client/service/ItemOpenApiService.java 74.28% <0.00%> (+5.68%) ⬆️
...mework/apollo/portal/component/PortalSettings.java 65.62% <0.00%> (+7.81%) ⬆️
...ctrip/framework/apollo/core/utils/StringUtils.java 82.35% <0.00%> (+17.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b5d227...5ed18d8. Read the comment docs.

@nobodyiam
Copy link
Member

shall we also update the open api usage document?

@Anilople
Copy link
Contributor Author

Anilople commented Sep 13, 2021

shall we also update the open api usage document?

Of course. I will update it later.

@nobodyiam
Copy link
Member

and also the CHANGES.md..

@nobodyiam
Copy link
Member

please also update the open api usage document

@Anilople
Copy link
Contributor Author

please also update the open api usage document

Document has already been updated, is there more doc need to be add?

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nobodyiam nobodyiam merged commit debf749 into apolloconfig:master Sep 18, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2021
@nobodyiam nobodyiam added this to the 1.10.0 milestone Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/openapi apollo-openapi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openapi add bash scripts usage example
3 participants