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

Release preparations #193

Merged
merged 26 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b6c877b
Update docs [skip ci]
arogachev Mar 12, 2024
0a5acf2
Update PR template [skip ci]
arogachev Mar 12, 2024
d231651
Add composer require checker
arogachev Mar 12, 2024
85f8afc
Change version for CRC
arogachev Mar 12, 2024
147db28
Fix CRC (WIP), use symfony/console directly
arogachev Mar 12, 2024
ca8a756
Remove remaining ExitCode occurence
arogachev Mar 12, 2024
dd8cfc3
Exclude PHP 8.0 from CI
arogachev Mar 12, 2024
bf096e8
Add symfony finder as a dependency
arogachev Mar 12, 2024
9b883f8
Add cycle/database dependency, bump versions
arogachev Mar 12, 2024
bed44c6
Fix remaining CRC issues
arogachev Mar 12, 2024
1d4f4ea
Add rector
arogachev Mar 12, 2024
3c63b9e
Apply Rector changes (CI)
arogachev Mar 12, 2024
7ba3f11
Apply fixes from StyleCI
StyleCIBot Mar 12, 2024
45c75e0
Min MSI 100%
arogachev Mar 12, 2024
909af05
Merge branch 'data-transfer' into release-preparations
arogachev Mar 12, 2024
1fc08d3
Remove remaining links [skip ci]
arogachev Mar 12, 2024
66cdef6
Remove extra line [skip ci]
arogachev Mar 12, 2024
26113e1
Update .github/workflows/composer-require-checker.yml
arogachev Mar 13, 2024
c71cfa4
Revert some Rector changes
arogachev Mar 13, 2024
13a547b
Change push rules for CI (review fix)
arogachev Mar 13, 2024
e79f0b9
Update README.md
arogachev Mar 13, 2024
e660f64
Update rector.php
arogachev Mar 13, 2024
2a33b65
Apply Rector changes (CI)
arogachev Mar 13, 2024
734752e
Change rules for CI, BC (review fix)
arogachev Mar 13, 2024
d3243f9
Merge remote-tracking branch 'origin/release-preparations' into relea…
arogachev Mar 13, 2024
9c9dd41
Drop 4 version of Psalm
arogachev Mar 13, 2024
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
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
| Is bugfix? | ✔️/❌
| New feature? | ✔️/❌
| Breaks BC? | ✔️/❌
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
21 changes: 10 additions & 11 deletions .github/workflows/bc.yml_
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
on:
- pull_request
- push
- pull_request
- push
arogachev marked this conversation as resolved.
Show resolved Hide resolved

name: backwards compatibility

jobs:
roave_bc_check:
name: Roave BC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
roave_bc_check:
uses: yiisoft/actions/.github/workflows/bc.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.3']
1 change: 0 additions & 1 deletion .github/workflows/build.yml
arogachev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- windows-latest

php:
- 8.0
- 8.1
- 8.2
- 8.3
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

name: Composer require checker

jobs:
composer-require-checker:
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.3']
arogachev marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion .github/workflows/mutation.yml
arogachev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.2']
['8.3']
min-covered-msi: 100
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
21 changes: 21 additions & 0 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

name: rector

