nils-braun / b2luigi

Task scheduling and batch running for basf2 jobs made simple
GNU General Public License v3.0
17 stars 11 forks source link

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

Closed eckerpatrick closed 1 year ago

eckerpatrick commented 1 year ago

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.

eckerpatrick commented 1 year ago

this fixes https://github.com/nils-braun/b2luigi/issues/208

codecov-commenter commented 1 year ago

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.

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/nils-braun/b2luigi/pull/209/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/nils-braun/b2luigi/pull/209/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun) | `60.87% <54.54%> (+0.36%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/nils-braun/b2luigi/pull/209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun) | Coverage Δ | | |---|---|---| | [b2luigi/\_\_init\_\_.py](https://app.codecov.io/gh/nils-braun/b2luigi/pull/209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun#diff-YjJsdWlnaS9fX2luaXRfXy5weQ==) | `88.46% <100.00%> (ø)` | | | [b2luigi/batch/processes/gbasf2.py](https://app.codecov.io/gh/nils-braun/b2luigi/pull/209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun#diff-YjJsdWlnaS9iYXRjaC9wcm9jZXNzZXMvZ2Jhc2YyLnB5) | `49.78% <50.00%> (+0.52%)` | :arrow_up: | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/nils-braun/b2luigi/pull/209/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nils+Braun)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

meliache commented 1 year ago

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

If you don't mind I'll also add commit 4418938e2b7def3f1f392147ff884c8bdea946c0 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.

eckerpatrick commented 1 year ago

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

meliache commented 1 year ago

@eckerpatrick Oh you're quick, I just added a Changelog entry in addition to 4418938e2b7def3f1f392147ff884c8bdea946c0. 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.)