Repository navigation
feat(installer): validate --symfony-docker-ref - #3024
Conversation
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 "-".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 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".
| 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'; |
There was a problem hiding this comment.
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 👍 / 👎.
--symfony-docker-refwas only checked for emptiness and then passed togit 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 acceptedfeature/my-branch).