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

Feat: Adding limit field to template and Taks, overriding the CLI args from task. #2420

Closed
wants to merge 14 commits into from

Conversation

Gnyblast
Copy link

@Gnyblast Gnyblast commented Oct 14, 2024

Fix for #1357 and making override of the CLI args from task run dialog:

  • Added limits fields to the template form and runs task dialog
  • Created DB fields for this new field to be stored
  • Changed Models to support parsing from database or api json
  • Overriding implemented for the limit from task to template to enable pre-run changes to take effect
  • Added language element for "limit"
  • Fixed a JS error that was getting thrown due to item elements was being tried to set while item was undefined
  • Made run dialog to display the args defined on template to make it obvious for the end-user to see what's going to be ran
  • Made it also override the args by the task to template, so that if you change the args on pre-run it's really a override.

Guney Saramali and others added 6 commits October 10, 2024 16:31
- Added limits fields to the template form and runs task dialog
- Created DB fields for this new field to be stored
- Changed Models to support parsing from database or api json
- Overriding implemented of the limit from task to template to enable pre-run changes to take effect
- Added language element for "limit"
- Fixed a JS error that was getting thrown due to item elements was being tried to set while item was undefined
- Made run dialog to display the args defined on template to make it obvious for the end-user to see what's going to be ran
- Made it also override the args by the task to template, so that if you change the args on pre-run it's really a override.
services/tasks/LocalJob.go Outdated Show resolved Hide resolved
Guney Saramali added 3 commits October 24, 2024 15:08
- I previously made it to run by overriding template CLI args no matter what
- This might cause the problem because there might be run with task dialog with integration which means it will override all template args to null
- I implemented a helper function to detect if task args are exists and they are actually overridig the template cli args
- Then I just replace template CLI with task override and just use template args there.
@Gnyblast
Copy link
Author

Not sure why codacy fails though...

@Gnyblast Gnyblast requested a review from fiftin October 25, 2024 08:18
@fiftin
Copy link
Collaborator

fiftin commented Oct 27, 2024

Thank you! Reviewing

@Gnyblast
Copy link
Author

Thanks waiting for the response, we are kind of waiting this for migration.

web/package.json Outdated Show resolved Hide resolved
services/tasks/LocalJob_test.go Show resolved Hide resolved
Guney Saramali added 3 commits October 30, 2024 09:55
When you override template args in new task dialog the isCLIArgsOverridden manages that well, but when you remove a CLI arg in new task dialog since it doesn't exist anymore the iteration doesn't know it and it falls back to template which it does exist there and then gets implemented, to solve this:
- I added a new non-database field to front-end and backend called RemovedArguments
- In the front-end I made a new data binding and when an template declarated argument gets deleted on task dialog it populates it to removed_arguments object
- Then when this get sent to the back-end, then back-end first removes and RemovedArguments from templateExtraArgs, so this prevents falling back to template args and finding it again there
- Then it does the rest same as before to compare and override if there are existing arguments both in template and task with same key but different values.

- Also ArgsPicker was problematic on populating CLI args on task dialog especially for re-runs because it wasn't getting populated correctly when you were trying for few times, and also it wasn't population a "rerun" with whatever arguments was selected there before, so it would make it an actual re-run.
- I also fixed a bug for re-run button on TaskList, word `Re` was getting declared twice as hardcoded prefixed to the word `run`.

- Fixed the api-docs and ran the tests.
@Gnyblast Gnyblast requested a review from fiftin November 1, 2024 13:33
@fiftin
Copy link
Collaborator

fiftin commented Nov 6, 2024

Hi @Gnyblast I reviewing.

db/Task.go Show resolved Hide resolved
@Gnyblast Gnyblast closed this Nov 12, 2024
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.

2 participants