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(openapi): create app #32

Merged
merged 18 commits into from
Aug 30, 2023

Conversation

Anilople
Copy link
Contributor

What's the purpose of this PR

Allow user create app via openapi

Which issue(s) this PR fixes:

apolloconfig/apollo#4234

Brief changelog

Add

  • /openapi/v1/apps/create
  • /openapi/v1/env/{env}/apps/create

Just a poc code, please don't merge.

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.

@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #32 (af53e3b) into main (d2eca1f) will increase coverage by 0.07%.
The diff coverage is 40.54%.

@@             Coverage Diff              @@
##               main      #32      +/-   ##
============================================
+ Coverage     68.35%   68.43%   +0.07%     
- Complexity     1193     1202       +9     
============================================
  Files           169      171       +2     
  Lines          5161     5198      +37     
  Branches        561      561              
============================================
+ Hits           3528     3557      +29     
- Misses         1369     1380      +11     
+ Partials        264      261       -3     
Files Changed Coverage Δ
...ramework/apollo/openapi/api/AppOpenApiService.java 0.00% <0.00%> (ø)
...ork/apollo/openapi/client/ApolloOpenApiClient.java 54.83% <0.00%> (+8.17%) ⬆️
...framework/apollo/openapi/dto/OpenCreateAppDTO.java 13.63% <13.63%> (ø)
...ollo/openapi/client/service/AppOpenApiService.java 61.90% <100.00%> (+15.23%) ⬆️

... and 2 files with indirect coverage changes

@nobodyiam
Copy link
Member

I think the PR is fantastic! Don't forget to modify the CHANGES.md.

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
Copy link
Member

It looks great to me! I suppose we could merge this PR and release a snapshot version?

@Anilople Anilople merged commit 5344bc4 into apolloconfig:main Aug 30, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2023
@Anilople
Copy link
Contributor Author

It looks great to me! I suppose we could merge this PR and release a snapshot version?

Merged. How to release the snapshot version?..

@nobodyiam
Copy link
Member

It looks great to me! I suppose we could merge this PR and release a snapshot version?

Merged. How to release the snapshot version?..

see 4.4 预发布 Apollo-Client Jar 包

@Anilople
Copy link
Contributor Author

It looks great to me! I suppose we could merge this PR and release a snapshot version?

Merged. How to release the snapshot version?..

see 4.4 预发布 Apollo-Client Jar 包

Done.

image

and nexus can find it

https://oss.sonatype.org/#nexus-search;quick~apollo-openapi

image

But when I run mvn clean compile

[INFO] Reactor Summary for Apollo 2.2.0-SNAPSHOT:
[INFO]
[INFO] Apollo ............................................. SUCCESS [  1.430 s]
[INFO] Apollo BuildTools .................................. SUCCESS [  2.221 s]
[INFO] Apollo Common ...................................... SUCCESS [  5.205 s]
[INFO] Apollo Biz ......................................... SUCCESS [  3.933 s]
[INFO] Apollo ConfigService ............................... SUCCESS [  3.423 s]
[INFO] Apollo AdminService ................................ SUCCESS [  2.368 s]
[INFO] Apollo Portal ...................................... FAILURE [  0.911 s]
[INFO] Apollo Assembly .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.993 s
[INFO] Finished at: 2023-08-31T21:56:05+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project apollo-portal: Could not resolve dependencies for project com.ctrip.framework.apollo:apollo-portal:jar:2.2.0-SNAPSHOT: Could not find artifact com.ctrip.framework.apollo:apollo-openapi:jar:2.2.0-SNAPSHOT in nexus (https://maven.aliyun.com/repository/public) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

It prompt that

Could not find artifact com.ctrip.framework.apollo:apollo-openapi:jar:2.2.0-SNAPSHOT in nexus (https://maven.aliyun.com/repository/public)

maven.aliyun.com need a little time to sync from nexus?

or the repository setup in pom.xml didn't work?

	<repositories>
		<!-- for apollo-core and apollo-openapi snapshot versions -->
		<repository>
			<id>sonatype-nexus-snapshots</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
		</repository>
	</repositories>

@nobodyiam
Copy link
Member

It works on my laptop and also in the GitHub CI. Is there any special configuration in your Maven settings.xml?

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apollo 2.2.0-SNAPSHOT:
[INFO]
[INFO] Apollo ............................................. SUCCESS [  2.687 s]
[INFO] Apollo BuildTools .................................. SUCCESS [  2.510 s]
[INFO] Apollo Common ...................................... SUCCESS [  7.783 s]
[INFO] Apollo Biz ......................................... SUCCESS [  4.682 s]
[INFO] Apollo ConfigService ............................... SUCCESS [  2.316 s]
[INFO] Apollo AdminService ................................ SUCCESS [  1.408 s]
[INFO] Apollo Portal ...................................... SUCCESS [  6.406 s]
[INFO] Apollo Assembly .................................... SUCCESS [  1.095 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  29.820 s
[INFO] Finished at: 2023-09-01T08:12:33+08:00
[INFO] ------------------------------------------------------------------------

@Anilople
Copy link
Contributor Author

Anilople commented Sep 2, 2023

It works on my laptop and also in the GitHub CI. Is there any special configuration in your Maven settings.xml?

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apollo 2.2.0-SNAPSHOT:
[INFO]
[INFO] Apollo ............................................. SUCCESS [  2.687 s]
[INFO] Apollo BuildTools .................................. SUCCESS [  2.510 s]
[INFO] Apollo Common ...................................... SUCCESS [  7.783 s]
[INFO] Apollo Biz ......................................... SUCCESS [  4.682 s]
[INFO] Apollo ConfigService ............................... SUCCESS [  2.316 s]
[INFO] Apollo AdminService ................................ SUCCESS [  1.408 s]
[INFO] Apollo Portal ...................................... SUCCESS [  6.406 s]
[INFO] Apollo Assembly .................................... SUCCESS [  1.095 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  29.820 s
[INFO] Finished at: 2023-09-01T08:12:33+08:00
[INFO] ------------------------------------------------------------------------

Solved. It indeed cause by Maven settings.xml.

when wrong mirrorOf *, it cannot work.

    <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>

when change to

    <mirror>
      <id>nexus</id>
      <mirrorOf>central</mirrorOf>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>

i.e mirrorOf from * to central, the snapshot version of apollo-openapi will download from https://oss.sonatype.org/content/repositories/snapshots

Downloaded from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/com/ctrip/framework/apollo/apollo-openapi/2.2.0-SNAPSHOT/apollo-openapi-2.2.0-20230831.125514-1.jar

then it work.

[INFO] Reactor Summary for Apollo 2.2.0-SNAPSHOT:
[INFO]
[INFO] Apollo ............................................. SUCCESS [  1.649 s]
[INFO] Apollo BuildTools .................................. SUCCESS [  2.844 s]
[INFO] Apollo Common ...................................... SUCCESS [  6.942 s]
[INFO] Apollo Biz ......................................... SUCCESS [  4.895 s]
[INFO] Apollo ConfigService ............................... SUCCESS [  8.378 s]
[INFO] Apollo AdminService ................................ SUCCESS [  6.404 s]
[INFO] Apollo Portal ...................................... SUCCESS [ 11.992 s]
[INFO] Apollo Assembly .................................... SUCCESS [  4.165 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  47.731 s
[INFO] Finished at: 2023-09-02T09:14:26+08:00
[INFO] ------------------------------------------------------------------------

@nobodyiam nobodyiam added this to the 2.2.0 milestone Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants