-
Notifications
You must be signed in to change notification settings - Fork 218
Fix component spec parsing #1370
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
Conversation
Signed-off-by: Deepak <[email protected]>
90960e1
to
eac6d1f
Compare
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.
@iddeepak Thanks a lot for fixing this.
The PR looks good to me.
@artur-ciocanu / @salaboy / @cicoyle Can you folks please help trigger the build for this ?
workflows running |
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.
LGTM
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 think the metadata parsing is also broken.
Compare the expected result with the original statestore.yaml
.
I think the expected metadata should look more like this:
const expectedComponentYaml =
"apiVersion: dapr.io/v1alpha1\n"
+ "kind: Component\n"
+ "metadata:\n"
+ " name: statestore\n"
+ "spec:\n"
+ " type: state.redis\n"
+ " version: v1\n"
+ " metadata:\n"
+ " - name: keyPrefix\n"
+ " value: name\n"
+ " - name: redisHost\n"
+ " value: redis:6379\n"
+ " - name: redisPassword\n"
+ " value: ''\n"
Each Map in the List of Maps should result in one MetadataEntry being added to metadataEntries, but two are actually being added:
for (Map<String, String> specMetadataItem : specMetadata) {
for (Map.Entry<String, String> metadataItem : specMetadataItem.entrySet()) {
metadataEntries.add(new MetadataEntry(metadataItem.getKey(), metadataItem.getValue()));
}
}
Should I create a new ticket for that?
@joebowbeer Yes but also a test .. because it is working as far as I know. |
@salaboy There is a test but I think its expected result is wrong: Its metadata is very different from the original
|
Fixed broken metadata and updated changes to same PR now. |
Signed-off-by: Deepak <[email protected]>
Signed-off-by: Deepak <[email protected]>
83ff8c9
to
16a2aa6
Compare
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.
LGTM
@salaboy This method withComponent(path) has never worked AFAICT because type has always been null, therefore it doesn't surprise me that the parsing of specMetadata was also broken.
@iddeepak A style violation is causing a build step to fail?
|
Signed-off-by: Deepak <[email protected]>
bb8155a
to
35b6588
Compare
@salaboy / @artur-ciocanu Could you folks reapprove the CI for this please ? |
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.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1370 +/- ##
============================================
+ Coverage 76.91% 77.49% +0.58%
- Complexity 1592 1772 +180
============================================
Files 145 204 +59
Lines 4843 5444 +601
Branches 562 597 +35
============================================
+ Hits 3725 4219 +494
- Misses 821 905 +84
- Partials 297 320 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Fix component spec parsing Signed-off-by: Deepak <[email protected]> * Fix component spec parsing Signed-off-by: Deepak <[email protected]> * Fix component spec metadata parsing Signed-off-by: Deepak <[email protected]> * fix checkstyle-error Signed-off-by: Deepak <[email protected]> --------- Signed-off-by: Deepak <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Signed-off-by: salaboy <[email protected]>
* Fix component spec parsing Signed-off-by: Deepak <[email protected]> * Fix component spec parsing Signed-off-by: Deepak <[email protected]> * Fix component spec metadata parsing Signed-off-by: Deepak <[email protected]> * fix checkstyle-error Signed-off-by: Deepak <[email protected]> --------- Signed-off-by: Deepak <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Signed-off-by: salaboy <[email protected]>
…ests (#1377) * Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361) * feat: Support for GRPC ssl Signed-off-by: Javier Aliaga <[email protected]> * add tests Signed-off-by: Cassandra Coyle <[email protected]> * fix CI Signed-off-by: Cassandra Coyle <[email protected]> * add back else if Signed-off-by: Cassandra Coyle <[email protected]> * channel cleanup Signed-off-by: Cassandra Coyle <[email protected]> * add root ca support Signed-off-by: Cassandra Coyle <[email protected]> * checkstyles Signed-off-by: Cassandra Coyle <[email protected]> * add insecure Signed-off-by: Cassandra Coyle <[email protected]> * fix checkstyles Signed-off-by: Cassandra Coyle <[email protected]> * use InsecureTrustManagerFactory Signed-off-by: Cassandra Coyle <[email protected]> * fix test Signed-off-by: Cassandra Coyle <[email protected]> --------- Signed-off-by: Javier Aliaga <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> Co-authored-by: Javier Aliaga <[email protected]> Signed-off-by: salaboy <[email protected]> * spring boot workflow patterns initial version Signed-off-by: salaboy <[email protected]> * adding README for workflows Signed-off-by: salaboy <[email protected]> * adding child example Signed-off-by: salaboy <[email protected]> * updating examples to work with markdown tests Signed-off-by: salaboy <[email protected]> * running mechanical markdown for workflow examples Signed-off-by: salaboy <[email protected]> * Fix the issue with retries not happening correctly for Activities and Workflows (#1343) * Add coverage for some properties (#1297) Signed-off-by: sirivarma <[email protected]> * Make the DAPR version being used consistent across all tests (#1299) Signed-off-by: sirivarma <[email protected]> * Separate Dapr constants from IT container constants (#1315) Signed-off-by: Artur Ciocanu <[email protected]> Co-authored-by: Artur Ciocanu <[email protected]> Signed-off-by: sirivarma <[email protected]> * Use Java Bean for connection details and add more tests (#1317) * Use Java Bean for connection details and add more tests Signed-off-by: Artur Ciocanu <[email protected]> * Simplify mock setup Signed-off-by: Artur Ciocanu <[email protected]> * Adding even more tests for test coverage Signed-off-by: Artur Ciocanu <[email protected]> --------- Signed-off-by: Artur Ciocanu <[email protected]> Co-authored-by: Artur Ciocanu <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: sirivarma <[email protected]> * Update CONTRIBUTING.md Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: sirivarma <[email protected]> * Bump codecov/codecov-action from 5.4.0 to 5.4.2 (#1318) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5.4.0...v5.4.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.4.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix URL building logic (#1320) * Fix URL building logic Signed-off-by: Artur Ciocanu <[email protected]> * Add test for query params Signed-off-by: Artur Ciocanu <[email protected]> * Fix the assertion in the test Signed-off-by: Artur Ciocanu <[email protected]> * Adjust the tests Signed-off-by: Artur Ciocanu <[email protected]> * Remove uneeded changes from IT test Signed-off-by: Artur Ciocanu <[email protected]> * Revert some unintended changes Signed-off-by: Artur Ciocanu <[email protected]> * Simplify the testing a little bit Signed-off-by: Artur Ciocanu <[email protected]> * Adjust the test to use ServerRequest Signed-off-by: Artur Ciocanu <[email protected]> * Test removing things from method invoke controller Signed-off-by: Artur Ciocanu <[email protected]> * Add query param encoding test Signed-off-by: Artur Ciocanu <[email protected]> * Revert some unintended changes Signed-off-by: Artur Ciocanu <[email protected]> * Some tiny styles Signed-off-by: Artur Ciocanu <[email protected]> --------- Signed-off-by: Artur Ciocanu <[email protected]> Co-authored-by: Artur Ciocanu <[email protected]> Signed-off-by: sirivarma <[email protected]> * Generate updated javadocs for 1.14.1 Signed-off-by: Dapr Bot <[email protected]> Signed-off-by: sirivarma <[email protected]> * Add Conversation AI to Java SDK (#1235) * Conversation first commit Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: sirivarma <[email protected]> Signed-off-by: siri-varma <[email protected]> * Add unit tests Signed-off-by: sirivarma <[email protected]> Signed-off-by: siri-varma <[email protected]> * change ai to conv Signed-off-by: sirivarma <[email protected]> Signed-off-by: siri-varma <[email protected]> * Move to single module Signed-off-by: sirivarma <[email protected]> Signed-off-by: siri-varma <[email protected]> * Remove module Signed-off-by: sirivarma <[email protected]> Signed-off-by: siri-varma <[email protected]> * Add Integration tests Signed-off-by: siri-varma <[email protected]> * Update sdk-tests/src/test/java/io/dapr/it/testcontainers/DaprConversationIT.java Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: siri-varma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> * Address comments Signed-off-by: siri-varma <[email protected]> * Import tag Signed-off-by: siri-varma <[email protected]> * Address comments Signed-off-by: siri-varma <[email protected]> * Make common config Signed-off-by: siri-varma <[email protected]> * Address comments Signed-off-by: siri-varma <[email protected]> * fix constant Signed-off-by: siri-varma <[email protected]> * fix constant Signed-off-by: siri-varma <[email protected]> * fix constant Signed-off-by: siri-varma <[email protected]> * fix s Signed-off-by: siri-varma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> * Make common config Signed-off-by: siri-varma <[email protected]> * Update README.md Signed-off-by: Siri Varma Vegiraju <[email protected]> * Update README.md Signed-off-by: Siri Varma Vegiraju <[email protected]> --------- Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: sirivarma <[email protected]> Signed-off-by: siri-varma <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: sirivarma <[email protected]> * Add docs for usage of Jobs SDK (#1323) * Add doc for jobs Signed-off-by: siri-varma <[email protected]> * Add docs for Jobs Signed-off-by: siri-varma <[email protected]> * Apply suggestions from code review Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> --------- Signed-off-by: siri-varma <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: sirivarma <[email protected]> * Use dapr/durabletask-java (#1336) * microsoft durabletask-java -> dapr durabletask-java Signed-off-by: Cassandra Coyle <[email protected]> * update another ref Signed-off-by: Cassandra Coyle <[email protected]> * 1.5.2 release Signed-off-by: Cassandra Coyle <[email protected]> * fix import order Signed-off-by: Cassandra Coyle <[email protected]> * Sdk new changes Signed-off-by: siri-varma <[email protected]> * Refine workflows Signed-off-by: siri-varma <[email protected]> * add ; Signed-off-by: Cassandra Coyle <[email protected]> * rm try Signed-off-by: Cassandra Coyle <[email protected]> --------- Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: siri-varma <[email protected]> Co-authored-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Update master version to 1.16.0-SNAPSHOT Signed-off-by: Dapr Bot <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix NPE Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix NPE Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix NPE Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix NPE Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix NPE Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix NPE Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Renaming and exposing connection details (#1341) Signed-off-by: Artur Ciocanu <[email protected]> Co-authored-by: Artur Ciocanu <[email protected]> Signed-off-by: sirivarma <[email protected]> * [Master] Fix Vulnerabilities (#1354) * update okio Signed-off-by: Cassandra Coyle <[email protected]> * rm unused dep Signed-off-by: Cassandra Coyle <[email protected]> --------- Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: sirivarma <[email protected]> * Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361) * feat: Support for GRPC ssl Signed-off-by: Javier Aliaga <[email protected]> * add tests Signed-off-by: Cassandra Coyle <[email protected]> * fix CI Signed-off-by: Cassandra Coyle <[email protected]> * add back else if Signed-off-by: Cassandra Coyle <[email protected]> * channel cleanup Signed-off-by: Cassandra Coyle <[email protected]> * add root ca support Signed-off-by: Cassandra Coyle <[email protected]> * checkstyles Signed-off-by: Cassandra Coyle <[email protected]> * add insecure Signed-off-by: Cassandra Coyle <[email protected]> * fix checkstyles Signed-off-by: Cassandra Coyle <[email protected]> * use InsecureTrustManagerFactory Signed-off-by: Cassandra Coyle <[email protected]> * fix test Signed-off-by: Cassandra Coyle <[email protected]> --------- Signed-off-by: Javier Aliaga <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> Co-authored-by: Javier Aliaga <[email protected]> Signed-off-by: sirivarma <[email protected]> * Address comments Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> * Fix things Signed-off-by: siri-varma <[email protected]> Signed-off-by: sirivarma <[email protected]> --------- Signed-off-by: sirivarma <[email protected]> Signed-off-by: Artur Ciocanu <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Dapr Bot <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: siri-varma <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Javier Aliaga <[email protected]> Co-authored-by: Matheus Cruz <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Co-authored-by: Artur Ciocanu <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Javier Aliaga <[email protected]> Signed-off-by: salaboy <[email protected]> * 1.5.4 (#1375) Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: salaboy <[email protected]> * fixing order Id correlation Signed-off-by: salaboy <[email protected]> * fixing waiting time for tests to run Signed-off-by: salaboy <[email protected]> * fixing app name Signed-off-by: salaboy <[email protected]> * adding app name and removing log lines Signed-off-by: salaboy <[email protected]> * Bump codecov/codecov-action from 5.4.2 to 5.4.3 (#1379) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.2 to 5.4.3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5.4.2...v5.4.3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.4.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: salaboy <[email protected]> * Bump fossas/fossa-action from 1.6.0 to 1.7.0 (#1380) Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.6.0 to 1.7.0. - [Release notes](https://github.com/fossas/fossa-action/releases) - [Commits](fossas/fossa-action@v1.6.0...v1.7.0) --- updated-dependencies: - dependency-name: fossas/fossa-action dependency-version: 1.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: salaboy <[email protected]> * Fix component spec parsing (#1370) * Fix component spec parsing Signed-off-by: Deepak <[email protected]> * Fix component spec parsing Signed-off-by: Deepak <[email protected]> * Fix component spec metadata parsing Signed-off-by: Deepak <[email protected]> * fix checkstyle-error Signed-off-by: Deepak <[email protected]> --------- Signed-off-by: Deepak <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Signed-off-by: salaboy <[email protected]> * Update spring-boot-examples/workflows/README.md Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: salaboy <[email protected]> * fixing comments Signed-off-by: salaboy <[email protected]> * Update body.json Signed-off-by: artur-ciocanu <[email protected]> Signed-off-by: salaboy <[email protected]> * Update FanOutInWorkflow.java Signed-off-by: artur-ciocanu <[email protected]> Signed-off-by: salaboy <[email protected]> * clean up logs for multiple executions, for standalone mode Signed-off-by: salaboy <[email protected]> * Update application.properties Signed-off-by: artur-ciocanu <[email protected]> --------- Signed-off-by: Javier Aliaga <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: salaboy <[email protected]> Signed-off-by: sirivarma <[email protected]> Signed-off-by: Artur Ciocanu <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Dapr Bot <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]> Signed-off-by: siri-varma <[email protected]> Signed-off-by: Deepak <[email protected]> Signed-off-by: artur-ciocanu <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Javier Aliaga <[email protected]> Co-authored-by: Siri Varma Vegiraju <[email protected]> Co-authored-by: Matheus Cruz <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Co-authored-by: Artur Ciocanu <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: iddeepak <[email protected]>
Description
This PR resolves the issue described in #1368 by updating the parsing logic in
DaprContainer.withComponent(path)
.Previously, the
type
field was incorrectly read from the root level of the component YAML. This caused thetype
to benull
, even though it was correctly defined under thespec
section.The logic has now been fixed to correctly extract
type
andmetadata
from withinspec
.The corresponding test has also been updated to validate against the expected YAML structure, including
type: state.redis
and accuratemetadata
.Issue reference
Closes #1368
Checklist