-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Multilple configs export #3088
Multilple configs export #3088
Conversation
Update fork
update forked code
merge across forks
Allow repeatable deletions and enhance thread safety (apolloconfig#3069)
Codecov Report
@@ Coverage Diff @@
## master #3088 +/- ##
============================================
- Coverage 51.55% 51.28% -0.27%
- Complexity 2255 2275 +20
============================================
Files 433 439 +6
Lines 13447 13622 +175
Branches 1378 1385 +7
============================================
+ Hits 6932 6986 +54
- Misses 6036 6150 +114
- Partials 479 486 +7
Continue to review full report at Codecov.
|
@Anilople That's all right, we may just focus on the config export function in this pull request |
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/NamespaceBOUtils.java
Outdated
Show resolved
Hide resolved
…d value contain special char like '\n' due wrong format.
this.format = null; | ||
} | ||
|
||
public ConfigBO(Env env, String ownerName, String appId, String clusterName, |
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.
It looks like this constructor is not used?
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.
Change the constructor's logic. com.ctrip.framework.apollo.portal.entity.bo.ConfigBO#ConfigBO(com.ctrip.framework.apollo.portal.environment.Env, java.lang.String, java.lang.String, java.lang.String, com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO)
use it now.
public ConfigBO(Env env, String ownerName, String appId, String clusterName, NamespaceBO namespaceBO) {
this(env, ownerName, appId, clusterName,
namespaceBO.getBaseInfo().getNamespaceName(),
NamespaceBOUtils.convert2configFileContent(namespaceBO),
ConfigFileFormat.fromString(namespaceBO.getFormat())
);
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/bo/ConfigBO.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java
Outdated
Show resolved
Hide resolved
@@ -34,18 +34,20 @@ | |||
<li value="zh-CN"><a href="javascript:void(0)" ng-click="changeLanguage('zh-CN')">简体中文</a></li> | |||
</ul> | |||
</li> | |||
<li class="dropdown" ng-if="hasRootPermission"> |
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 would suggest adding another drop down menu e.g. System Tools
and leave the Admin Tools only for Admin Users
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.
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 looks good
...lo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/PermissionValidator.java
Outdated
Show resolved
Hide resolved
...rtal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsExportController.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsImportService.java
Outdated
Show resolved
Hide resolved
…changed to private
* @param outputStream receive zip file output stream | ||
* @throws IOException | ||
*/ | ||
private static void writeAsZipOutputStream(Stream<ConfigBO> configBOStream, OutputStream outputStream) |
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.
Is it necessarily marked as static
?
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.
The method write Stream<ConfigBO>
's content to an OutputStream
.
Everytime the method is invoked, those parameters are different with before, and not use field in object,
so I think use static
for this method is better.
* @param configBO a namespace represent | ||
* @return zip file output stream same as parameter zipOutputStream | ||
*/ | ||
private static ZipOutputStream write2ZipOutputStream( |
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.
Is it necessarily marked as static
?
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.
Same reson as above.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java
Outdated
Show resolved
Hide resolved
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.
OK
What's the purpose of this PR
Enhance the PR #1767
Which issue(s) this PR fixes:
issues
#1760
#1681
Brief changelog
Export multiple configs to a single
.zip
file.Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.