Skip to content

Conversation

@berndverst
Copy link
Member

@berndverst berndverst commented Oct 1, 2021

Makes Cosmos DB Conformance Tests Pass

Every document sent to the output binding must contain:

  • a (nested) key as defined in metadata.partitionKey
  • a key id that is unique for this object in this collection

Other than that there are no limits to the document structure and the documented is inserted into Cosmos DB exactly as sent to the output binding.

Please note that upon creating a Cosmos DB Collection in Azure you must specify a partition key path. The path specified in the Cosmos DB Collection must also exist as a (nested) key in the Cosmos DB Binding request document. Additionally this key path must be specified in metadata.partitionKey (but dot donations instead of slash notation is used)

@berndverst berndverst force-pushed the bindings-cosmosdb-conformance branch from 26fc46a to 5d2b306 Compare October 11, 2021 23:16
@berndverst berndverst changed the title Cosmos DB Conformance Tests Cosmos DB Output Binding - Conformance & Progress towards GA Oct 11, 2021
@berndverst berndverst marked this pull request as ready for review October 11, 2021 23:32
@berndverst berndverst requested review from a team as code owners October 11, 2021 23:32
@berndverst berndverst marked this pull request as draft October 12, 2021 00:30
@daixiang0 daixiang0 marked this pull request as ready for review October 12, 2021 00:32
@berndverst berndverst marked this pull request as draft October 12, 2021 04:57
@berndverst berndverst marked this pull request as ready for review October 12, 2021 06:03
@berndverst berndverst requested a review from daixiang0 October 12, 2021 06:03
@berndverst
Copy link
Member Author

@daixiang0 @CodeMonkeyLeet made some changes now

By removing the upstream identification hydrator I was able to avoid the struct requirement that forced a particular Cosmos DB entity structure. Now we have complete flexibility again.

Do note that the partition path specified upon table (collection) creation means this field / attribute must exist in every document sent to this output binding.

@berndverst berndverst force-pushed the bindings-cosmosdb-conformance branch from 4ae795a to 49d25b5 Compare October 12, 2021 06:09
@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #1180 (486bf37) into master (310b4fd) will increase coverage by 0.51%.
The diff coverage is 60.40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1180      +/-   ##
==========================================
+ Coverage   34.34%   34.85%   +0.51%     
==========================================
  Files         140      141       +1     
  Lines       11993    12170     +177     
==========================================
+ Hits         4119     4242     +123     
- Misses       7450     7497      +47     
- Partials      424      431       +7     
Impacted Files Coverage Δ
bindings/azure/cosmosdb/cosmosdb.go 21.42% <0.00%> (-1.36%) ⬇️
bindings/azure/storagequeues/storagequeues.go 36.93% <0.00%> (-0.68%) ⬇️
internal/component/redis/redis.go 0.00% <0.00%> (ø)
internal/component/redis/settings.go 71.42% <ø> (ø)
pubsub/azure/servicebus/subscription.go 0.00% <0.00%> (ø)
pubsub/azure/servicebus/servicebus.go 30.29% <12.50%> (+0.09%) ⬆️
tests/conformance/common.go 16.99% <40.00%> (+2.83%) ⬆️
nameresolution/mdns/mdns.go 60.68% <53.33%> (ø)
pubsub/rabbitmq/rabbitmq.go 63.34% <55.55%> (-4.66%) ⬇️
pubsub/rabbitmq/metadata.go 92.72% <80.95%> (-7.28%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca8cf5c...486bf37. Read the comment docs.

halspang pushed a commit to halspang/components-contrib that referenced this pull request Nov 29, 2021
* cosmosdb binding - not as flexible as I'd like

conformance tests now pass

* add tests for new UUID injection logic

* Use nested property as partition key value

* avoid repeated string constants

* Disable Identification Hydrator to avoid struct requirement

* Remove struct

* Simplify PR

* Add comments ofor code maintenance
amimimor pushed a commit to amimimor/components-contrib that referenced this pull request Dec 9, 2021
* cosmosdb binding - not as flexible as I'd like

conformance tests now pass

* add tests for new UUID injection logic

* Use nested property as partition key value

* avoid repeated string constants

* Disable Identification Hydrator to avoid struct requirement

* Remove struct

* Simplify PR

* Add comments ofor code maintenance
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.

4 participants