Skip to content

Migrate bin/openapi to Symfony Console#1977

Merged
DerManoMann merged 9 commits intozircote:masterfrom
yceruto:sf_console
Mar 30, 2026
Merged

Migrate bin/openapi to Symfony Console#1977
DerManoMann merged 9 commits intozircote:masterfrom
yceruto:sf_console

Conversation

@yceruto
Copy link
Copy Markdown
Contributor

@yceruto yceruto commented Mar 14, 2026

Summary

Migrate bin/openapi from a 270-line standalone script with manual argument parsing to a Symfony Console application, leveraging modern Symfony 8.0 features:

  • #[AsCommand] attribute for command metadata
  • #[MapInput] with a GenerateInput DTO for declarative input definition
  • #[Argument] / #[Option] attributes on DTO properties
  • Invokable command __invoke()
  • Replace custom ConsoleLogger with Symfony's ConsoleLogger
  • Error handling via Symfony's console handler
  • SymfonyStyle for user-facing output (defaults, bootstrap info)

All existing CLI behavior is preserved (output format, exit codes, processor management, comma-separated exclude deprecation warning).

Type of Change

  • Refactor (no functional changes)

Related Issues

Part of #1953

@yceruto yceruto force-pushed the sf_console branch 4 times, most recently from b2fde19 to 3c34378 Compare March 14, 2026 19:37
Copy link
Copy Markdown
Collaborator

@DerManoMann DerManoMann left a comment

Choose a reason for hiding this comment

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

Some minor bits, but looking very nice already!

@yceruto
Copy link
Copy Markdown
Contributor Author

yceruto commented Mar 16, 2026

It seems cs failures are unrelated to this changes

@DerManoMann
Copy link
Copy Markdown
Collaborator

DerManoMann commented Mar 17, 2026

Looks like I might need to update master with some changes for the latest cs-fixer :/

Edit: Although locally it passes - hmmm.

@DerManoMann
Copy link
Copy Markdown
Collaborator

Eh, its rector; trips me up every time!

@DerManoMann
Copy link
Copy Markdown
Collaborator

@yceruto I've updated master

@DerManoMann
Copy link
Copy Markdown
Collaborator

Looking pretty good. I am just not sure I like the double output from the error listener, for example
image

Is the error listener strictly needed? Seems the tests (at least) pass even without it.

@yceruto
Copy link
Copy Markdown
Contributor Author

yceruto commented Mar 30, 2026

Sure, it's not required. I've removed it.

Copy link
Copy Markdown
Collaborator

@DerManoMann DerManoMann left a comment

Choose a reason for hiding this comment

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

Nice one!

@DerManoMann DerManoMann merged commit a800669 into zircote:master Mar 30, 2026
14 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Created backport PR for 5.x:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-1977-to-5.x
git worktree add --checkout .worktree/backport-1977-to-5.x backport-1977-to-5.x
cd .worktree/backport-1977-to-5.x
git reset --hard HEAD^
git cherry-pick -x ce85d8ef2d1e87db5bf31bbedc915b59c927f56f baccd77d5818712bb1666b1c568996e6be863ee7 f18eaf2e24ef1f84798834f5af7e0cdde26d5d55 d7ceb1e19bb4a0139c420cbf6457733b8fabfcd7 734d780f9efe42938b656e1b80c8ca9bf2bcaa27 644fa4d4ac6f67ce8acc33136851991e6e42ac59 c83b434ec0f075ab751555e4aeed3dfb6c24bfc6 b4f97be7ba8f4ffb5f1cc17fc431901585d7c3c2 06aebb86dc9ace17c96744b4d3b019385210149f
git push --force-with-lease

@DerManoMann
Copy link
Copy Markdown
Collaborator

Thanks @yceruto

@yceruto yceruto deleted the sf_console branch March 30, 2026 21:16
This was referenced Mar 30, 2026
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