Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .danger.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
$files = $context->platform->pullRequest->getFiles();

if ($files->matches('changelog/_unreleased/*.md')->count() > 0) {
$context->failure('The Pull Request makes use of the old changelog format. Please document your changes in the `RELEASE_INFO-6.7.md` and `UPGRADE-6.8.md` file respectively.');;
$context->failure('The Pull Request makes use of the old changelog format. Please document your changes in the `RELEASE_INFO-6.7.md` and `UPGRADE-6.8.md` file respectively. For detailed infos please refer to the [release documentation guide](https://github.com/shopware/shopware/blob/trunk/delivery-process/documenting-a-release.md).');;
}
})

->useRule(function (Context $context): void {
$files = $context->platform->pullRequest->getFiles();

if ($files->matches('RELEASE_INFO-6.7.md')->count() === 0) {
$context->warning('The Pull Request doesn\'t contain any release info, if your changes are relevant for external developers please add an entry to the release info file, including the consequences of the change and how it affects external developers.');
$context->warning('The Pull Request doesn\'t contain any release info, if your changes are relevant for external developers please add an entry to the release info file, including the consequences of the change and how it affects external developers. For detailed infos please refer to the [release documentation guide](https://github.com/shopware/shopware/blob/trunk/delivery-process/documenting-a-release.md).');
}
})

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If the issue exists only in Jira, include a link to the Jira issue.
- [ ] I have updated developer-facing release notes if this change is **relevant** for external developers:
- Add a short entry to `RELEASE_INFO-6.<major>.md` under “Upcoming” for informational changes, including the consequences of the change and how it affects external developers.
- Add an `UPGRADE` section in `UPGRADE-6.<next-major>.md` for breaking changes (what/why/impact/how to adapt).
- See the [Release Notes & Changelog Process](https://github.com/shopware/shopware/blob/trunk/adr/2025-10-28-changelog-release-info-process.md) for details.
- See the [Documenting a Release Process](https://github.com/shopware/shopware/blob/trunk/delivery-process/documenting-a-release.md) for details.
- [ ] I have written or adjusted the documentation according to my changes
- [ ] This change has comments for package types, values, functions, and non-obvious lines of code
- [ ] I have read the contribution requirements and fulfilled them
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If you want more details about available licensing or the contribution agreement

## Contributing to the Shopware code base
If you want to learn how to contribute code to Shopware, please refer to [Contributing Code](https://developer.shopware.com/docs/resources/guidelines/code/contribution.html).
Also, make sure that you add a changelog file that describes your changes in a meaningful way. For more information refer to [this document](https://github.com/shopware/shopware/blob/trunk/adr/2020-08-03-implement-new-changelog.md).
Also, make sure that if you change something in a manner that is relevant to external developers please describe your change in a meaningful way. For more information refer to [this document](https://github.com/shopware/shopware/blob/trunk/delivery-process/documenting-a-release.md).

## Local Docker Setup

Expand Down
1 change: 1 addition & 0 deletions adr/2025-10-28-changelog-release-info-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ _(Tip: You can use short headings like “What changed” or “How to adjust”
10. CI will later validate that either `RELEASE_INFO` or `UPGRADE` was updated when relevant (or explicitly skipped with justification).

---
For details about how to write entries for these files, please refer to the release [documentation guide](../delivery-process/documenting-a-release.md).

## Consequences

Expand Down
142 changes: 35 additions & 107 deletions delivery-process/documenting-a-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,56 @@ To have a structured and automated workflow:

## Where to Document Changes

### Changelog (auto-generated)

The complete raw changelog for each release is generated automatically from GitHub when a tag is created.
It includes every merged PR and commit and is published on the GitHub **Releases** page.
This changelog is **not curated** and complements the human-maintained `RELEASE_INFO` and `UPGRADE` files.
It’s primarily for internal engineers, support, and partners.

Every PR that introduces a significant change must update one or both of these files:

- RELEASE_INFO.md: Tracks new features, API updates, and general improvements.
- UPGRADE.md: Covers breaking changes, migration steps, and any required developer action.

Developers must edit the version-scoped files RELEASE_INFO-6.x.md and UPGRADE-6.x.md directly in the repository.
The legacy bin/console changelog:create command and /changelog/_unreleased folder are deprecated and scheduled for removal.

## How Do I Know Where to Add My Change?
A simple rule of thumb:
### What needs to go into RELEASE_INFO.md?
* New or major reworked user facing features
* improvements / new developer features
* This **does include**:
* Added extension points
* new/changed best practices / guidelines
* Quality of life improvements for other developers
* This **does not include**:
* Refactorings of internal code
* “under the hood” improvements that are backwards compatible
* deprecations we made
* everything else we changed that developers should be aware of
* Critical bugs (not every bug, therefore we have the complete changelog, but critical ones, esp when we do a patch release because of them should be documented)

Remember: The release notes should describe **why** we made a change and **why** external developers should care; it is **not** (primarily) about **what** you changed.

### What needs to go into UPGRADE.md?
* Everything that might cause a break in projects, extensions, integrations etc.
* Especially every break defined by our backwards compatibility promise needs to be documented: https://developer.shopware.com/docs/resources/guidelines/code/backward-compatibility.html#backward-compatibility

- Use `RELEASE_INFO.md` for:
- Features, API updates, improvements, and non-breaking changes.
- Example: "Added a new admin UI filter for orders."
### When you do not need to (explicitly) document a change

- Use `UPGRADE.md` for:
- Breaking changes, migration steps, and required developer actions.
- Example: "Deprecated sw-popover, use mt-floating-ui instead."

* Everything not included above (esp. non-critical bug fixes, internal refactorings) does not need to be documented in RELEASE_INFO.md or UPGRADE.md.

Those changes do not need to be explicitly documented in the release notes, as we will generate a complete changelog for each release based on the semantic PR titles.
The complete raw changelog for each release is generated automatically from GitHub when a tag is created.
It includes every merged PR and commit and is published on the GitHub **Releases** page.
This changelog is **not curated** and complements the human-maintained `RELEASE_INFO` and `UPGRADE` files.
It’s primarily for internal engineers, support, and partners.

### Where do deprecations go?
When a deprecation is introduced (e.g., in a minor release), document the alternative and the timeline in RELEASE_INFO.md. When the breaking change takes effect (e.g., in a major release), document it in UPGRADE.md with full migration steps.

## What information do we need to provide per topic?
* What we changed
* Why we changed it, the benefit of the change
* Why and when externals need to care
* How they can/need to adjust

## Content Structure

All documented changes should follow this structured format:

1. `RELEASE_INFO.md` (Developer-Facing Changes)

```
# Features
Here we describe all new, changed or improved user facing features.
Expand All @@ -65,94 +81,6 @@ For changes in the app system.
For config and infrastructure related changes.
```

2. `UPGRADE.md` (Breaking Changes & Migration Guides)

Each entry should include:

```
Changes [A] due to [B], so that [C].
Required Actions: [D].
```

- Example:
```
Changes sw-popover due to UI consistency, so that extensions follow a unified component model.
Required Actions: Replace sw-popover with mt-floating-ui.
```

## Markdown Formatting Guidelines

To maintain a consistent structure and reduce merge conflicts, follow these formatting rules when updating RELEASE_INFO.md and UPGRADE.md:

### General Formatting Rules
1. Newlines Before and After Entries
- Every new entry must have a blank line before and after it.
- Example:
```
## Features

- Added support for XYZ functionality.

## API

- Introduced new API endpoint for retrieving order statuses.
```
2. Headings Must Have a Blank Line Above and Below
Example:
```
## Storefront

- Improved checkout performance.
```
3. Use Bullet Points (-) for Entries
- All changes should be written in a bullet list format.
Example:
```
- Fixed an issue where tax calculations were incorrect in certain cases.
```
4. Use Consistent Sentence Structure
- Start with a verb and describe what was added, changed, or removed.
- ✅ Correct:
```- Added a new admin UI filter for orders.
- Fixed an issue where the tax rate was miscalculated.
- Deprecated the `sw-popover` component in favor of `mt-floating-ui`.
```
- ❌ Incorrect:
```
- New admin UI filter for orders.
- Tax rate miscalculation fix.
- The `sw-popover` component has been deprecated.
```
5. Code Formatting
- Use backticks () for inline code and commands.
- Example:
```
- Deprecated `sw-popover`, use `mt-floating-ui` instead.
```
### Example of a Well-Formatted Entry
```
## Features

- Added support for multi-warehouse inventory tracking.

## API

- Introduced `GET /api/v1/orders/status` for fetching order statuses.

## Core

- Refactored product import logic to improve performance.

## UPGRADE.md

### Breaking Changes

- **What changed**: Deprecated `sw-popover`, use `mt-floating-ui` instead.
- **Why**: Improved UI consistency.
- **Impact**: Affects custom admin extensions using `sw-popover`.
- **Required Actions**: Replace `sw-popover` with `mt-floating-ui`.
```

## How This is Made Consistent

1. Every PR must include documentation: If your PR makes a significant change, update RELEASE_INFO.md and/or UPGRADE.md.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
use Shopware\Core\Checkout\Cart\LineItem\LineItemQuantitySplitter;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Contracts\Service\ResetInterface;

#[Package('checkout')]
class LineItemGroupBuilder
class LineItemGroupBuilder implements ResetInterface
{
/**
* @var array<string, LineItemGroupBuilderResult|null>
Expand All @@ -29,6 +30,11 @@ public function __construct(
) {
}

public function reset(): void
{
$this->results = [];
}

/**
* Searches for all packages that can be built from the provided list of groups.
* Every line item will be taken from the cart and only the ones that are left will
Expand Down
14 changes: 13 additions & 1 deletion src/Core/Checkout/Cart/Subscriber/CartOrderEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

namespace Shopware\Core\Checkout\Cart\Subscriber;

use Shopware\Core\Checkout\Cart\Event\BeforeLineItemAddedEvent;
use Shopware\Core\Checkout\Cart\Event\BeforeLineItemRemovedEvent;
use Shopware\Core\Checkout\Cart\Event\CartDeletedEvent;
use Shopware\Core\Checkout\Cart\Event\CheckoutOrderPlacedEvent;
use Shopware\Core\Checkout\Cart\LineItem\Group\LineItemGroupBuilder;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextService;
Expand All @@ -17,7 +20,8 @@
readonly class CartOrderEventSubscriber implements EventSubscriberInterface
{
public function __construct(
private AbstractContextSwitchRoute $contextSwitchRoute
private AbstractContextSwitchRoute $contextSwitchRoute,
private LineItemGroupBuilder $lineItemGroupBuilder
) {
}

Expand All @@ -26,6 +30,8 @@ public static function getSubscribedEvents(): array
return [
CartDeletedEvent::class => ['handleContextAddress', 1],
CheckoutOrderPlacedEvent::class => ['handleContextAddress', 1],
BeforeLineItemAddedEvent::class => 'resetBuilder',
BeforeLineItemRemovedEvent::class => 'resetBuilder',
];
}

Expand All @@ -36,4 +42,10 @@ public function handleContextAddress(CartDeletedEvent|CheckoutOrderPlacedEvent $
SalesChannelContextService::BILLING_ADDRESS_ID => null,
]), $event->getSalesChannelContext());
}

public function resetBuilder(BeforeLineItemAddedEvent|BeforeLineItemRemovedEvent $event): void
{
// We must reset the calculated results when an line item is added or removed.
$this->lineItemGroupBuilder->reset();
}
}
4 changes: 4 additions & 0 deletions src/Core/Checkout/DependencyInjection/cart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@
<argument type="service" id="Shopware\Core\Checkout\Cart\LineItem\Group\RulesMatcher\AnyRuleMatcher"/>
<argument type="service" id="Shopware\Core\Checkout\Cart\LineItem\LineItemQuantitySplitter"/>
<argument type="service" id="Shopware\Core\Checkout\Cart\LineItem\Group\AbstractProductLineItemProvider"/>

<tag name="kernel.reset" method="reset"/>
</service>

<service id="Shopware\Core\Checkout\Cart\LineItem\Group\LineItemGroupServiceRegistry">
Expand Down Expand Up @@ -548,6 +550,8 @@

<service id="Shopware\Core\Checkout\Cart\Subscriber\CartOrderEventSubscriber">
<argument type="service" id="Shopware\Core\System\SalesChannel\SalesChannel\ContextSwitchRoute"/>
<argument type="service" id="Shopware\Core\Checkout\Cart\LineItem\Group\LineItemGroupBuilder"/>

<tag name="kernel.event_subscriber"/>
</service>
</services>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Shopware\Core\Content\Cms\Aggregate\CmsSlot\CmsSlotCollection;
use Shopware\Core\Content\Cms\DataResolver\CriteriaCollection;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\EntityResolverContext;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\ResolverContext;
use Shopware\Core\Framework\Extensions\Extension;
use Shopware\Core\Framework\Log\Package;
Expand Down Expand Up @@ -39,6 +40,8 @@ public function __construct(
* @public
*
* @description Allows you to access to the current resolver-context
*
* @param ResolverContext|EntityResolverContext $resolverContext
*/
public readonly ResolverContext $resolverContext,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Shopware\Core\Content\Cms\Aggregate\CmsSlot\CmsSlotCollection;
use Shopware\Core\Content\Cms\DataResolver\CriteriaCollection;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\EntityResolverContext;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\ResolverContext;
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
Expand Down Expand Up @@ -66,6 +67,8 @@ public function __construct(
* @public
*
* @description Allows you to access to the current resolver-context
*
* @param ResolverContext|EntityResolverContext $resolverContext
*/
public readonly ResolverContext $resolverContext,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Shopware\Core\Content\Cms\Extension;

use Shopware\Core\Content\Cms\Aggregate\CmsSlot\CmsSlotCollection;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\EntityResolverContext;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\ResolverContext;
use Shopware\Core\Framework\Extensions\Extension;
use Shopware\Core\Framework\Log\Package;
Expand Down Expand Up @@ -37,6 +38,8 @@ public function __construct(
* @public
*
* @description Allows you to access to the current resolver-context
*
* @param ResolverContext|EntityResolverContext $resolverContext
*/
public readonly ResolverContext $resolverContext,
) {
Expand Down
1 change: 1 addition & 0 deletions src/Core/Content/DependencyInjection/media.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
</service>

<service id="Shopware\Core\Content\Media\File\DownloadResponseGenerator">
<argument type="service" id="logger"/>
<argument type="service" id="shopware.filesystem.public"/>
<argument type="service" id="shopware.filesystem.private"/>
<argument type="service" id="Shopware\Core\Content\Media\MediaService"/>
Expand Down
7 changes: 6 additions & 1 deletion src/Core/Content/Media/File/DownloadResponseGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use League\Flysystem\FilesystemOperator;
use League\Flysystem\UnableToGenerateTemporaryUrl;
use Psr\Http\Message\StreamInterface;
use Psr\Log\LoggerInterface;
use Shopware\Core\Content\Media\Core\Application\AbstractMediaUrlGenerator;
use Shopware\Core\Content\Media\Core\Params\UrlParams;
use Shopware\Core\Content\Media\MediaEntity;
Expand All @@ -31,6 +32,7 @@ class DownloadResponseGenerator
* @internal
*/
public function __construct(
private readonly LoggerInterface $logger,
private readonly FilesystemOperator $filesystemPublic,
private readonly FilesystemOperator $filesystemPrivate,
private readonly MediaService $mediaService,
Expand All @@ -53,7 +55,10 @@ public function getResponse(
$url = $fileSystem->temporaryUrl($path, (new \DateTime())->modify($expiration));

return new RedirectResponse($url);
} catch (UnableToGenerateTemporaryUrl) {
} catch (UnableToGenerateTemporaryUrl $exception) {
$this->logger->warning($exception->getMessage(), ['exception' => $exception]);
} catch (\Exception $exception) {
$this->logger->critical($exception->getMessage(), ['exception' => $exception]);
}

return $this->getDefaultResponse($media, $context, $fileSystem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getMapping(Context $context): array
];
}

$debug = $this->environment !== 'prod';
$debug = $this->environment === 'dev' || $this->environment === 'test';

$properties = [
'id' => self::KEYWORD_FIELD,
Expand Down
Loading
Loading