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

[API] Add BC layer for transition from :read to :index and :show serialization groups #15780

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

TheMilek
Copy link
Member

@TheMilek TheMilek commented Jan 29, 2024

Q A
Branch? 1.13
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
License MIT

BC layer for #15770

@TheMilek TheMilek added DX Issues and PRs aimed at improving Developer eXperience. API APIs related issues and PRs. labels Jan 29, 2024
@TheMilek TheMilek requested a review from a team as a code owner January 29, 2024 14:22
@probot-autolabeler probot-autolabeler bot added the Maintenance CI configurations, READMEs, releases, etc. label Jan 29, 2024
@TheMilek TheMilek marked this pull request as draft January 29, 2024 14:30
Copy link

github-actions bot commented Jan 29, 2024

Bunnyshell Preview Environment deleted

Available commands:

  • /bns:deploy to redeploy the environment

jakubtobiasz added a commit that referenced this pull request Jan 31, 2024
This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13 <!-- see the comment below -->                  |
| Bug fix?        | no                                                      |
| New feature?    | yes                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no<!-- don't forget to update the UPGRADE-*.md file --> |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.12 branch
 - Features and deprecations must be submitted against the 1.13 branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->

here is only split of the read group to show and index, in another PR there is a [BC layer](#15780) to handle it



Commits
-------
  [Country] Split read serialization group
  [Currency] Split read serialization group
  [Address] Split read serialization group
  [Adjustment] Split read serialization group
  [AdminUser] Split read serialization group
  [AvatarImage] Split read serialization group
  [Promotion] Split read serialization group
  [Channel] Split read serialization group
  [ChannelPriceHistoryConfig] Split read serialization group
  [Customer] Split read serialization group
  [ExchangeRate] Split read serialization group
  [Locale] Split read serialization group
  [Order] Split read serialization group
  [Payment] Split read serialization group
  [Product] Split read serialization group
  [Shipment] Split read serialization group
  [Tax] Split read serialization group
  [Taxon] Split read serialization group
  [Zone] Split read serialization group
@TheMilek TheMilek force-pushed the SYL-3301 branch 4 times, most recently from 40bc20d to 740a040 Compare January 31, 2024 13:11
Comment on lines +44 to +67
foreach ($groups as $group) {
if ($this->shouldReadGroupBeAdded($group) && !$this->skipAddingReadGroup) {
$readGroup = str_replace([':show', ':index'], ':read', $group);

if (in_array($readGroup, $groups, true)) {
continue;
}

$groups[] = $readGroup;
}

if ($this->shouldIndexAndShowGroupsBeAdded($group) && !$this->skipAddingIndexAndShowGroups) {
$indexGroup = str_replace(':read', ':index', $group);
$showGroup = str_replace(':read', ':show', $group);

if (!in_array($indexGroup, $groups, true)) {
$groups[] = $indexGroup;
}

if (!in_array($showGroup, $groups, true)) {
$groups[] = $showGroup;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified, especially w/ the static flags

@NoResponseMate NoResponseMate merged commit a223d99 into Sylius:1.13 Jan 31, 2024
28 checks passed
@NoResponseMate
Copy link
Contributor

Thank you, @TheMilek!

@TheMilek TheMilek deleted the SYL-3301 branch January 31, 2024 20:25
GSadee pushed a commit to Sylius/SyliusApiBundle that referenced this pull request Feb 2, 2024
This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13 <!-- see the comment below -->                  |
| Bug fix?        | no                                                      |
| New feature?    | yes                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no<!-- don't forget to update the UPGRADE-*.md file --> |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.12 branch
 - Features and deprecations must be submitted against the 1.13 branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->

here is only split of the read group to show and index, in another PR there is a [BC layer](Sylius/Sylius#15780) to handle it



Commits
-------
  [Country] Split read serialization group
  [Currency] Split read serialization group
  [Address] Split read serialization group
  [Adjustment] Split read serialization group
  [AdminUser] Split read serialization group
  [AvatarImage] Split read serialization group
  [Promotion] Split read serialization group
  [Channel] Split read serialization group
  [ChannelPriceHistoryConfig] Split read serialization group
  [Customer] Split read serialization group
  [ExchangeRate] Split read serialization group
  [Locale] Split read serialization group
  [Order] Split read serialization group
  [Payment] Split read serialization group
  [Product] Split read serialization group
  [Shipment] Split read serialization group
  [Tax] Split read serialization group
  [Taxon] Split read serialization group
  [Zone] Split read serialization group
GSadee added a commit that referenced this pull request Feb 14, 2024
… add missing contract tests (TheMilek)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13 <!-- see the comment below -->                  |
| Bug fix?        | a bit                                                       |
| New feature?    | no                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no <!-- don't forget to update the UPGRADE-*.md file --> |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.12 branch
 - Features and deprecations must be submitted against the 1.13 branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
Related to #15780

Commits
-------

66b4df0 fix ship shipments
fe0ff72 [Order] Add missing serialization groups
d36fc23 [Payment] Fix serialization groups
c48c6d9 [Adjustment] Add missing contract tests
7129bcb [AdminUser] Add missing contract tests
7c067d3 [Zone] Fix serialization groups and add missing contract tests
f03aa27 [Country] Fix serialization groups and add missing contract tests
b60d8cc [Product] Fix serialization groups and add missing contract tests
562a7b4 [Shipment] Add missing contract tests
f3672b6 [Currency] Add missing contract tests
d3c03e8 [Customer] Add missing contract tests
51830aa [Channel] fix serialization groups
9dc51f9 [Address] add missing contract test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs. DX Issues and PRs aimed at improving Developer eXperience. Maintenance CI configurations, READMEs, releases, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants