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

Fixes to PREMIS event recording #31

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Fixes to PREMIS event recording #31

merged 1 commit into from
Jul 10, 2024

Conversation

mcantelon
Copy link
Contributor

@mcantelon mcantelon commented Jul 5, 2024

  • Removed redundant PREMIS event for validate file formats
  • Correct use of improper PREMIS event types
  • Allow PREMIS evebt details and PREMIS event outcome detail to be specified rather than generated
  • Add PREMIS event outcome detail specification to PREMIS events in workflow and validate file formats activity
  • Generate error when attempting to add a PREMIS event to a non-existent PREMIS object
  • Fixed issue with validate formats activity
  • Removed unneeded code in tests for add PREMIS event activity

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 86.11111% with 5 lines in your changes missing coverage. Please review.

Project coverage is 66.59%. Comparing base (84e8e73) to head (3d4b526).

Files Patch % Lines
internal/premis/premis.go 81.25% 2 Missing and 1 partial ⚠️
internal/activities/validate_file_formats.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
- Coverage   66.77%   66.59%   -0.18%     
==========================================
  Files          19       19              
  Lines         936      940       +4     
==========================================
+ Hits          625      626       +1     
- Misses        261      263       +2     
- Partials       50       51       +1     

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

@mcantelon mcantelon marked this pull request as draft July 5, 2024 13:46
@mcantelon mcantelon changed the title Dev/premis event fixes Fixes to PREMIS event recording Jul 5, 2024
@mcantelon mcantelon marked this pull request as ready for review July 5, 2024 15:10
Copy link
Contributor

@jraddaoui jraddaoui left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -128,30 +129,23 @@ func eventFromEventSummaryAndAgent(eventSummary EventSummary, agent Agent) Event
}
}

func NewEventSummary(eventType string, failures []string) (EventSummary, error) {
detail, outcome := assembleEventDetailAndOutcome(failures)
func NewEventSummary(eventType string, detail string, outcomeDetail string, failures []string) (EventSummary, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to pass the slice of failures, could we use a boolean or pass the outcome directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call... that'd make it more straightforward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Fixed.)

@mcantelon
Copy link
Contributor Author

Thanks @jraddaoui !

@mcantelon mcantelon force-pushed the dev/premis-event-fixes branch from 235a63a to 0efe5bc Compare July 10, 2024 00:31
* Removed redundant PREMIS event for validate file formats
* Correct use of improper PREMIS event types
* Allowed PREMIS evebt details and PREMIS event outcome detail to be
  specified rather than generated
* Add PREMIS event outcome detail specification to PREMIS events in
  workflow and validate file formats activity
* Generate error when attempting to add a PREMIS event to a
  non-existent PREMIS object
* Fixed issue with validate formats activity
* Removed unneeded code in tests of add PREMIS event activity
@mcantelon mcantelon force-pushed the dev/premis-event-fixes branch from 0efe5bc to 3d4b526 Compare July 10, 2024 00:36
@mcantelon mcantelon merged commit b736af4 into main Jul 10, 2024
9 checks passed
@mcantelon mcantelon deleted the dev/premis-event-fixes branch July 10, 2024 16: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.

2 participants