Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[make:schedule] a new command for creating recurring Symfony Schedules #1487

Merged
merged 5 commits into from Mar 27, 2024

Conversation

jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented Mar 22, 2024

  • adds a new make:schedule command

  • creates stateful schedulers

  • If Symfony/Scheduler is not already installed - rather than using an exit early strategy - we composer install symfony/scheduler. This is the "shift" MakerBundle is making to handling missing dependencies.

  • We check any files in src/Message -> if files exist -> ask the user to select a message class to use with the new schedule. The "suggested name" of the new schedule is the filename of the message w/ the Message suffix removed.
    image

  • The user also has the ability to select "Empty Message" to create a new schedule regardless if any message were found. This will create a "empty" schedule.

  • If no existing messages exist -> ask the user the name of the "empty" schedule we'll create
    image

Empty Schedule:
image

Schedule from message:
image

@jrushlow jrushlow added the Feature New Feature label Mar 22, 2024
@jrushlow jrushlow changed the title WIP - make:scheduler [make:schedule] a new command for creating recurring Symfony Schedules Mar 24, 2024
@jrushlow jrushlow marked this pull request as ready for review March 24, 2024 08:57
@jrushlow jrushlow added the Status: Needs Review Needs to be reviewed label Mar 24, 2024
}
}

// Otherwise call `make:message` to create a new message
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This could be cool todo. Idea is in the choice list we have:
0 -> Empty Schedule
1 -> New Schedule
2 -> ...

But I can't remember if a) this is actually dooable to run a maker inside a maker without duplicating code && b) if there arn't any messages, or if symfony/messenger is not installed - what should we do...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're going to skip this for now. Revisit at a later time...

@jrushlow jrushlow merged commit 74a8918 into symfony:main Mar 27, 2024
6 checks passed
@jrushlow jrushlow deleted the feature/make-scheduler branch March 27, 2024 21:49
@jrushlow jrushlow mentioned this pull request Apr 5, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant