Skip to content

Add manual publish workflow with PHP version selection - #489

Merged
jolelievre merged 1 commit into
PrestaShop:masterfrom
jolelievre:manual-publish-workflow
Oct 21, 2026
Merged

jolelievre merged 1 commit into
PrestaShop:masterfrom
jolelievre:manual-publish-workflow

Conversation

@jolelievre

Copy link
Copy Markdown
Contributor

Why

publish.yml only runs on push to master and only rebuilds images whose files changed (any change in base/ rebuilds everything). Forcing a republish required a fake commit.

What

New Publish images manually workflow (workflow_dispatch), restricted to the prestashop-sa team via the shared team-guard action (same as sync-releases.yml).

Inputs:

  • php_versions: all (default) or a comma separated list, e.g. 8.1,8.4
  • build_base: rebuild and push the base images of these PHP versions (default true)
  • build_prestashop: rebuild and push every PrestaShop image using these PHP versions (default true)

Selected images are force pushed even if the tag already exists on Docker Hub. PrestaShop images build after the base images, or alone when build_base is off. An unknown PHP version fails the run early.

get_json_versions.py gains --php, --base and --php-for options to compute the matrices. Its default output (used by publish.yml) is unchanged, covered by a test. publish.yml is untouched.

Docs added in HOW-TO-USE.md.

How to test

  • nosetests and flake8 pass
  • After merge (dispatch needs the workflow on the default branch): run with php_versions=8.5 and build_prestashop off as a smoke test, and check a non prestashop-sa user is rejected

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Oct 21, 2026

@mattgoud mattgoud left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review 馃煝 no blocker

Checks

.ai conventions: 馃煝

Source Result
Contexts read none, PrestaShop/docker has no .ai/ tree (core PHP conventions do not apply to this Python and workflow diff)
pr-hygiene.py 馃煝 clean
code-standards.py not applicable (no PHP)

Tested on: master @ a89de43 (the PR base), PR head 732a24f, Python 3.12, no docker
Run: tests/test_get_json_versions.py 12 passed, flake8 clean (also green in the nose and flake8 jobs, which do collect the new test module). Parity check: for each of the 339 PrestaShop/PHP pairs of versions.py, VersionManager.parse_version("<ps>-<php>") returns exactly the images parse_version("<ps>") gives for that PHP, so tag push "$PS_VERSION-$php_version" in the loop builds the same tags and aliases as publish.yml, branches, nightly and classic distributions included. CLI probed with all, ALL, 8, 8.1-apache, 8.1$(id), blank and comma-only selections.
Not run: the workflow itself (dispatch needs it on the default branch), actionlint (not installed locally). The job conditions were read by hand: guard failure skips everything, build_base off lets publish_prestashop run on a skipped publish_base, a base failure stops the PrestaShop builds.

Findings

  • 馃煚 Should fix: php_versions defaults to all with both booleans on, so dispatching without touching the form force rebuilds and overwrites every tag on Docker Hub. Drop the default and let the operator type all.
  • 馃煛 Nit: a blank selection (" ", " , ") passes required, filters to [] and the run goes green with nothing built. Exit in main() on an empty list.
  • 馃挕 Suggestion: the publish-images-manual concurrency group only serialises manual runs; a manual run and a push triggered publish.yml can still force push the same tag at the same time. Sharing a group means touching publish.yml, so a follow-up at most.

php_versions:
description: 'PHP versions to rebuild, comma separated (e.g. 8.1,8.4), or "all"'
required: true
default: 'all'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

馃煚 Should fix: with this default and both booleans on, one click on Run workflow without touching the form force rebuilds and overwrites every tag: 20 base images and 339 PrestaShop/PHP pairs (2 containers each, 3 platforms) at max-parallel: 2, the old 1.7.7.x tags included. Dropping the default (all stays a value the operator types) makes a full republish a deliberate choice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Seems fair for the default behaviour to me, sure we have to be careful, but we're professionals 馃槈

Comment thread get_json_versions.py
def parse_php_versions(value):
if value is None or value.strip() == 'all':
return None
return [php.strip() for php in value.split(',') if php.strip()]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

馃煛 Nit: a blank selection like " " or " , " passes the required check and comes out as [], so the run goes green with nothing built (locally, --php " , " --base prints []). Exiting in main() when the list is empty would match the "fails early" of the description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Really nit, if it's small why not add a a check

The concurrency suggestion however seems really important

Republishing images required a fake commit since publish.yml only runs
on push and only rebuilds changed images. The new workflow_dispatch
workflow, restricted to prestashop-sa, force pushes base and PrestaShop
images for selected PHP versions (or all).

Both publish workflows share a concurrency group so they never force
push the same tags at the same time.

get_json_versions.py gains --php, --base and --php-for options; its
default output, used by publish.yml, is unchanged.
@jolelievre
jolelievre force-pushed the manual-publish-workflow branch from 732a24f to 3008f59 Compare October 21, 2026 12:02
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Oct 21, 2026
@jolelievre
jolelievre merged commit 3bc9c18 into PrestaShop:master Oct 21, 2026
2 checks passed
@jolelievre
jolelievre deleted the manual-publish-workflow branch October 21, 2026 12:13
@github-project-automation github-project-automation Bot moved this from To be tested to Merged in PR Dashboard Oct 21, 2026
@ps-jarvis ps-jarvis moved this from Merged to To be tested in PR Dashboard Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: To be tested

Development

Successfully merging this pull request may close these issues.

4 participants