jobs:
rector:
uses: yiisoft/actions/.github/workflows/rector.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.3']
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,10 @@ Read more in the [official documentation](https://cycle-orm.dev/docs/readme/2.x)

## Documentation

- [English](docs/en/README.md)
- [Russian](docs/ru/README.md)
- [Spanish](docs/es/README.md)

## Testing

### Unit testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```shell
./vendor/bin/phpunit
```

### Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:

```shell
./vendor/bin/roave-infection-static-analysis-plugin
```

### Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```shell
./vendor/bin/psalm
```
- [English](docs/en/guide)
- [Russian](docs/ru/guide)
- [Spanish](docs/es/guide)
arogachev marked this conversation as resolved.
Show resolved Hide resolved
- [Internals](docs/internals.md)

## License

Expand Down
19 changes: 19 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"symbol-whitelist" : [
"JetBrains\\PhpStorm\\ExpectedValues",
"JetBrains\\PhpStorm\\Pure"
],
"php-core-extensions" : [
"Core",
"date",
"json",
"hash",
"pcre",
"Phar",
"Reflection",
"SPL",
"random",
"standard"
],
"scan-files" : []
}
20 changes: 14 additions & 6 deletions composer.json
arogachev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,35 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.0",
"cycle/annotated": "^3.2.1",
"php": "^8.1",
"cycle/annotated": "^3.5",
"cycle/database": "^2.8",
"cycle/migrations": "^3.1.1|^4.0",
"cycle/orm": "^2.2.2",
"cycle/orm": "^2.7",
"cycle/schema-migrations-generator": "^2.0",
"cycle/schema-renderer": "^1.2",
"cycle/schema-builder": "^2.7",
"cycle/schema-builder": "^2.8",
"cycle/schema-provider": "^1.0",
"psr/container": "^2.0",
"psr/event-dispatcher": "^1.0",
"psr/log": "^3.0",
"psr/simple-cache": "^2.0|^3.0",
"spiral/attributes": "^2.7|^3.0",
"webmozart/glob": "^4.0",
"spiral/core": "^3.12",
"spiral/tokenizer": "^3.12",
"webmozart/glob": "^4.7",
"yiisoft/aliases": "^1.1|^2.0|^3.0",
"yiisoft/friendly-exception": "^1.1",
"yiisoft/injector": "^1.1",
"yiisoft/yii-console": "^2.0"
"symfony/console": "^6.4",
"symfony/finder":"^5.4"
},
"require-dev": {
"cycle/entity-behavior": "^1.0",
"jetbrains/phpstorm-attributes": "^1.0",
"maglnet/composer-require-checker": "^4.3",
"phpunit/phpunit": "^9.6",
"rector/rector": "^1.0",
"roave/infection-static-analysis-plugin": "^1.25",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.7",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ In `yii-cycle` package schema can be built from multiple sources represented by
In order to use multiple schema providers in turn, grouping `Cycle\Schema\Provider\Support\SchemaProviderPipeline`
provider is used. You can configure this provider in `schema-providers` section of a `config/params.php` file.
Arrage schema providers in such an order, that caching providers are at the top of the list,
and origin schema providers at the end.

and origin schema providers at the end.

## Entity attributes based schema

Expand Down
1 change: 0 additions & 1 deletion docs/es/README.md → docs/guide/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Este paquete proporciona una manera conveniente de integrarlo con el framework Y

- [Instalación y configuración](installation.md)
- [Comandos de consola](console-commands.md)
- [Clase EntityReader](entity-reader.md)
- [Lectura del esquema de datos](reading-schema.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/ru/README.md → docs/guide/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Cycle — это DataMapper ORM, спроектированный для без

- [Установка и настройка](installation.md)
- [Консольные команды](console-commands.md)
- [Класс EntityReader](entity-reader.md)
- [Чтение схемы данных](reading-schema.md)

# Другие пакеты
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions docs/internals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Internals

## Unit testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```shell
./vendor/bin/phpunit
```

## Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:

```shell
./vendor/bin/roave-infection-static-analysis-plugin
```

## Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```shell
./vendor/bin/psalm
```

## Code style

Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
use either newest or any specific version of PHP:

```shell
./vendor/bin/rector
```

## Dependencies

Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
[Composer](https://getcomposer.org/) dependencies.
27 changes: 27 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
arogachev marked this conversation as resolved.
Show resolved Hide resolved
]);

$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
]);
};
5 changes: 1 addition & 4 deletions src/Command/CycleDependencyProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@

final class CycleDependencyProxy
{
private ContainerInterface $container;

public function __construct(ContainerInterface $container)
public function __construct(private ContainerInterface $container)
{
$this->container = $container;
}

public function getDatabaseProvider(): DatabaseProviderInterface
Expand Down
7 changes: 1 addition & 6 deletions src/Command/Migration/BaseMigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@

abstract class BaseMigrationCommand extends Command
{
protected CycleDependencyProxy $promise;

protected const MIGRATION_STATUS = [
State::STATUS_UNDEFINED => 'undefined',
State::STATUS_PENDING => 'pending',
State::STATUS_EXECUTED => 'executed',
];

public function __construct(CycleDependencyProxy $promise)
public function __construct(protected CycleDependencyProxy $promise)
{
$this->promise = $promise;
parent::__construct();
}

Expand Down Expand Up @@ -62,8 +59,6 @@ protected function createEmptyMigration(
}

/**
* @param OutputInterface $output
*
* @return MigrationInterface[]
*/
protected function findMigrations(OutputInterface $output): array
Expand Down
3 changes: 1 addition & 2 deletions src/Command/Migration/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Yiisoft\Yii\Console\ExitCode;

final class CreateCommand extends BaseMigrationCommand
{
Expand All @@ -27,6 +26,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$this->createEmptyMigration($output, $customName);

return ExitCode::OK;
return self::SUCCESS;
}
}
Loading