add multiple appId,pull other appId config into config.
What's the purpose of this PR
add multiple appId pull into config see https://github.com/apolloconfig/apollo-java/issues/66
Which issue(s) this PR fixes:
Fixes #
Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] add multiple appId pull into config.see https://github.com/apolloconfig/apollo-java/issues/66
Summary by CodeRabbit
-
New Features
- Introduced
appIdparameter across various configuration classes, allowing configuration queries and changes to be associated with a specific application ID. - Added new method
getAccessKeySecret(String appId)to manage access keys based on application IDs. - Introduced a new annotation
MultipleConfigfor managing multiple application IDs.
- Introduced
-
Changes in APIs
- Updated method signatures in multiple configuration classes and services to include
appId. - Added new methods for retrieving
appIdin relevant classes.
- Updated method signatures in multiple configuration classes and services to include
-
Refactor
- Refactored internal data structures and methods to support the inclusion of
appId.
- Refactored internal data structures and methods to support the inclusion of
These changes enhance the ability to manage and query configurations on a per-application basis, improving flexibility and granularity in configuration management.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
[!NOTE] Currently processing new changes in this PR. This may take a few minutes, please wait...
📥 Commits
Reviewing files that changed from the base of the PR and between 929b440b502d13bafd81edba76c6b76bbbe80dcc and 5a4507bf39aff28f6517b52ad0c087ca5b8ef072.
📒 Files selected for processing (1)
apollo-client/src/main/java/com/ctrip/framework/apollo/spring/spi/DefaultApolloConfigRegistrarHelper.java(5 hunks)________________________________________ < C*deR*bb*t: The uncensored bug hunter. > ---------------------------------------- \ \ (\__/) (•ㅅ•) / づ
Walkthrough
The recent updates to the Apollo Client introduce an appId parameter across multiple classes and methods. This enhancement improves configuration management by allowing retrieval and handling of configurations tailored to specific applications, facilitating greater flexibility and organization in multi-application environments. Additionally, the CHANGES.md file reflects a version update from 2.3.0 to 2.4.0, with a significant reduction in detailed entries.
Changes
| Files/Groups | Changes Summary |
|---|---|
ConfigService.java, DefaultConfigManager.java, RemoteConfigLongPollService.java, DefaultConfigFactoryManager.java, PropertySourcesProcessor.java |
Added appId parameter to methods, enhancing multi-application configuration management. |
AbstractSpringIntegrationTest.java, ConfigServiceTest.java, RemoteConfigLongPollServiceTest.java, PropertySourcesProcessorTest.java |
Updated test cases to reflect changes in method signatures and improve clarity in testing configurations. |
AbstractConfig.java, AbstractConfigFile.java, AbstractConfigRepository.java, DefaultConfig.java, LocalFileConfigRepository.java, RemoteConfigRepository.java, SimpleConfig.java, YamlConfigFile.java |
Modified constructors and methods to include appId, improving configuration handling across various classes. |
MockConfig.java, MockConfigFile.java, MockConfigFactory.java, MockConfigUtil.java |
Updated constructors and methods to incorporate appId, ensuring consistency in configuration handling. |
ConfigUtil.java |
Added new methods for retrieving local cache directories and access keys based on appId. |
CHANGES.md |
Updated milestone link and removed detailed entries for version 2.4.0. |
Sequence Diagrams
Configuration Retrieval Flow
sequenceDiagram
participant Client as Client
participant ConfigService as ConfigService
participant ConfigManager as ConfigManager
participant ConfigRepository as ConfigRepository
Client->>ConfigService: getConfig(appId, namespace)
ConfigService->>ConfigManager: getConfig(appId, namespace)
ConfigManager->>ConfigRepository: fetchConfig(appId, namespace)
ConfigRepository-->>ConfigManager: return Config
ConfigManager-->>ConfigService: return Config
ConfigService-->>Client: return Config
Configuration Change Notification Flow
sequenceDiagram
participant ConfigRepository as ConfigRepository
participant RemoteConfigLongPollService as RemoteConfigLongPollService
participant Client as Client
ConfigRepository->>RemoteConfigLongPollService: submit(appId, namespace)
RemoteConfigLongPollService->>Client: notify(appId, namespace, changes)
Client-->>ConfigRepository: onRepositoryChange(appId, namespace, newProperties)
🐰 In fields of green, I hop with glee,
New app IDs bloom, oh what a spree!
Configs now dance, tailored with care,
Multi-app magic fills the air!
With each little change, our dreams take flight,
A brighter tomorrow, oh what a delight! 🌼
[!TIP]
You can customize the tone of the review comments and chat replies.
Set the
tone_instructionssetting in your project's settings in CodeRabbit to customize the tone of the review comments and chat replies. For example, you can set the tone toAct like a strict teacher,Act like a pirateand more.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Thanks, it may take some time to reivew. In the meantime, could you please sign the CLA following the instructions provided by the CLA Assistant Lite bot?
I have read the CLA Document and I hereby sign the CLA
@TerryLam2010 It seems you committed the code with [email protected], which isn't associated with your GitHub account.
The monitor metric #74 maybe changed if support multiple appId @Rawven
I have changed the Email for submitting code to [email protected], and changed the name to TerryLam2010. Have not submitted open source request merge before,help me please....
I have changed the Email for submitting code to [email protected], and changed the name to TerryLam2010. Have not submitted open source request merge before,help me please....
emm...You may first backup the local repo and try the following:
1. git checkout main
2. git checkout -b 20240703-apollo-multiple-appid-new
3. git merge --squash 20240703-apollo-multiple-appid
4. git commit -m "some commit message"
5. git push origin 20240703-apollo-multiple-appid-new:20240703-apollo-multiple-appid
I have changed the Email for submitting code to [email protected], and changed the name to TerryLam2010. Have not submitted open source request merge before,help me please....
emm...You may first backup the local repo and try the following:
1. git checkout main 2. git checkout -b 20240703-apollo-multiple-appid-new 3. git merge --squash 20240703-apollo-multiple-appid 4. git commit -m "some commit message" 5. git push origin 20240703-apollo-multiple-appid-new:20240703-apollo-multiple-appid
I noticed the CLA check failed again, and it seems the original commits are back. Is there some mistaken operation on the branch?
Jason, my unit tests pass perfectly when I run them locally, but fail when I run them on GitHub.
@TerryLam2010 As this pull request is quite large and already takes a lot of time in reviewing. I suggest scheduling an online meeting for a thorough, quick review. If that works for you, please email me at [email protected] to arrange a suitable time.