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

Added log to verify that method is getting called at right condition #1081

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

ashwinisukale
Copy link
Contributor

Purpose

Added logs to investigate the issue.

closes: datacite/datacite#1710

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.

@ashwinisukale ashwinisukale requested a review from a team January 8, 2024 07:19
Copy link
Contributor

@kaysiz kaysiz left a comment

Choose a reason for hiding this comment

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

@ashwinisukale Looks good. Is there not a way to simulate this locally without logging in prod?

send_import_message(to_jsonapi) if relevant_changes.any?
if relevant_changes.any?
send_import_message(to_jsonapi)
Rails.logger.info "[Event Data Import Message] #{aasm_state} #{to_jsonapi.inspect} send to Event Data service."
Copy link
Contributor

Choose a reason for hiding this comment

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

This will potentially create a lot of log entries in production for every update that is triggering a import.
You could also get this on the other side during the actual import, i.e. levriero.
I think this is fine if you really need this information to debug in production, but if you can check how many logs are being added that'd be good, and if it's a lot (discuss on slack) then we might want to remove it at some point. Log collection does have an associated cost as well as being extra data to parse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes @richardhallett I will not be pushing this to production. I just want to test this on staging. I will be removing this log once testing is done. Sorry I did not mentioned this in the description

@ashwinisukale
Copy link
Contributor Author

@kaysiz locally its not possible to test this integration testing at local where lupo is putting a message on a queue and levriero is reading that message off the queue

@ashwinisukale ashwinisukale merged commit 5296107 into master Jan 8, 2024
13 checks passed
@ashwinisukale ashwinisukale deleted the add_log_to_event_data branch January 8, 2024 09:49
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.

Events not created when DOI first created in registered or draft state
4 participants