Skip to content

Conversation

@Vlad0n20
Copy link
Contributor

@Vlad0n20 Vlad0n20 commented Nov 3, 2025

Purpose

Fix 502s when trying to make it public

Changes

Add exception for DOI creation

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-9651?atlOrigin=eyJpIjoiMGM1NGJkY2ZiOWQ0NGM1MjkwMjk2MDg0N2QyM2Q1OWEiLCJwIjoiaiJ9

Comment on lines 1237 to 1246
try:
if self.get_identifier_value('doi'):
update_doi_metadata_on_change(self._id)
elif self.is_registration:
doi = self.request_identifier('doi')['doi']
self.set_identifier_value('doi', doi)
except Exception:
logger.exception(
f'Failed to create/update DOI for {self._id} during set_privacy. '
)
Copy link
Contributor

@Ostap-Zherebetskyi Ostap-Zherebetskyi Nov 3, 2025

Choose a reason for hiding this comment

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

Should we allow the DOI creation process to be skipped?

I recommend at least a pop-up with additional confirmation from the admins before skipping the DOI creation.
@brianjgeiger @adlius

Copy link
Collaborator

Choose a reason for hiding this comment

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

I expect Product would rather have the doi creation succeed. It would at least be good to know what went wrong during doi creation to cause it to fail, so if we need to do anything else here to get the appropriate information to sentry, we should do that.

Plus, this try block looks not correct. This exception catch should happen around L1242 rather than the whole block. There should be a different try block around L1239 that indicates that we weren't able to update metadata for the guid.

Copy link
Contributor

@Ostap-Zherebetskyi Ostap-Zherebetskyi left a comment

Choose a reason for hiding this comment

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

The code looks good, but we need to verify whether we want to allow the DOI creation process to be skipped.

Copy link
Contributor

@Ostap-Zherebetskyi Ostap-Zherebetskyi left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants