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

Support CRON expression value in Spring Boot property files (application.properties and application.yml) #1329

Open
BoykoAlex opened this issue Aug 20, 2024 · 4 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: enhancement
Milestone

Comments

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Aug 20, 2024

Support syntax validation and possibly highlighting of CRON expressions values inside spring property files (properties/yaml)

spring.integration.poller.cron=0 */30 * ? * *

Likely new CRON value type needs to be added for properties.

Other properties (info from the Spring Core team):

  • spring.session.redis.cleanup-cron
  • spring.session.jdbc.cleanup-cron
  • Might be some in Batch and SCDF

(See support for CRON in IntelliJ: https://www.jetbrains.com/help/idea/scheduled-tasks.html)

@martinlippert martinlippert added for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation and removed status: waiting-for-triage labels Aug 21, 2024
@martinlippert martinlippert added this to the 4.25.0.RELEASE milestone Aug 21, 2024
@BoykoAlex BoykoAlex self-assigned this Aug 21, 2024
@BoykoAlex
Copy link
Contributor Author

@martinlippert likely we may have to give up on this for now as Spring Boot properties metadata has String type for CRON expression and no other helpful metadata. Perhaps the default value if it parses to CronExpression might be used to decide whether this is a CRON expression but it feels as a flaky criteria.
I have pushed some code to support cron parameter as a SPEL or Property Holder but i think this is as far as we can get for now without extra metadata for Cron expression type in the JSON there isn't much we can do. Furthermore, I have only seen CRON expression type value in one property in Spring Integration so far... Thus, it may not worth the effort.

@martinlippert
Copy link
Member

Maybe good enough to hard-code the type of this property instead of defining new metadata for this type.

@BoykoAlex
Copy link
Contributor Author

We can hard-code it, yes, but again there is only one such property that I found hence all the work for one property. We can even have settings for user to add more property keys that support cron expression. It just feels too much work for a little gain so far :-
IntelliJ has no support for cron expressions in properties files... likely this feature does not have high demand...

@martinlippert
Copy link
Member

Agree. Moving to backlog

@martinlippert martinlippert modified the milestones: 4.25.0.RELEASE, Backlog Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants