Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tractusx-dev] [Website] New: pull request previews on request with /preview
  • From: Mathias Brunkow Moser <mathias.moser@xxxxxxxxxxxx>
  • Date: Fri, 27 Nov 2026 17:35:05 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=catena-x.net; dmarc=pass action=none header.from=catena-x.net; dkim=pass header.d=catena-x.net; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z76NCvh+RRfY0k17SqYFJmG4U3MoDf9aGK8wkprsGUY=; b=Te4SEqSggWAdhNoGfzMc4o5HNAY3patrPgtfoJvCzJuPK8FunWOFAoBALR0FRMge+kgv8EGXSQBMkGJzXz1wUZPJYryh0nQFqhz1GpnOzj1Vf4pwXB1HGifp2ZZzGU8TcuHYQajTVnJHevwe9k6IvtDDBivF3ociHo9brSrQscjIixJ2q1uOr9Vq5lIOBgl8www/G06CaHU3F3lsfw54ObrR7i8avkN9g//Molgkstp7xFi8WYgyDE+XhzPOcUTdWqnIjLaQl+6ULwE4k/Bm4ZARGw93lz+SJzhOjuU/cW100+A3QWa9356Zyys2+AXAp8lbTa3RtRpGxgy7HxptYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iSFx9BIIXgqfKwfgMqzZEyMGvwLyCECqvlPA5OCb7xlqJeMbrnP5g7bDjLTooKuh+mepqEtFzrsQ4QsCuG9LIZPnJMZdP5YT0Y5ClfdFkbmGsB6U7dxQW47hVbbu7GJscXNX22DKUwge/+lH+xy3jkk2bvJNpufUW8amV2BhZJyUptmRFH453n7BqBLB7a2tto4v17hLWVVY4OawdAXSIqOuz+mwiKKNcaOlMwOx8z6xW8ZGufw+Tn55BWOLKVa1gWTxE3yzv+r2mk+cuD/E0ni7lEf2AS7p1fPczFiMWlAaLBiOWI4Q114F8oryOSJfDotlQGQZRiW48UVwdnQZEg==
  • Delivered-to: tractusx-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tractusx-dev/>
  • List-help: <mailto:tractusx-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tractusx-dev>, <mailto:tractusx-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tractusx-dev>, <mailto:tractusx-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHdfpM5Pe1g+OCGUkCTh3qv8eYa3A==
  • Thread-topic: [Website] New: pull request previews on request with /preview

Hi all,

We have reworked how previews of pull requests to the Eclipse Tractus-X website (eclipse-tractusx.github.io) work. The changes are in pull request #1662 and apply once it is merged. Here is how to use them.

Why we changed it: we are running out of space

The live website and the previews of all pull requests are published from the same gh-pages branch, and GitHub Pages only accepts a site up to a certain size. That space is shared: every preview takes space away from the live website and from the other previews.

We have reached that limit. Every frozen KIT release is a complete copy of all KITs, so the website keeps growing with each release, and a full build is already well over 1 GB. In our deployments, sites of up to about 3.3 GB were published, while 4.4 GB and more failed. When a deployment fails because the site is too large, nothing is published at all, not even the live website. A few large previews can therefore block updates to the production site.

So far, previews were also removed automatically and without notice to make space, oldest first. Reviewers found their preview gone and did not know why, or how to get it back.

The changes address both problems:

  • Previews only contain the pages a pull request changes, so they are much smaller.
  • The workflows check the space before every deployment and keep the whole site below 2.5 GB, so the live website always gets published.
  • Previews are no longer removed silently. When space runs out, a committer decides which preview to replace, the affected author is notified, and the preview can be brought back at any time.
  • Pull requests that do not change the website are not built at all, which also saves GitHub Actions minutes.

1. The commands

Committers write these as a normal comment on the pull request:

Comment
What it does
/preview
Publishes the preview of this pull request at https://eclipse-tractusx.github.io/pr/<number>/, using its latest successful build (no rebuild).
/preview replace 1655
Removes the preview of pull request #1655 and publishes this one in its place, in one step. Use it when GitHub Pages has no space left.
/preview rebuild
Builds the pull request again when its saved build has expired (builds are kept for 90 days). The preview is published when the build has finished.

To save GitHub Actions minutes, a build is never run again on its own. If a committer comments /preview after the build has expired, the bot replies that it has expired and points to /preview rebuild.

The bot answers with a reaction only: 🚀 when the deployment has started, 😕 if the command is not valid. Comments from people who are not committers are ignored, so the command cannot be misused.

2. What you see on the pull request

Every pull request has one preview comment that the bot keeps up to date. When the preview is published, it shows the link, the commit it was built from, the build and the list of changed pages.

When GitHub Pages is full, the preview is not published. Instead the comment lists the current previews, for example:

The preview could not be published: there is not enough space left on GitHub Pages.
A committer can replace one of these previews:
Pull request
Size
Published
Command
#1655
120 MB
12 Nov
/preview replace 1655
#1671
85 MB
18 Nov
/preview replace 1671
#1688
40 MB
24 Nov
/preview replace 1688

Copy one of the commands into a new comment, and the swap happens.

3. A typical flow

  1. You push to your pull request. The website is built and the preview is published automatically, if there is space.
  2. If there is no space, the comment shows a list like the one above.
  3. A committer comments /preview replace 1655.
  4. Your preview goes live. On #1655 the preview comment is updated, and its author gets a new comment that mentions them, saying their preview was replaced.
  5. Nothing is lost: preview builds are kept for 90 days, so a committer can comment /preview on #1655 later and it comes back immediately, without a rebuild. After 90 days, /preview rebuild builds it again.
  6. When a pull request is closed or merged, its preview and its saved builds are removed automatically.

4. No build when the website does not change

Pull requests that only change workflows or other files under .github/, the root README, CHANGELOG, license or notice files now skip the build and the preview. The required check Build static website shows as skipped, which counts as passed, so these pull requests are not blocked.

5. Diagrams and details

The full explanation, with diagrams of the overall flow, the replace sequence, the no-space decision and the life of a preview, is in the workflows README. GitHub renders the diagrams directly.

image.png

6. How a preview is built?

A full build of the website is well over 1 GB, mostly because every frozen KIT release is a complete copy of all KITs. GitHub Pages has limited space and shares it between the live website and all previews, so a preview only contains what the pull request actually changes:

Smaller build. The preview is built with only the KIT versions a pull request can change: "Next", the latest release and any older release the pull request touches. Older releases are left out.
Only the changed pages are kept. After the build, only the pages affected by the files changed in the pull request are kept. Everything else is removed from the preview.
Everything else comes from the live website. Any link in the preview to a page that was not changed opens that page on the live website, so you can still click through the whole site.
You always know what you are looking at. The announcement bar of the preview shows the pull request and the commit it was built from. The preview comment on the pull request lists the changed pages, with direct links.
This keeps most previews at a few MB instead of more than a GB. Changes that affect every page (for example a component or the site configuration) produce a larger preview; previews over 300 MB are not published, and the build can be downloaded from the workflow run instead.

Separately, the complete site is still built for every pull request, exactly like production, to check that it builds and has no broken links. That build is the required check Build static website.


Feedback and questions are very welcome, here or on the pull request.

Best regards,
Mathias Moser


Back to the top