-
Notifications
You must be signed in to change notification settings - Fork 12
Avoid Autosubmit's bash script interpreting task's script and provoking all variables to be unbounded #2694
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
base: master
Are you sure you want to change the base?
Avoid Autosubmit's bash script interpreting task's script and provoking all variables to be unbounded #2694
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2694 +/- ##
==========================================
- Coverage 67.69% 67.51% -0.19%
==========================================
Files 86 86
Lines 19786 19786
Branches 3840 3840
==========================================
- Hits 13395 13358 -37
- Misses 5458 5501 +43
+ Partials 933 927 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hello @manuel-g-castro I had the same bug, but I didn't notice it was applying to more stuff that the checkpoint function. These are the changes I have on 4.2.0 |
|
Hi, @dbeltrankyl ! Thank you for the comment. In my opinion, your changes are better than the ones that I made. I actually do not agree with launching the task's bash using What you have in your branch is like what we used to have in AS3 and AS4.15. If an error would happen, the So I wonder why did you, @kinow and @VindeeR , decided to change to this redirection of the script to stdin. I am happy to close this PR and just open an issue to move the discussion. Also, as I said, I think that a test needs to be created to account this unbound variable error. |
|
Hello @manuel-g-castro
I did not review that to be honest so I don't have a strong opinion. We can change to whatever is best I wouldn't close this PR as we need to cherry-pick the fix done on v4.2 for v4.1.16 release and add the test then! |
+1
Exactly my thoughts too. If it's not broken in CICD, we first need to make sure it's broken with a test, and then add the fix so it doesn't happen again.
That's completely on me. I couldn't find another way without displacing the error lines a bit. Now, unfortunately, users must look at the lines in the final script, not in their original scripts. We can try to match the previous behaviour, but I couldn't find a way to make everything work that way and also have the _STAT updated correctly. But I was also changing other parts that were necessary to have the code updated. Maybe focusing just on this part, of the stdin redirect could be simpler. So let's leave this open and try to fix for 4.1.16 👍 Thanks Manuel! |
|
Hi, @kinow ! Thanks for the comment.
I do not think this was ever the case. For me, at least, every time that I need to debug a script of mine, I need to check the I think I am not being clear on my point of view. So let me explain an example. This is my script, and because of the If i execute the workflow with this script, i get the following error on the .err: which correctly indicates the faulty line at the 45ft line of the .cmd. Below you have the snipped of the script (with numbering). Now, if I do the same with the changes in master ( Here is the snipped of the final .cmd script (with line numbers). |
I've just added the 4.2 changes but didn't add any test There are some tests changes in #2700 if that is merged we can modify some of the integration run tests to include some variables and:
|
|
Thanks @dbeltrankyl , @manuel-g-castro ! I can review these changes and add more tests if needed. Thanks a lot!!! 🙇 |
…ng parameter substitution. This fixes bug introduced by commit 761c20, "[Enhancemente] Delete wrapper code (#2550)"
afcf6f7 to
2f086ff
Compare
Hi, @kinow @dbeltrankyl @VindeeR
This merge request solves a critical issue that breaks every single workflow we have.
The problem is that now the task's bash script is passed as a heredoc, but it is not guarded by quotes. therefore the bash script executing the Autosubmit code (header, tailer, etc) makes the parameter and variable substitution.
As far as I could tell, this bug was introduced by
autosubmit/autosubmit/job/template/bash.py
Lines 95 to 98 in 761c208
I am marking this PR as draft because I would like for someone (@VindeeR ?) to write a test to check if the variables are being substituted correctly, so that the CI/CD is able to detect similar errors.
Check List
CONTRIBUTING.md.pyproject.toml.CHANGELOG.mdif this is a change that can affect users.Closes #1234).