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

Guard against nil tempfiles in MARC export job #914

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

jazairi
Copy link
Contributor

@jazairi jazairi commented Feb 22, 2022

Why these changes are being introduced:

If a tempfile has already been closed and unlinked, the ensure
block in MarcExportJob#perform will throw an error.

Relevant ticket(s):

How this addresses that need:

This checks if the tempfile exists before attempting to close it.

Side effects of this change:

Adds rubyzip to gemfile. Rubyzip is already used by other gems, and
it can be called in local development, but bootsnap seems to require
it to be loaded explicitly.

Developer

  • All new ENV is documented in README
  • All new ENV has been added to Heroku Pipeline, Staging and Prod
  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Requires database migrations?

NO

Includes new or updated dependencies?

YES (sort of -- we are explicitly adding rubygems to the gemfile, whereas it was previously installed by other dependencies)

@mitlib mitlib temporarily deployed to thesis-submit-pr-914 February 22, 2022 21:22 Inactive
@coveralls
Copy link

coveralls commented Feb 22, 2022

Coverage Status

Coverage increased (+0.002%) to 97.09% when pulling a0caeca on ETD-546-alma-oclc-export into ecc77d1 on main.

@jazairi jazairi force-pushed the ETD-546-alma-oclc-export branch from 1a0644e to 7e4b138 Compare February 22, 2022 21:26
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 22, 2022 21:27 Inactive
@jazairi jazairi requested a review from JPrevost February 22, 2022 21:28
@jazairi
Copy link
Contributor Author

jazairi commented Feb 22, 2022

@JPrevost Interestingly, this didn't come up in local testing. I'm planning to create some dummy theses in the PR build to confirm that this fixes the problem.

@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 14:57 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 14:58 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:09 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:10 Inactive
@jazairi jazairi removed the request for review from JPrevost February 23, 2022 15:17
@jazairi jazairi force-pushed the ETD-546-alma-oclc-export branch from 05aba70 to 338bdba Compare February 23, 2022 15:18
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:19 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:26 Inactive
@jazairi jazairi had a problem deploying to thesis-submit-pr-914 February 23, 2022 15:34 Failure
@jazairi jazairi force-pushed the ETD-546-alma-oclc-export branch from 6547f1a to 906506a Compare February 23, 2022 15:36
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:36 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:41 Inactive
@jazairi jazairi force-pushed the ETD-546-alma-oclc-export branch from f58d8ef to 347958d Compare February 23, 2022 15:48
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 15:49 Inactive
@jazairi jazairi requested a review from JPrevost February 23, 2022 15:49
@jazairi
Copy link
Contributor Author

jazairi commented Feb 23, 2022

@JPrevost Just confirmed that this is ready for review after much ado. If you'd like to test yourself, I created two fake-published theses that should export successfully using the MarcExportJob. I haven't yet run the full DspacePublicationResultsJob but I will probably do that before merging. (I ran into issues with the pipeline handles, which are fixed now.)

@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 16:10 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 16:15 Inactive
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 16:18 Inactive
Why these changes are being introduced:

If a tempfile has already been closed and unlinked, the `ensure`
block in MarcExportJob#perform will throw an error.

Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/ETD-546

How this addresses that need:

This checks if the tempfile exists before attempting to close it.

Side effects of this change:

Adds rubyzip to gemfile. Rubyzip is already used by other gems, and
it can be called in local development, but bootsnap seems to require
it to be loaded explicitly.
@jazairi jazairi force-pushed the ETD-546-alma-oclc-export branch from a2b21cc to a0caeca Compare February 23, 2022 16:20
@jazairi jazairi temporarily deployed to thesis-submit-pr-914 February 23, 2022 16:20 Inactive
@jazairi jazairi merged commit 85b0186 into main Feb 23, 2022
@jazairi jazairi deleted the ETD-546-alma-oclc-export branch February 23, 2022 18:13
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.

4 participants