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

[SCB-671]duplicate cse to servicecomb #787

Merged
merged 2 commits into from
Jul 3, 2018
Merged

[SCB-671]duplicate cse to servicecomb #787

merged 2 commits into from
Jul 3, 2018

Conversation

liubao68
Copy link
Contributor

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

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@coveralls
Copy link

coveralls commented Jun 30, 2018

Coverage Status

Coverage decreased (-0.08%) to 87.068% when pulling 29c2dd7 on liubao68:cse_servicecomb into 82d4766 on apache:master.

}

public void loadAndSort() {
try {
String configFileFromClasspath =
System.getProperty("cse.configurationSource.defaultFileName") == null ? DEFAULT_CONFIG_FILE_NAME
: System.getProperty("cse.configurationSource.defaultFileName");
System.getProperty(DEFAULT_FILE_NAME) == null ? DEFAULT_CONFIG_FILE_NAME
Copy link
Contributor

Choose a reason for hiding this comment

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

not compatible?
because we only copy config items in configuration source, not in system.property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Intended, we have never mention this in docs. And I add new docs for this change. See java-chassis-doc PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, nobody use this feature, we can changed it directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Throw an error for this wrong configuration and force users change to correct key.

@@ -28,7 +28,9 @@
public class MicroserviceConfigLoader extends YAMLConfigLoader {
private static final Logger LOGGER = LoggerFactory.getLogger(MicroserviceConfigLoader.class);

private static final String ADDITIONAL_CONFIG_URL = "cse.configurationSource.additionalUrls";
private static final String ADDITIONAL_CONFIG_URL = "servicecomb.configurationSource.additionalUrls";
Copy link
Contributor

Choose a reason for hiding this comment

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

not compatible?
because we only copy config items in configuration source, not in system.property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor

Choose a reason for hiding this comment

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

i remember someone already used this feature

Copy link
Member

Choose a reason for hiding this comment

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

This property is described in the README file, we need to make sure the old setting works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Throw an error for this wrong configuration and force users change to correct key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted the README file and add the contents to java-chassis-doc, please see that PR.

//inject a copy of cse.xxx for servicecomb.xxx
private static void duplicateServiceCombConfigToCse(AbstractConfiguration source) {
//inject a copy of servicecomb.xxx for cse.xxx
private static void duplicateCseConfigToServicecomb(AbstractConfiguration source) {
Copy link
Member

Choose a reason for hiding this comment

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

Just a quick question,if the user has two value setting for servicecomb.xxx and cse.xxx, which one will take effect?
We may need add some document for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Depends on servicecomb-config-order, and I add new test cased for this in new commit. And adding warning message if two keys are in different files.

// compatible check
objOrder = config.get("cse-config-order");
if (objOrder != null) {
LOGGER.error("cse-config-order will not be supported in future, please change it to servicecomb-config-order");
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be warning, as the program is not stop working here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is quick fix for users, so I give error not warning. Users see this, it quite important to fix it immediately. Some others like above duplicate key, I give warning, as users can not change common modules.
I am thinking of throw an exception here, just like cse.configurationSource.additionalUrls do, but after quite a lot consideration, give an error message is better.

@liubao68
Copy link
Contributor Author

liubao68 commented Jul 3, 2018

I merge this PR first. Because this blocking other changes

@liubao68 liubao68 merged commit 6b52dd9 into apache:master Jul 3, 2018
@liubao68 liubao68 deleted the cse_servicecomb branch March 9, 2021 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants