Skip to content

Conversation

@ehanson8
Copy link
Contributor

Purpose and background context

After trying to create higher-level methods, it became clear that the SQS functionality copied from wiley-deposits needed to be refactored.

How can a reviewer manually see the effects of these changes?

Not possible yet

Includes new or updated dependencies?

NO

Changes expectations for external applications?

NO

What are the relevant tickets?

Developer

  • All new ENV is documented in README
  • All new ENV has been added to staging and production environments
  • All related Jira tickets are linked in commit message(s)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer(s)

  • The commit message is clear and follows our guidelines (not just this PR message)
  • There are appropriate tests covering any new functionality
  • The provided documentation is sufficient for understanding any new functionality introduced
  • Any manual tests have been performed or provided examples verified
  • New dependencies are appropriate or there were no changes

Copy link

@ghukill ghukill left a comment

Choose a reason for hiding this comment

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

Seems like a good time to tackle some of these renamings and type tweaks (e.g. when required vs optional). Looks good!

Why these changes are being introduced:
* The SQS functionality copied from wiley-deposits needs to be refactored to accommodate additional workflows.

How this addresses that need:
* Update ItemSubmission class to store item_identifier rather than metadata_s3_key as an attribute
* Update ItemSubmission.upload_dspace_metadata method signature to accept s3_prefix
* Add ItemSubmission.send_submission_message method and corresponding unit test
* Rename SQSClient.create_dss_message_attributes param package_id > identifier for clarity
* Update SQSClient.create_dss_message_body to handle multiple bitstreams
* Rename method to SQSClient.validate_result_message to clarify the type of SQS message being validated
* Update BaseWorkflow.s3_prefix type hinting
* Update BaseWorkflow.run method and corresponding unit test
* Refactor BaseWorkflow.item_submission_iter to account for the new ItemSubmission.item_identifier attribute
* Add s3 to metadata_uri and bitstream_uris attribute names across repo for clarity

Side effects of this change:
* None

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/IN-1128
* Add links to DSS message spec in docstrings
* Update tests after SimpleCSV PR merge
@ehanson8 ehanson8 force-pushed the IN-1101-sqs-refactor branch from 6c93bdd to 69a88f3 Compare January 3, 2025 18:03
@coveralls
Copy link

coveralls commented Jan 3, 2025

Pull Request Test Coverage Report for Build 12602471343

Details

  • 32 of 34 (94.12%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 96.226%

Changes Missing Coverage Covered Lines Changed/Added Lines %
dsc/item_submission.py 19 20 95.0%
dsc/workflows/base/init.py 6 7 85.71%
Totals Coverage Status
Change from base Build 12601110470: -0.4%
Covered Lines: 306
Relevant Lines: 318

💛 - Coveralls

Copy link
Contributor

@jonavellecuerdo jonavellecuerdo left a comment

Choose a reason for hiding this comment

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

Looking good! I have a few potential change requests.

* Rename identifier > item_identifier
* Rename s3_prefix > prefix
Copy link
Contributor

@jonavellecuerdo jonavellecuerdo left a comment

Choose a reason for hiding this comment

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

Nice! 🎉

@ehanson8 ehanson8 merged commit f664aaa into main Jan 3, 2025
2 checks passed
@ehanson8 ehanson8 deleted the IN-1101-sqs-refactor branch January 3, 2025 18:59
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.

5 participants