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

[DSIP-80][Parameter Parser] Improvement the parameter parser #16766

Closed
2 tasks done
liunaijie opened this issue Nov 5, 2024 · 3 comments
Closed
2 tasks done

[DSIP-80][Parameter Parser] Improvement the parameter parser #16766

liunaijie opened this issue Nov 5, 2024 · 3 comments
Labels

Comments

@liunaijie
Copy link
Member

Search before asking

  • I had searched in the DSIP and found no similar DSIP.

Motivation

Now we support 2 kinds of parameter definition.

  1. System variable
    use ${}
  2. Time related variable
    use $[], and in this variable we also support data calculate, like $[add_months(yyyyMMdd,N)]

But now we can't support the case that we need concat a fixed value with a dynamic value.
like /tmp/${system.workflow.instance.id}

Do we need improve the parser to support more flexible definition.
like /tmp/$[yyyy-MM-dd]/${system.workflow.instance.id}

Design Detail

image

refactor the current class, make each class's function clear
create 3 parser implemention

  • InnerSystemParser find the ${} variable, and replace with parameterMap's value
  • TimeParser find the $[] variable, calculate and replace time related placeholder
  • StringParser find the $<> variable, and for loop to find other placeholder, ${}, $[]. replace the response with placeholder.

Compatibility, Deprecation, and Migration Plan

No response

Test Plan

Create new test and update/check exist test

Code of Conduct

@SbloodyS
Copy link
Member

SbloodyS commented Nov 5, 2024

@SbloodyS
Copy link
Member

SbloodyS commented Nov 5, 2024

But now we can't support the case that we need concat a fixed value with a dynamic value.
like /tmp/${system.workflow.instance.id}

I think this is currently supported. Can you give an example?

@liunaijie
Copy link
Member Author

But now we can't support the case that we need concat a fixed value with a dynamic value.
like /tmp/${system.workflow.instance.id}

I think this is currently supported. Can you give an example?

Sorry, My bad, I try to use ${/tmp/${system.workflow.instance.id} before, It not work.

When i use /tmp/${system.workflow.instance.id}, it's work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants