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

Timer validator disallows whitespace at the end or in the beginning #4818

Open
zxuanhong opened this issue Feb 5, 2025 · 5 comments
Open
Labels
backlog Queued in backlog bug Something isn't working spring cleaning Could be cleaned up one day

Comments

@zxuanhong
Copy link

zxuanhong commented Feb 5, 2025

Describe the bug

  1. This cron expression is error???? Why can deployment be successful and run normally(0/1 * * * * ? )
Image

Steps to reproduce

  1. Cron expression validation exception

Expected behavior

  1. Can correctly verify cron expressions

Environment

  • OS: [e.g. MacOS 10.2, Windows 10] macos 15.3
  • Camunda Modeler Version: [e.g. 2.0.0] 5.31.0
  • Execution Platform: [e.g. Camunda 7, Camunda 8] Camunda 8

Additional context

No response

@zxuanhong zxuanhong added the bug Something isn't working label Feb 5, 2025
@zxuanhong zxuanhong changed the title This cron expression is incorrect(0/1 * * * * ? )???? Why can deployment be successful and run normally This cron expression is error(0/1 * * * * ? )???? Why can deployment be successful and run normally Feb 5, 2025
@barmac
Copy link
Collaborator

barmac commented Feb 13, 2025

I am able to reproduce this issue. We are too strict when validating cron expressions.

@barmac barmac reopened this Feb 13, 2025
@barmac barmac changed the title This cron expression is error(0/1 * * * * ? )???? Why can deployment be successful and run normally Timer validator disallows whitespace at the end or in the beginning Feb 13, 2025
@barmac
Copy link
Collaborator

barmac commented Feb 13, 2025

This problem is present when you add whitespace to the expression, e.g.

+  * * * * * * 
- * * * * * *

The timer is successfully registered even though linting shows an error.
I can see two ways to fix it:

  1. Trim the value saved in the XML
  2. Change validation to accept whitespace

Is there any use case to keep the whitespace?

@barmac barmac added backlog Queued in backlog spring cleaning Could be cleaned up one day labels Feb 13, 2025
@barmac
Copy link
Collaborator

barmac commented Feb 13, 2025

It's a small issue with little complexity. It needs to be fixed in the timer rule: https://github.com/camunda/bpmnlint-plugin-camunda-compat/tree/main/rules/camunda-cloud/timer

@nikku
Copy link
Member

nikku commented Feb 13, 2025

If this is about whitespace, then bpmn-io/properties-panel#309 is relevant. I do think that the rule should simply be a little bit more forgiving, and trimming whitespace (in the modeler) is a separate issue.

@barmac
Copy link
Collaborator

barmac commented Feb 13, 2025

I think so. The cron expression from the screenshot that I typed manually worked fine. Only after I added the whitespace, the Modeler reported a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog bug Something isn't working spring cleaning Could be cleaned up one day
Projects
None yet
Development

No branches or pull requests

3 participants