Skip to content

Commit

Permalink
Merge to master for version 2.25.8 (#533)
Browse files Browse the repository at this point in the history
## Release notes: usage and product changes

We merge for 2.25.8, which includes fixes to 'fetch' nesting, adding
back '.map()' on concept maps, and bug fixes.
  • Loading branch information
flyingsilverfin committed Dec 4, 2023
2 parents 7d8e8e0 + 7b825be commit 8a7d9f8
Show file tree
Hide file tree
Showing 223 changed files with 3,487 additions and 2,510 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ commands:
ulimit -n 100000
export DEPLOY_MAVEN_USERNAME=$REPO_VATICLE_USERNAME
export DEPLOY_MAVEN_PASSWORD=$REPO_VATICLE_PASSWORD
bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run --define version=$(git rev-parse HEAD) //java:deploy-maven-jni -- snapshot
deploy-maven-jni-snapshot-linux:
Expand Down Expand Up @@ -219,7 +218,6 @@ commands:
- run: |
export DEPLOY_MAVEN_USERNAME=$REPO_VATICLE_USERNAME
export DEPLOY_MAVEN_PASSWORD=$REPO_VATICLE_PASSWORD
bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run --define version=$(git rev-parse HEAD) //java:deploy-maven -- snapshot
test-maven-snapshot-unix:
Expand Down Expand Up @@ -258,7 +256,6 @@ commands:
ulimit -n 100000
export DEPLOY_MAVEN_USERNAME=$REPO_VATICLE_USERNAME
export DEPLOY_MAVEN_PASSWORD=$REPO_VATICLE_PASSWORD
bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run --define version=$(cat VERSION) //java:deploy-maven-jni --compilation_mode=opt -- release
deploy-maven-jni-release-linux:
Expand Down Expand Up @@ -287,7 +284,6 @@ commands:
- run: |
export DEPLOY_MAVEN_USERNAME=$REPO_VATICLE_USERNAME
export DEPLOY_MAVEN_PASSWORD=$REPO_VATICLE_PASSWORD
bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run --define version=$(cat VERSION) //java:deploy-maven --compilation_mode=opt -- release
Expand Down
26 changes: 8 additions & 18 deletions .factory/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ build:
git add $DOCS_DIRS
git diff --exit-code HEAD $DOCS_DIRS
test-rust-integration-core:
test-rust-unit-integration:
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
dependencies:
- build
Expand All @@ -87,30 +87,21 @@ build:
export ARTIFACT_PASSWORD=$REPO_VATICLE_PASSWORD
bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run @vaticle_dependencies//distribution/artifact:create-netrc
bazel test //rust:typedb_driver_unit_tests --test_output=streamed || exit 1
tool/test/start-core-server.sh &&
bazel test //rust/tests --test_output=streamed --test_arg=-- \
--test_arg=integration::queries::core &&
export TEST_SUCCESS=0 || export TEST_SUCCESS=1
--test_arg=integration::queries::core &&
export CORE_FAILED= || export CORE_FAILED=1
tool/test/stop-core-server.sh
exit $TEST_SUCCESS
if [[ -n "$CORE_FAILED" ]]; then exit 1; fi
test-rust-integration-enterprise:
machine: 4-core-16-gb
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
dependencies:
- build
command: |
export ARTIFACT_USERNAME=$REPO_VATICLE_USERNAME
export ARTIFACT_PASSWORD=$REPO_VATICLE_PASSWORD
bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run @vaticle_dependencies//distribution/artifact:create-netrc
source tool/test/start-enterprise-servers.sh 3 && # use source to receive export vars
bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \
--test_arg=integration::queries::enterprise \
--test_arg=integration::runtimes &&
export TEST_SUCCESS=0 || export TEST_SUCCESS=1
export ENTERPRISE_FAILED= || export ENTERPRISE_FAILED=1
tool/test/stop-enterprise-servers.sh
exit $TEST_SUCCESS
if [[ -n "$ENTERPRISE_FAILED" ]]; then exit 1; fi
test-rust-behaviour-concept:
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
Expand Down Expand Up @@ -972,8 +963,7 @@ build:
image: vaticle-ubuntu-22.04
dependencies:
- build
- test-rust-integration-core
- test-rust-integration-enterprise
- test-rust-unit-integration
- test-rust-behaviour-concept
- test-rust-behaviour-connection
- test-rust-behaviour-query-read
Expand Down
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ assignees: ''
2. Execute


3. Test/Query


4. Unexpected result
3. Unexpected result



Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Release notes: usage and product changes
## Usage and product changes


## Implementation
97 changes: 65 additions & 32 deletions RELEASE_NOTES_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Documentation: https://typedb.com/docs/clients/rust-driver


```sh
cargo add typedb-driver@2.25.7
cargo add typedb-driver@2.25.8
```


Expand All @@ -29,7 +29,7 @@ Documentation: https://typedb.com/docs/clients/java-driver
<dependency>
<groupid>com.vaticle.typedb</groupid>
<artifactid>typedb-driver</artifactid>
<version>2.25.7</version>
<version>2.25.8</version>
</dependency>
</dependencies>
```
Expand All @@ -42,7 +42,7 @@ Documentation: https://typedb.com/docs/clients/python-driver
Available through https://pypi.org

```
pip install typedb-driver==2.25.7
pip install typedb-driver==2.25.8
```

### NodeJS driver
Expand All @@ -51,50 +51,83 @@ NPM package: https://www.npmjs.com/package/typedb-driver
Documentation: https://typedb.com/docs/clients/nodejs-driver

```
npm install typedb-driver@2.25.7
npm install typedb-driver@2.25.8
```

## API Changes

## New Features
1. 'Fetch' attribute value type moves from the outer layer to the 'type' - see 'Code Refactors'
2. TypeDB Core sessions automatically and lazily reconnect on network failure or timeout on the server-side


## Bugs Fixed
- **Add untyped value getter for Java values and fix Python type hints**
## New Features
- **Session callbacks: on reopen, persistent on close; FFI bug fixes**

We add a simple untyped API to Java's `Value` concepts, which return the value inside of the Value regardless of its type (double/string/etc.). This value is returned as an Object, and useful for equality checks, printing, etc. Additionally, the same API exists in Python and Node already.
**Session callbacks**
- All drivers:
- implement session reopen callbacks, executed when a session closed on the server side successfully reconnects;
- core session now attempts to reconnect if it is closed on the remote server, in line with enterprise behaviour;
- `Session::on_close()` callbacks are now executed each time the session closes (rather than just once);
- NodeJS:
- implement session and transaction callbacks (`onClose()`, `Session::onReopen()`);

We also fix the Python hints for setting the name of a Type, which was incorrectly hinting the type 'Label' when it should have been a simple string.
**Miscellaneous fixes**
- Java, Python:
- prevent exceptions in callbacks from crashing the native layer;
- fix the issue where static root types could not be used with Concept APi;
- reintroduce `ConceptMap.map()` to retrieve the full mapping;
- Rust:
- convert error messages from tuple enum variants to struct, allowing the fields to be named;
- All drivers:
- fix the issue where session closed on remote server would not register automatically on the client side until a transaction open attempt.



## Code Refactors
- **Silence send errors in network callbacks when receiver dropped**

Downgrade the "channel closed" `SendError` from ERROR to DEBUG when the receiving end of the stream is dropped before the stream is exhausted.
This used to occur when the network delivered messages to a dropped channel, for example when executing a `match-insert`
and the responses were not consumed explicitly.


- **Optimise CI times by retaining server between Java BDD scenarios**

We optimise Java CI time by not shutting down the TypeDB server between scenarios. Instead, we delete the existing databases each test, which is much faster.

During this work, we also discovered some sub-par UX in terms of error messages thrown, and missing BDD steps that needed to be implemented.

## Bugs Fixed


## Code Refactors
- **Fetch value type**

We update the expected output of TypeQL Fetch queries: attribute type serialization now includes its value_type.
This change makes the output symmetric between raw values and attributes.

Old output format:
```json
{
"attribute_type": { "label": "T", "root": "attribute" },
"raw_value": { "value": "...", "value_type": "string" },
"attribute": { "value": "...", "value_type": "string", "type": { "label": "T", "root": "attribute" } }
}
```
New output format:
```json
{
"attribute_type": { "label": "T", "value_type": "string", "root": "attribute" },
"raw_value": { "value": "...", "value_type": "string" },
"attribute": { "value": "...", "type": { "label": "T", "value_type": "string", "root": "attribute" } }
}
```

We also fix related JSON string serialization issue in which the hexadecimal escape sequences were not conformant to the JSON standard (`\u0000`).



## Other Improvements
- **Fix python BDD TLS connection configuration**

- **Fix Rust BDD infer flag and python TLS default to false**

- **Update VERSION and regenerate release notes**

- **Increase ulimits on unix CircleCI machines**
- **Generate Rust documentation tabs and italics correctly**

We generate documentation using the correct syntax for code examples, fixing errors in the generated Rust examples.


- **Fix documentation and for Trait Promise**

- **Update README links to docs**
- **Update vaticle_dependencies with upgraded rules_rust**

- **Simplify github PR and issue templates**
- **Generate unique documentation anchors**

Documentation generation now produces strictly unique anchors, using a combination of class/struct name, method name, and arguments signature as part of the anchor. This strategies means that all overloads and variations of method, for example in Java, now have uniquely referrable links.


- **Increase CircleCI windows machine sizes from medium to xlarge**


2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.25.7
2.25.8
22 changes: 11 additions & 11 deletions c/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub extern "C" fn query_define(
options: *const Options,
) -> *mut VoidPromise {
release(VoidPromise(Box::new(
borrow(transaction).query().define_with_options(string_view(query), borrow(options).clone()),
borrow(transaction).query().define_with_options(string_view(query), *borrow(options)),
)))
}

Expand All @@ -54,7 +54,7 @@ pub extern "C" fn query_undefine(
options: *const Options,
) -> *mut VoidPromise {
release(VoidPromise(Box::new(
borrow(transaction).query().undefine_with_options(string_view(query), borrow(options).clone()),
borrow(transaction).query().undefine_with_options(string_view(query), *borrow(options)),
)))
}

Expand All @@ -65,7 +65,7 @@ pub extern "C" fn query_delete(
options: *const Options,
) -> *mut VoidPromise {
release(VoidPromise(Box::new(
borrow(transaction).query().delete_with_options(string_view(query), borrow(options).clone()),
borrow(transaction).query().delete_with_options(string_view(query), *borrow(options)),
)))
}

Expand All @@ -90,7 +90,7 @@ pub extern "C" fn query_get(
try_release(
borrow(transaction)
.query()
.get_with_options(string_view(query), borrow(options).clone())
.get_with_options(string_view(query), *borrow(options))
.map(|it| ConceptMapIterator(CIterator(box_stream(it)))),
)
}
Expand All @@ -104,7 +104,7 @@ pub extern "C" fn query_fetch(
try_release(
borrow(transaction)
.query()
.fetch_with_options(string_view(query), borrow(options).clone())
.fetch_with_options(string_view(query), *borrow(options))
.map(|it| StringIterator(CIterator(box_stream(it.map_ok(|json| json.to_string()))))),
)
}
Expand All @@ -118,7 +118,7 @@ pub extern "C" fn query_insert(
try_release(
borrow(transaction)
.query()
.insert_with_options(string_view(query), borrow(options).clone())
.insert_with_options(string_view(query), *borrow(options))
.map(|it| ConceptMapIterator(CIterator(box_stream(it)))),
)
}
Expand All @@ -132,7 +132,7 @@ pub extern "C" fn query_update(
try_release(
borrow(transaction)
.query()
.update_with_options(string_view(query), borrow(options).clone())
.update_with_options(string_view(query), *borrow(options))
.map(|it| ConceptMapIterator(CIterator(box_stream(it)))),
)
}
Expand All @@ -144,7 +144,7 @@ pub extern "C" fn query_get_aggregate(
options: *const Options,
) -> *mut ConceptPromise {
release(ConceptPromise::value(
borrow(transaction).query().get_aggregate_with_options(string_view(query), borrow(options).clone()),
borrow(transaction).query().get_aggregate_with_options(string_view(query), *borrow(options)),
))
}

Expand All @@ -169,7 +169,7 @@ pub extern "C" fn query_get_group(
try_release(
borrow(transaction)
.query()
.get_group_with_options(string_view(query), borrow(options).clone())
.get_group_with_options(string_view(query), *borrow(options))
.map(|it| ConceptMapGroupIterator(CIterator(box_stream(it)))),
)
}
Expand All @@ -195,7 +195,7 @@ pub extern "C" fn query_get_group_aggregate(
try_release(
borrow(transaction)
.query()
.get_group_aggregate_with_options(string_view(query), borrow(options).clone())
.get_group_aggregate_with_options(string_view(query), *borrow(options))
.map(|it| ValueGroupIterator(CIterator(box_stream(it)))),
)
}
Expand All @@ -221,7 +221,7 @@ pub extern "C" fn query_explain(
try_release(
borrow(transaction)
.query()
.explain_with_options(borrow(explainable), borrow(options).clone())
.explain_with_options(borrow(explainable), *borrow(options))
.map(|it| ExplanationIterator(CIterator(box_stream(it)))),
)
}

0 comments on commit 8a7d9f8

Please sign in to comment.