Skip to content

Improve publication logging#1503

Merged
jazairi merged 1 commit intomainfrom
better-logging
Mar 30, 2026
Merged

Improve publication logging#1503
jazairi merged 1 commit intomainfrom
better-logging

Conversation

@jazairi
Copy link
Copy Markdown
Contributor

@jazairi jazairi commented Mar 26, 2026

Why these changes are being introduced:

Our current logging doesn't capture much
information. (It usually just says 'N/A'.) While
DSpace errors are not useful, we should still
probably try to capture what's there.

Relevant ticket(s):

N/A

How this addresses that need:

That adds some Copilot-suggested changes to
enhance our logging in the DSpace publication
results job.

Side effects of this change:

None.

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?

NO

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 26, 2026

Coverage Status

coverage: 98.232% (-0.1%) from 98.35%
when pulling 2bb68d6 on better-logging
into 664187c on main.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enhances DSpace publication results logging by extracting more detail from DSS error payloads so errors are less frequently “N/A” and more actionable.

Changes:

  • Replace single-field DSS error logging with a formatted, multi-field error summary (ErrorInfo/DSpaceResponse/ExceptionMessage/ExceptionTraceback).
  • Add traceback formatting to keep stack traces readable (first few non-blank lines).
  • Extend the job test to assert that DSS error payload details appear in the returned results[:errors].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
app/jobs/dspace_publication_results_job.rb Adds format_dss_error + format_traceback and uses them when ResultType == 'error' to improve logged/error-report detail.
test/jobs/dspace_publication_results_job_test.rb Adds an assertion ensuring ErrorInfo details are surfaced in the collected errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jazairi jazairi temporarily deployed to thesis-submit-pr-1503 March 26, 2026 23:06 Inactive
'validate checksums as no local files were attached to the record. This ' \
'requires staff to manually check the ETD record and DSpace record and take ' \
'appropriate action.'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This entire test, not just the new assertions, is very confusing. It looks like we have stubbed an entire run and in this test are checking all the possible error states that the stubs have provided us.

If that's the case, since you didn't update any stubs are these new assertions testing things that were already there or are they testing the new formatting you put in place?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question! Previously, this stub would produce an empty/nil error message because we were only reading DSpaceResponse. So yes, the new assertions are testing new behavior, but it's really hard to discern that in the current test state.

Let me know if the change I just pushed helps clarify the intended test behavior.

@jazairi jazairi temporarily deployed to thesis-submit-pr-1503 March 27, 2026 15:20 Inactive
@JPrevost JPrevost self-assigned this Mar 27, 2026
Copy link
Copy Markdown
Member

@JPrevost JPrevost left a comment

Choose a reason for hiding this comment

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

That new test is much clearer, thanks!

Why these changes are being introduced:

Our current logging doesn't capture much
information. (It usually just says 'N/A'.) While
DSpace errors are not useful, we should still
probably try to capture what's there.

Relevant ticket(s):

N/A

How this addresses that need:

That adds some Copilot-suggested changes to
enhance our logging in the DSpace publication
results job.

Side effects of this change:

None.
@jazairi jazairi temporarily deployed to thesis-submit-pr-1503 March 30, 2026 15:10 Inactive
@jazairi jazairi merged commit f35b059 into main Mar 30, 2026
1 check passed
@jazairi jazairi deleted the better-logging branch March 30, 2026 15:17
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