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

Fix do finalise #810

Merged
merged 9 commits into from
Jul 17, 2024
Merged

Fix do finalise #810

merged 9 commits into from
Jul 17, 2024

Conversation

ItIsJordan
Copy link
Collaborator

Closes #761 by making a number of improvements:

  • Increase defensive programming in the do_finalise function
  • Modify code to now tolerate the case where multiple commit message objects are inserted, and ensure records containing such a case have the most recent entry retrieved only.
  • Add tests to cover duplicate commit message entries.

Updates get_commit_message in records/api.py to instances of multiple commit message returns. (now orders based on ID, and returns the first only)
Adds a test for get_commit_message to test against existence of multiple and no commit messages.
Adds validation of return message contents of get_commit_message
Improves helper function create_test_record to allow custom overall_status setting
Adds a rollback condition when exception raised in do_finalise, now returns error in some exceptions during record commit. Also adds some testing for rollback condition.
Fix path in test_do_finalise_commit_message to use absolute path, which I hope works on the actions.
@coveralls
Copy link

Coverage Status

coverage: 83.423% (+0.1%) from 83.309%
when pulling a57210d on fix_do_finalise
into 32b9fb7 on main.

@GraemeWatt GraemeWatt merged commit 0c1b7de into main Jul 17, 2024
9 checks passed
@GraemeWatt GraemeWatt deleted the fix_do_finalise branch July 17, 2024 15:01
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.

records: make do_finalise more robust and tolerate multiple commit messages
3 participants