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

Improve logging successful and failed acquire runs #177

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

pyrco
Copy link
Contributor

@pyrco pyrco commented Jul 2, 2024

No description provided.

@pyrco pyrco requested a review from cecinestpasunepipe July 2, 2024 11:59
@pyrco pyrco linked an issue Jul 2, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 9.52381% with 95 lines in your changes missing coverage. Please review.

Project coverage is 43.64%. Comparing base (f5b50b6) to head (54cccbb).

Files Patch % Lines
acquire/acquire.py 6.00% 94 Missing ⚠️
acquire/utils.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
- Coverage   44.36%   43.64%   -0.72%     
==========================================
  Files          26       26              
  Lines        3316     3345      +29     
==========================================
- Hits         1471     1460      -11     
- Misses       1845     1885      +40     
Flag Coverage Δ
unittests 43.64% <9.52%> (-0.72%) ⬇️

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

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

log.error("Exiting with status code 1 (FAILURE)")
sys.exit(1)


def main() -> None:
parser = create_argument_parser(PROFILES, VOLATILE, MODULES)
args, rest = parse_acquire_args(parser, config=CONFIG)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the GUI still work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it still works :)

acquire/acquire.py Outdated Show resolved Hide resolved
@@ -291,8 +295,7 @@ def check_and_set_acquire_args(

# If initialization of the plugin fails, a ValueError is raised
upload_plugin = upload_plugin_cls(**args.config)

setattr(args, "upload_plugin", upload_plugin)
setattr(args, "upload_plugin", upload_plugin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this set two times?

Copy link
Contributor Author

@pyrco pyrco Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be set (and set to a default value), as the auto upload code checks on this parameter. The auto upload code is run in a separate try ... except from the check around setting parameters and acquiring, so it can't be sure is has been set (or set to a proper upload plugin) as that may be the thing that failed.

log.error("Upload %s FAILED. See log file for details.", paths)
GUI().message("Upload failed.")
log.exception("")
log.error('Upload FAILED for files: "%s". See log file for details.', " ".join(map(str, paths)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the GUI message removed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is already displayed in main() I didn't want to add extra GUI dependencies in these functions.

acquire/acquire.py Show resolved Hide resolved
@pyrco pyrco force-pushed the feature/improve-succes-and-failure-logging branch from 0337473 to 54cccbb Compare July 4, 2024 07:42
@pyrco pyrco requested a review from cecinestpasunepipe July 4, 2024 07:42
@pyrco pyrco merged commit 8741da3 into main Jul 5, 2024
15 of 18 checks passed
@pyrco pyrco deleted the feature/improve-succes-and-failure-logging branch July 5, 2024 09:54
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.

Acquire output does not contain a clear ending message
2 participants