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

[feature] tokens inside command/scripts shall be considered implicit inputs to command by default #1567

Open
artsiommiksiuk opened this issue Jul 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@artsiommiksiuk
Copy link

artsiommiksiuk commented Jul 18, 2024

Is your feature request related to a problem? Please describe.

I have the following task definition:

tasks:
  lint-src:
    script: npx redocly lint --config @files(srcConfig) @files(all)
    inputs:
      - "@files(srcConfig)"
      - "@files(all)"
    options:
      internal: true

As it can be seen, i need to type twice tokens and files groups. Instead, I think it should be a fair assumption, that if some token is mentioned in script or command this token brings it's dependency to the task (as inputs).

Describe the solution you'd like

So, instead of typeing tokens inside command and then repeating it in inputs, I'd like to do it only once in command, and use inputs to specify any implicit dependency which is not directly passed into command.

Like this:

tasks:
  lint-src:
    script: npx redocly lint --config @files(srcConfig) @files(all)
    options:
      internal: true

inputs now has @files(srcConfig) and @files(all) implicitly

Describe alternatives you've considered

If not make this behaviour default one - to have an option to infer tokens from command line and add them to input.
Like:

options:
   inferInputs: true
@artsiommiksiuk artsiommiksiuk added the enhancement New feature or request label Jul 18, 2024
@milesj
Copy link
Collaborator

milesj commented Jul 21, 2024

This is a neat idea. I'll look into how viable it is currently.

@artsiommiksiuk
Copy link
Author

BTW, following this topic #1569 not only tokens but env vars also shall be considered implicit inputs if mentioned in script or command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants