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

chore(form): Keep defaults from user #634

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

lordrip
Copy link
Member

@lordrip lordrip commented Jan 14, 2024

Context

Currently, we're removing parameters set by the user that match the default value intending to have less verbose routes.

There's an issue with the file component, detailed as follows:

from: file:someFile.txt
parameters:
  noop: true

In the previous route, noop=true implicitly set idempotent=true IF THE VALUE HAS NOT BEEN SET TO EITHER TRUE OR FALSE, usually this is OK and doesn't represent a problem.

In case the user wants to set noop=true and idempotent=false to force the file component to re-read the files when the scheduler kicks in, like the following:

from: file:someFile.txt
parameters:
  noop: true
  idempotent: false

Then we will remove the idempotent=false as it is the default value for the idempotent parameter, effectively blocking the user from setting a different behavior for the file component.

Changes

This commit aims to keep values set by the user, even in case they are the default ones.

Notes

We're not removing the functionality, instead, we're deactivating it while keeping the functions in separate files since they might be leveraged in the future in another fashion.

fixes: #633

@lordrip lordrip requested review from lhein and shivamG640 January 14, 2024 11:06
…efault value intending to have less verbose routes.

There's an issue with the `file` component, detailed as follows:
```
from: file:someFile.txt
parameters:
  noop: true
```

In the previous route, `noop=true` implicitly set `idempotent=true` **IF THE VALUE HAS NOT BEEN SET TO EITHER TRUE OR FALSE**, usually this is OK and doesn't represent a problem.

In case the user wants to set `noop=true` and `idempotent=false` to force the `file` component to re-read the files when the scheduler kicks in, like the following:

```
from: file:someFile.txt
parameters:
  noop: true
  idempotent: false
```

Then we will remove the `idempotent=false` as it is the default value for the `idempotent` parameter, effectively blocking the user from setting a different behavior for the `file` component.

This commit aims to keep values set by the user, even in case they are the default ones.

fixes: KaotoIO#633
@lordrip lordrip force-pushed the chore/keep-default-values branch from 48d5c70 to 66ef2cf Compare January 15, 2024 20:52
@lordrip lordrip merged commit 7e6f90a into KaotoIO:main Jan 16, 2024
10 checks passed
@lordrip lordrip deleted the chore/keep-default-values branch January 16, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve user parameters even when matching the default value
2 participants