Open weihubeats opened 5 months ago
The changes introduce methods in storage/repository.go
for converting properties to YAML format and parsing property values, alongside corresponding tests in storage/repository_test.go
. These additions allow the repository to handle YAML data and ensure functionality through testing.
Files | Change Summary |
---|---|
storage/repository.go |
Updated to add methods for converting properties to a map, parsing property values, and generating YAML. |
storage/repository_test.go |
Added tests for property mapping, value parsing, and YAML generation functionalities. |
sequenceDiagram
participant Client
participant Config
participant YAMLGenerator
participant PropertyParser
Client->>Config: Call GetYaml()
Config->>PropertyParser: Parse properties
PropertyParser-->>Config: Return parsed properties as map
Config->>YAMLGenerator: Generate YAML from map
YAMLGenerator-->>Config: Return YAML
Config-->>Client: Return YAML
🌟 In the code's deep, data flows,
To YAML land, where magic grows.
Parsing values, map to byte,
Turning properties into light.
Tests ensure our path is true,
Bravo, coder, cheers to you! 🍀
[!TIP]
Early access features
- OpenAI `gpt-4o` model for reviews and chat. Note: - You can disable early access features from the CodeRabbit UI or by setting `early_access: false` in the CodeRabbit configuration file. - Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide feedback and report issues. - OSS projects are always opted into early access features.
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?
感谢您提出Pull Request,我会尽快Review。我会在1-2日内进行查看或者回复,如果遇到节假日可能会处理较慢,敬请谅解。
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
storage/repository.go | 0 | 52 | 0.0% | ||
<!-- | Total: | 0 | 52 | 0.0% | --> |
Totals | |
---|---|
Change from base Build 8181144278: | -2.2% |
Covered Lines: | 1295 |
Relevant Lines: | 1791 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Can anyone review this pr?
@weihubeats would you please help to add some unit tests for this new feature?
add unit tests completed
Upon reviewing feature request #306, it appears that the original intention was to support these namespaces in YAML format rather than transforming properties into YAML format, e.g.
For reference, a similar feature has been implemented in the Java SDK as demonstrated below:
Config config = ConfigService.getConfig("application.yml");
String someKey = "someKeyFromYmlNamespace";
String someDefaultValue = "someDefaultValueForTheKey";
String value = config.getProperty(someKey, someDefaultValue);
这个还没合并吗?急需要用T_T
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
https://github.com/apolloconfig/agollo/issues/306
Summary by CodeRabbit
New Features
Tests