Skip to content

Conversation

opaduchak
Copy link
Contributor

Purpose

Change guid resolve strategy to match expectations of osf users

Changes

  • changed on_submit hook to link parent guid to latest version regardles of moderation workflow
  • implemented migration job via management command

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

@opaduchak opaduchak changed the base branch from develop to feature/pbs-25-19 September 18, 2025 11:13
Copy link
Collaborator

@cslzchen cslzchen 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 questions/thoughts:

  • The side effect of this change is the no version URL will lead to page not found if a pending pre-moderation preprints exists

  • Does the migration handle the case where a new version is "created but not submitted"? This orphaned preprint has the highest number but should not be considered as the latest.

Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

The update looks good but rejected version occurred to me when I looked at the unit test. Probably need to follow up with product on what's the behavior they want.

Comment on lines 54 to 55
if version.referent.machine_state == ReviewStates.INITIAL.value:
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curious if we should add this to skipped count or let it have its own count?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not skip this, and keeping separate count is impossible as this count is liked to each preprint.
Here we just iterate through preprint versions and search fro most recent submitted version

Comment on lines +2587 to +2588
assert guid_obj.object_id == new_version.pk
assert guid_obj.referent == new_version
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is another case that I forgot to ask during my first review. And this is probably a product question too.

  • Can you verify that rejected preprints will keep the version number? (Rejection only happens for pre-mod).
  • Does product really want the behavior that non-version guid leads to rejected preprints? Or should we change the version to point back to an earlier "latest version" upon rejection?

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