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

Don't raise exception for successful verdi archive import -n #6401

Closed
GeigerJ2 opened this issue May 17, 2024 · 2 comments · Fixed by #6403
Closed

Don't raise exception for successful verdi archive import -n #6401

GeigerJ2 opened this issue May 17, 2024 · 2 comments · Fixed by #6403

Comments

@GeigerJ2
Copy link
Contributor

When doing a dry-run of an archive import, the import_archive function raises the ImportTestRun('test run complete') exception, resulting in a user-facing Critical: output. Is there any particular reason for this behavior, rather than just a Report: that the dry-run is done?

Relevant code here:

try:
_import_archive(archive_path, archive_format=archive_format, **import_kwargs)
except Exception as sub_exception:
_echo_exception(
f'an exception occurred while trying to import the migrated archive {archive}', sub_exception
)
else:
_echo_exception(f'an exception occurred while trying to import the archive {archive}', exception)
except Exception as exception:
_echo_exception(f'an exception occurred while trying to import the archive {archive}', exception)

if test_run:
# exit before we write anything to the database or repository
raise ImportTestRun('test run complete')

@sphuber
Copy link
Contributor

sphuber commented May 17, 2024

s there any particular reason for this behavior, rather than just a Report: that the dry-run is done?

Don't think so. Likely just an oversight. We should really just be catching the ImportTestRun exception separately and issues an echo_success message

@GeigerJ2
Copy link
Contributor Author

Alright, cool! Should be done by #6403.

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 a pull request may close this issue.

2 participants