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

Fix the jobs status script so it works with the new gbasf2 version #209

Merged
merged 3 commits into from
Nov 5, 2023

Conversation

eckerpatrick
Copy link
Contributor

@eckerpatrick eckerpatrick commented Nov 3, 2023

There were some changes in the recent gbasf2 update which caused failures in the job status script, as the CS is not anymore automatically initialized by the userCreds decorator.

@github-actions github-actions bot added the needs changelog Entry to CHANGELOG.md is missing label Nov 3, 2023
@eckerpatrick
Copy link
Contributor Author

this fixes #208

@codecov-commenter
Copy link

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (5815d46) 60.51% compared to head (fa7f42c) 60.87%.
Report is 15 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
+ Coverage   60.51%   60.87%   +0.36%     
==========================================
  Files          23       23              
  Lines        1593     1595       +2     
==========================================
+ Hits          964      971       +7     
+ Misses        629      624       -5     
Flag Coverage Δ
unittests 60.87% <54.54%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
b2luigi/__init__.py 88.46% <100.00%> (ø)
b2luigi/batch/processes/gbasf2.py 49.78% <50.00%> (+0.52%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@meliache
Copy link
Collaborator

meliache commented Nov 3, 2023

Thanks, that looks great 👍 ! @0ctagon had figured out the changed import paths but was missing initializeCS().

If you don't mind I'll also add commit 4418938 for better catching unexpected errors of gbasf2_job_status.py. In the b2luigi in the subprocess call of gbasf2_job_status.py we only checked for a job status of 3, which happens when result["OK"] is False. However, any other unexpected crash of that script resulted in a non-zero exit code which b2luigi ignored and just continued with a garbage string. Therefore, we should also raise error messages for other non-zero exit codes. Not sure if that would have resulted in a better/earlier error message in this particular case though.

What's finally missing is a Changelog entry.

Previously we only raised an exception for returncodes of 3 and otherwise
accepted the output. Any other returncodes should in theory not be possible but
better be defensive and fail early with a proper error message instead of
accepting garbage output and failing later with a confusing error message.
@eckerpatrick
Copy link
Contributor Author

@meliache sounds good to catch also other failures!
Will you also add the changelog in this context or should I add it?

@github-actions github-actions bot removed the needs changelog Entry to CHANGELOG.md is missing label Nov 3, 2023
@meliache
Copy link
Collaborator

meliache commented Nov 3, 2023

@eckerpatrick Oh you're quick, I just added a Changelog entry in addition to 4418938. Can you just make a quick check that my changes didn't brick anything? They are minor and shouldn't brake anything, but I have no way to run gbasf2 to check anymore and who knows what I might have overlooked.

(These days I started sometimes merging minor hotfixes/improvements without proper code review using my admin authority and because it'd difficult to find reviewers/testers these day. But people get active here when something is broken so I'm happy to exploit that.)

@meliache meliache self-requested a review November 3, 2023 13:21
@meliache meliache added bug Something isn't working gbasf2 Concerns the gbasf2/grid b2luigi wrapper labels Nov 3, 2023
@meliache meliache merged commit 9516d03 into nils-braun:main Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gbasf2 Concerns the gbasf2/grid b2luigi wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants