Skip to content

feat(installer): validate --symfony-docker-ref - #3024

Merged
soyuka merged 4 commits into
api-platform:mainfrom
BenMacha:fix-symfony-docker-ref-option
Nov 6, 2026
Merged

soyuka merged 4 commits into
api-platform:mainfrom
BenMacha:fix-symfony-docker-ref-option

Conversation

@BenMacha

@BenMacha BenMacha commented Nov 1, 2026

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

--symfony-docker-ref was only checked for emptiness and then passed to git fetch --depth=1 --quiet origin <ref>, so a value starting with - (e.g. --upload-pack=…) was read by git as an option. The value must now look like a ref or a SHA (^[A-Za-z0-9][A-Za-z0-9._/-]*$, no ..), otherwise the command fails with the usual invalid option error.

Tests: InstallerCommandTest (rejected values and an accepted feature/my-branch).

The option was only checked for emptiness before being passed to
`git fetch --depth=1 origin <ref>`, so a value such as
`--upload-pack=...` was parsed by git as an option instead of a ref.
Refs must now look like a branch, tag or SHA and cannot contain "..".
The previous pattern refused valid branch and tag names containing "+" or
"@", such as release+metadata. The value is now checked against the rules
of git check-ref-format, still refusing a leading "-".
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-11-01T08:08:05.471866Z 700ce92 PR opened
ℹ️ 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 review" or "@codex security review".

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: 700ce922d0

ℹ️ 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 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 address that feedback".

Comment thread src/InstallerCommand.php Outdated
public const DOCS = ['swagger_ui', 'redoc', 'scalar'];

private const NAME_PATTERN = '/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/';
private const GIT_REF_PATTERN = '#^[a-zA-Z0-9][a-zA-Z0-9._/-]*$#D';

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 Preserve valid Git ref names

When a user selects a valid branch or tag containing + or @ (for example, release+metadata or feature/@alice), this pattern rejects it before the scaffold reaches git fetch. git check-ref-format --branch accepts both names, and git fetch origin <ref> succeeds for them, so the validator prevents using otherwise valid Git refs.

Useful? React with 👍 / 👎.

@soyuka soyuka changed the title fix: validate the --symfony-docker-ref value feat(installer): validate --symfony-docker-ref Nov 6, 2026
@soyuka
soyuka merged commit 95844eb into api-platform:main Nov 6, 2026
6 of 7 checks passed
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.

2 participants