Skip to content

ci: fail future-compatibility on deprecated core calls - #311

Open
Björn Meyer (BrocksiNet) wants to merge 1 commit into
mainfrom
ci/deprecation-rules-future-compat
Open

Björn Meyer (BrocksiNet) wants to merge 1 commit into
mainfrom
ci/deprecation-rules-future-compat

Conversation

@BrocksiNet

Copy link
Copy Markdown
Contributor

Follow-up to #308, from Dominik Grothaus (@dgrothaus-sw)'s review.

No CI job reported the EntitySearchResult::first() deprecations that #308 removed. The PHPStan jobs install Shopware with --no-dev, so core's rules never load, and phpstan-shopware's future-compatibility rules check announced type changes, not calls to @deprecated methods. After #308 only ShopwareOrderGatewayTest guarded the 6.8 behaviour, and the six other call sites could regress unnoticed.

The future-compatibility job now also installs phpstan/phpstan-deprecation-rules, pinned next to phpstan-shopware, and bin/run.php includes its rules when they are installed. That job analyses against trunk, so a call core deprecated for the next major now fails there. The other PHPStan jobs do not install the package and stay unchanged. The current code produces no findings. Putting one first() call back fails the job with method.deprecated.

The PR also adds the review's inline fix. majorFeatureFlagProvider() now returns iterable with an @return shape like every other unit test provider, so a lane that loads core's PHPStan config no longer reports missingType.generics.

Both changes are in one PR on request.

  • Tests cover the change, or it needs none, such as documentation or CI configuration.
  • A change merchants notice has an entry under # next version in both changelogs.
  • The change works on Shopware 6.5, 6.6 and 6.7 from one codebase.

Load phpstan/phpstan-deprecation-rules in the future-compatibility job,
which analyses against Shopware trunk, so a call core deprecated for the
next major fails there instead of on a 6.8 lane. Also type the order
gateway feature flag provider like every other unit test provider.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T11:22:59.587273Z 827b0d6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 827b0d6fd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread .github/workflows/ci.yml
- name: Install opt-in future compatibility rules
# Do not enable phpstan-shopware's default rules.neon via its extension installer.
run: composer require --dev "shopwarelabs/phpstan-shopware:${PHPSTAN_SHOPWARE_VERSION}" --no-interaction --no-plugins
# The deprecation rules fail the job on calls core already deprecated for the next major.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Narrow the directory-wide deprecation suppression

In the future-compatibility job, a newly introduced deprecated method call anywhere under src/Content/ProductExport/Tracking will still pass: phpstan.neon.dist lines 32–36 suppress every method.deprecated message for that entire directory, not just the intentional addFlags() calls. Narrow that exception to the addFlags() diagnostic and affected files so the new rule actually catches other trunk incompatibilities in this code.

AGENTS.md reference: AGENTS.md:L3-L6

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant