Skip to content

Commit

Permalink
Merge branch '2.7.x' into 2.6.x-merge-up-into-2.7.x_sHVnzF8x
Browse files Browse the repository at this point in the history
* 2.7.x:
  Bump ramsey/composer-install from 2 to 3
  Bump actions/upload-artifact from 3 to 4 (#2601)
  Bump actions/cache from 3 to 4 (#2609)
  Transaction support (#2586)
  make doctrine/annotations dependency optional
  Decouple AttributeDriver from AnnotationDriver (#2502)
  Require doctrine/persistence 3 (#2603)
  Bump doctrine/.github from 3.1.0 to 4.0.0
  Remove BC break issue type
  • Loading branch information
alcaeus committed Mar 6, 2024
2 parents 58c2b1f + db27168 commit 4679642
Show file tree
Hide file tree
Showing 45 changed files with 2,745 additions and 743 deletions.
39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/BC_Break.md

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
pull_request:
branches:
- "*.x"
- "feature/*"
push:

jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.1.0"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0"
29 changes: 21 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- "*.x"
- "feature/*"
push:

env:
Expand All @@ -21,6 +22,7 @@ jobs:
- "8.2"
- "8.3"
mongodb-version:
- "7.0"
- "6.0"
- "5.0"
- "4.4"
Expand All @@ -33,24 +35,34 @@ jobs:
symfony-version:
- "stable"
include:
# Test against lowest dependencies
- dependencies: "lowest"
php-version: "8.1"
mongodb-version: "4.4"
driver-version: "1.11.0"
topology: "server"
symfony-version: "stable"
- topology: "sharded_cluster"
# Test with highest dependencies
- topology: "server"
php-version: "8.2"
mongodb-version: "7.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "7"
# Test with a 4.4 replica set
- topology: "replica_set"
php-version: "8.2"
mongodb-version: "4.4"
driver-version: "stable"
dependencies: "highest"
symfony-version: "stable"
- topology: "server"
# Test with a 4.4 sharded cluster
- topology: "sharded_cluster"
php-version: "8.2"
mongodb-version: "6.0"
mongodb-version: "4.4"
driver-version: "stable"
dependencies: "highest"
symfony-version: "7"
symfony-version: "stable"

steps:
- name: "Checkout"
Expand All @@ -67,7 +79,7 @@ jobs:
key: "extcache-v1"

- name: Cache extensions
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
Expand Down Expand Up @@ -101,16 +113,17 @@ jobs:
composer require --no-update --dev symfony/cache:^7@dev
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: composer.lock
name: "composer-lock-phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ matrix.mongodb-version }}"
path: composer.lock
overwrite: true

- id: setup-mongodb
uses: mongodb-labs/drivers-evergreen-tools@master
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- "*.x"
- "feature/*"
push:

jobs:
Expand Down Expand Up @@ -35,7 +36,7 @@ jobs:
key: "extcache-v1"

- name: Cache extensions
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
Expand All @@ -52,10 +53,10 @@ jobs:
run: "php --ri mongodb"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: composer.lock
path: composer.lock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@3.1.0"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@4.0.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
branches:
- "*.x"
- "feature/*"
push:

jobs:
Expand All @@ -30,7 +31,7 @@ jobs:
key: "extcache-v1"

- name: Cache extensions
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
Expand All @@ -47,13 +48,14 @@ jobs:
run: "php --ri mongodb"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: composer.lock
name: "composer-lock-static-analysis-phpstan"
path: composer.lock
overwrite: true

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse --error-format=github"
Expand All @@ -79,13 +81,14 @@ jobs:
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: composer.lock
name: "composer-lock-static-analysis-psalm"
path: composer.lock
overwrite: true

- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"
15 changes: 15 additions & 0 deletions UPGRADE-2.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# UPGRADE FROM 2.6 to 2.7

## Backward compatibility breaks

* `Doctrine\ODM\MongoDB\Mapping\Driver\AttributeDriver` no longer extends
`Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver`.

## doctrine/persistence

* MongoDB ODM 2.7 requires `doctrine/persistence` 3.2 or newer.

## `doctrine/annotations` is optional

ODM no longer requires `doctrine/annotations` to be installed. If you're using
annotations for mapping, you will need to install `doctrine/annotations`.
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
"require": {
"php": "^8.1",
"ext-mongodb": "^1.11",
"doctrine/annotations": "^1.12 || ^2.0",
"doctrine/cache": "^1.11 || ^2.0",
"doctrine/collections": "^1.5 || ^2.0",
"doctrine/event-manager": "^1.0 || ^2.0",
"doctrine/instantiator": "^1.1 || ^2",
"doctrine/persistence": "^2.4 || ^3.0",
"doctrine/persistence": "^3.2",
"friendsofphp/proxy-manager-lts": "^1.0",
"jean85/pretty-package-versions": "^1.3.0 || ^2.0.1",
"mongodb/mongodb": "^1.10.0",
Expand All @@ -39,6 +38,7 @@
},
"require-dev": {
"ext-bcmath": "*",
"doctrine/annotations": "^1.12 || ^2.0",
"doctrine/coding-standard": "^12.0",
"jmikola/geojson": "^1.0",
"phpbench/phpbench": "^1.0.0",
Expand All @@ -49,7 +49,11 @@
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
"vimeo/psalm": "^5.9.0"
},
"conflict": {
"doctrine/annotations": "<1.12 || >=3.0"
},
"suggest": {
"doctrine/annotations": "For annotation mapping support",
"ext-bcmath": "Decimal128 type support"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion docs/en/cookbook/validation-of-documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Now validation is performed whenever you call
``DocumentManager#persist($order)`` or when you call
``DocumentManager#flush()`` and an order is about to be updated. Any
Exception that happens in the lifecycle callbacks will be cached by
the DocumentManager and the current transaction is rolled back.
the DocumentManager.

Of course you can do any type of primitive checks, not null,
email-validation, string size, integer and date ranges in your
Expand Down
5 changes: 5 additions & 0 deletions docs/en/reference/annotations-reference.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Annotations Reference
=====================

.. note::

To be able to use annotations, you will have to install an extra
package called ``doctrine/annotations``.

In this chapter a reference of every Doctrine 2 ODM Annotation is
given with short explanations on their context and usage.

Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ A document instance can be characterized as being NEW, MANAGED, DETACHED or REMO
DocumentManager and a UnitOfWork.
- A REMOVED document instance is an instance with a persistent
identity, associated with a DocumentManager, that will be removed
from the database upon transaction commit.
from the database upon UnitOfWork commit.

Persistent fields
~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -103,7 +103,7 @@ persistent objects.
Transactional write-behind
~~~~~~~~~~~~~~~~~~~~~~~~~~

An ``DocumentManager`` and the underlying ``UnitOfWork`` employ a
The ``DocumentManager`` and the underlying ``UnitOfWork`` employ a
strategy called "transactional write-behind" that delays the
execution of query statements in order to execute them in the most
efficient way and to execute them at the end of a transaction so
Expand Down
20 changes: 14 additions & 6 deletions docs/en/reference/basic-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ document mapping metadata:
Introduction to Docblock Annotations
------------------------------------

.. note::

To be able to use annotations, you will have to install an extra
package called ``doctrine/annotations``.

You've probably used docblock annotations in some form already,
most likely to provide documentation metadata for a tool like
``PHPDocumentor`` (@author, @link, ...). Docblock annotations are a
Expand All @@ -44,12 +49,15 @@ chances of clashes with other docblock annotations, the Doctrine
docblock annotations feature an alternative syntax that is heavily
inspired by the Annotation syntax introduced in Java 5.

The implementation of these enhanced docblock annotations is
located in the ``Doctrine\Common\Annotations`` namespace and
therefore part of the Common package. Doctrine docblock annotations
support namespaces and nested annotations among other things. The
Doctrine MongoDB ODM defines its own set of docblock annotations
for supplying object document mapping metadata.
The implementation of these enhanced docblock annotations is located in
the ``doctrine/annotations`` package, but in the
``Doctrine\Common\Annotations`` namespace for backwards compatibility
reasons. Note that ``doctrine/annotations`` is not required by Doctrine
MongoDB ODM, and you will need to require that package if you want to use
annotations. Doctrine MongoDB ODM docblock annotations support namespaces and
nested annotations among other things. The Doctrine MongoDB ODM defines its
own set of docblock annotations for supplying object-relational mapping
metadata.

.. note::

Expand Down
Loading

0 comments on commit 4679642

Please sign in to comment.