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

Check changes even for services #16

Merged
merged 31 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c9b5973
WIP Check changes command
LucaGallinari Oct 9, 2023
17448ca
WIP check in decoratedDefitions with sylius class id (#24187)
LucaGallinari Oct 9, 2023
0263f28
Verbose output
LucaGallinari Oct 9, 2023
deda4f7
Rename service
LucaGallinari Oct 9, 2023
33ca7fa
Get diff using git dependency
LucaGallinari Oct 9, 2023
722e944
Change namespace of passes
LucaGallinari Oct 9, 2023
b69425e
Add first test for service changes command
LucaGallinari Oct 9, 2023
065f7c4
Catch exception in test tearDown
LucaGallinari Nov 13, 2023
0d57df0
Test directly decorated services
LucaGallinari Nov 27, 2023
e8d7270
Test for other decoration strategy
LucaGallinari Nov 27, 2023
a3eab80
Refactor naming and paths
LucaGallinari Nov 27, 2023
5750d32
It does not detect any changes test
LucaGallinari Dec 11, 2023
4fde1e3
Refactor + comments
LucaGallinari Dec 11, 2023
a1f8a0d
Add todos + fix verbosity
LucaGallinari Jan 15, 2024
85de566
Alerts about Sylius services with "App" class
LucaGallinari Jan 15, 2024
9de0ae6
Remove unused definition pass
LucaGallinari Jan 22, 2024
6cc45a8
Output based on verbosity
LucaGallinari Jan 22, 2024
449802e
Refactor: extract strategies in methods
LucaGallinari Jan 22, 2024
6972a13
Remove strategy that is covered by others
LucaGallinari Jan 22, 2024
27aaceb
Remove duplicated strategy
LucaGallinari Jan 22, 2024
c20b4ff
Extract utility method
LucaGallinari Jan 22, 2024
e6a7d04
More extraction into methods
LucaGallinari Jan 22, 2024
1a35898
Better output
LucaGallinari Jan 22, 2024
43ffd7b
Specify interfaces for decorated methods in tests
LucaGallinari Feb 5, 2024
8d3a940
Fix phpstan and psalm
LucaGallinari Feb 5, 2024
4b3afae
Typos
LucaGallinari Feb 12, 2024
2a5d7dd
Fixes after upgrade
lruozzi9 May 13, 2024
a474b34
Fix Psalm
lruozzi9 May 13, 2024
8f2d0b9
Do not reference test classes in non test services
LucaGallinari May 13, 2024
4573e84
Add changed services command description and example to README
LucaGallinari May 13, 2024
9a21766
Add sylius 1.13 to supported version
LucaGallinari May 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
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
## Requirements

* PHP `^8.0`
* Sylius `^1.11.2 || ^1.12`
* Sylius `^1.11.2 || ^1.12 || ^1.13`

## Installation

Expand All @@ -43,7 +43,7 @@ All features are implemented as **console commands**.

bin/console webgriffe:upgrade:template-changes <from-version> <to-version> [--theme=PATH_TO_YOUR_THEME] [--legacy]

Print a list of template files (with extension .html.twig) that changed between two given Sylius versions and that has been overridden in your project: in root "templates" folder and/or in a custom theme.
Print a list of template files (with extension .html.twig) that changed between two given Sylius versions and that have been overridden in your project: in root "templates" folder and/or in a custom theme.

You have to specify both the versions **from** and **to** you want to compute the changes.

Expand Down Expand Up @@ -72,6 +72,34 @@ There are two optional parameters:
bin/console webgriffe:upgrade:template-changes v1.8.8 v1.9.3 --theme=themes/my-website-theme --theme=themes/my-other-theme --theme=vendor/acme/my-vendor-theme
```

### Decorated services changes

bin/console webgriffe:upgrade:service-changes <from-version> <to-version> [--theme=PATH_TO_YOUR_THEME] [--legacy]

Print a list of services that changed between two given Sylius versions and that have been decorated/overridden in your project.

You have to specify both the versions **from** and **to** you want to compute the changes.

There are two optional parameters:
* **--namespace-prefix=NAMESPACE-PREFIX**, the first part of the namespace of your app services, like "App" in "App\Calculator\PriceCalculator". Default: "App".
* **--alias-prefix=ALIAS-PREFIX**, the first part of the alias of your app services, like "app" in "app.calculator.price". Default: "app".


#### Examples

* List of services that changed between Sylius v1.11.0 and v1.13.0 and that were decorated in your project:

```bash
bin/console webgriffe:upgrade:service-changes v1.11.0 v1.13.0
```

* List of services that changed between Sylius v1.11.0 and v1.13.0 and that were decorated in your project but with custom namespace and alias prefixes:

```bash
bin/console webgriffe:upgrade:service-changes v1.11.0 v1.13.0 --namespace-prefix="Webgriffe" --alias-prefix="webgriffe"
```


## Contributing

To contribute to this plugin clone this repository, create a branch for your feature or bugfix, do your changes and then make sure al tests are passing.
Expand Down
5 changes: 5 additions & 0 deletions config/services/command.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@
<argument type="string">%kernel.project_dir%</argument>
<tag name="console.command" />
</service>

<service id="webgriffe_sylius_upgrade.command.service_changes" class="Webgriffe\SyliusUpgradePlugin\Command\ServiceChangesCommand">
<argument type="service" id="webgriffe_sylius_upgrade.client.git" />
<tag name="console.command" />
</service>
</services>
</container>
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ parameters:
excludePaths:
# Makes PHPStan crash
- 'src/DependencyInjection/Configuration.php'
# Override a Symfony class
- 'src/DependencyInjection/Compiler/DecoratorServicePass.php'

# Test dependencies
- 'tests/Application/app/**.php'
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
<file name="src/DependencyInjection/Compiler/DecoratorServicePass.php" />
</ignoreFiles>
</projectFiles>
</psalm>
Loading
Loading