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 for activities endpoints. #1063

Merged
merged 10 commits into from
Dec 12, 2023
Merged

Fixes for activities endpoints. #1063

merged 10 commits into from
Dec 12, 2023

Conversation

svogt0511
Copy link
Contributor

@svogt0511 svogt0511 commented Dec 11, 2023

Purpose

Should fix a several problems.

  1. The first is the NoMethodError: undefined method `name' for nil:NilClass #1054, where trying to retrieve activities for a DOI would cause a 'NoMethodError: undefined method 'name' for nil:NilClass' error when trying to display activities using /dois/:id/activities endpoint older DOIs in production. This was a problem in the serializer.
  2. Added a fix for Unable to retrieve single Activity records via the REST API #1060 where the /activities/:uid endpoint would always return not found. Turns out it was not implemented.
  3. This is the same as item 1, described, above: activities endpoints may return a 400 error #1062
  4. Minor fix for the dev environment setup so activities can successfully be tested manually: Fix for dev environment ES index setup for activities #1065
  5. Also found it necessary in the activities serializer to guard to guard against audited changes that show an initial value of null for publisher or publisher_obj. This happens when these fields are first assigned a value. An example be found in the audit date for https://api.datacite.org/activities/7b333de3-77af-4200-8ffd-c8b2012a8d9e:
image

closes: #1054, #1060, #1062, #1065

Approach

Open Questions and Pre-Merge TODOs

Learning

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

Copy link
Member

@digitaldogsbody digitaldogsbody left a comment

Choose a reason for hiding this comment

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

A few minor things but non-blocking

app/controllers/activities_controller.rb Outdated Show resolved Hide resolved
config/routes.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@ashwinisukale ashwinisukale left a comment

Choose a reason for hiding this comment

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

Changes look good, just suggested some refactoring changes

app/controllers/activities_controller.rb Outdated Show resolved Hide resolved
app/serializers/activity_serializer.rb Show resolved Hide resolved
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.

NoMethodError: undefined method `name' for nil:NilClass
3 participants