Skip to content
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

feat: prepare for v7 #264

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ updates:
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "node"
update-types: ["version-update:semver-major"]
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
pull_request:
branches:
- main
- v6.x
paths:
- ".github/workflows/**"
- "lib/**"
Expand All @@ -18,7 +17,6 @@ on:
push:
branches:
- main
- v6.x
paths:
- ".github/workflows/**"
- "lib/**"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [#53](https://github.com/mia-platform/crud-service/issues/53) request to transition to a disallowed state now returns HTTP error 400 instead of 404
- [#55](https://github.com/mia-platform/crud-service/issues/55) additional query \_q now return _400 Bad Request_ in case a field is not included in the collection definition schema
- [#144](https://github.com/mia-platform/crud-service/pull/144) method `GET /:id` returns document containing only fields defined in the JSON Schema of the collection

### Added

- [#236](https://github.com/mia-platform/crud-service/issues/236) added `defaultSorting` field to collection definition: the field applies a sorting object document to find queries, if no explicit `_s` parameter is set on request

### Changed
Expand Down
47 changes: 47 additions & 0 deletions docs/guides/10_Migration-Guide-v7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Migration Guide to V7

This document describes the breaking changes introduced with the new version v7.0.0 of the CRUD Service
and how they should be tackled in order to safely upgrade CRUD Service version.

### MongoDB Support [#189](https://github.com/mia-platform/crud-service/pull/189)

With this new release of CRUD Service it is introduced the support to Mongo v7, while
the support to MongoDB v4.2 was dropped. For this reason, while the service may still
work with such MongoDB version, it is recommended to upgrade your MongoDB cluster version
to v4.4. or higher to ensure full compatibility with CRUD Service.

For more details on CRUD Service compatibility with MongoDB, please visit the Marketplace
[_compatibility matrix_](https://docs.mia-platform.eu/docs/marketplace/compatibility_matrices/mongo_compatibility_matrix).

### Duplicated Key Response Error Code [#140](https://github.com/mia-platform/crud-service/pull/140)

Following the discussion CRUD Service response on [unique constraint violation](https://github.com/mia-platform/community/discussions/175), it has been decided
to change the returned HTTP error code from `422 Unprocessable Entity` to `409 Conflict`.
This modification should improve the clarity on what happened to the requested operation.

In order to safely migrate the CRUD Service version, it is important to ensure that all
the applications depending on the specific response code, returned in case of duplicate
key, are appropriately modified to accept the new response code.

### Disallowed State Transition Error Code [#122](https://github.com/mia-platform/crud-service/pull/122)

As discussed in issue [#53](https://github.com/mia-platform/crud-service/issues/53), it has
been decided to change the returned HTTP error code from `404 Not Found` to `400 Bad Request`.
This modification should improve the clarity on what happened to the requested operation.

In order to safely migrate the CRUD Service version, it is important to ensure that all
the applications depending on the specific response code, returned in case of duplicate
key, are appropriately modified to accept the new response code.

### Access to Fields Outside the Collection Schema Model [#127](https://github.com/mia-platform/crud-service/pull/127) | [#144](https://github.com/mia-platform/crud-service/pull/144)

In response to issue [#55](https://github.com/mia-platform/crud-service/issues/55), the access
to collection properties has been enforced to cover only fields defined in the collection schema model.
Requesting to access an unexpected field now returns an HTTP error `400 Bad request`. At
the same time, when requesting documents via `GET /<collection>/` and `GET /<collection>/:id` endpoints,
properties that may be available on the collection documents but that are not explicitly defined
in the collection schema model are removed from the actual response body.

In order to safely migrate the CRUD Service version, it is important to ensure that either:
- all the applications depending on this specific behavior are modified appropriately
- the collections model definition is reviewed and potentially updated to include all the fields actually required by the applications
4 changes: 4 additions & 0 deletions docs/guides/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
label: 'Guides'
position: 10
collapsible: true
collapsed: true
Loading
Loading