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

[ENG-6673] Check and fix api3_and_osf tests, excluding ElasticSearch and SHARE related failures #10844

Conversation

Vlad0n20
Copy link

@Vlad0n20 Vlad0n20 commented Dec 11, 2024

Purpose

Check and fix api3_and_osf tests, excluding ElasticSearch and SHARE related failures

Changes

Check and fix api3_and_osf tests, excluding ElasticSearch and SHARE related failures

QA Notes

N/A

Documentation

N/A

Side Effects

N/A

Ticket

https://openscience.atlassian.net/browse/ENG-6673

@cslzchen cslzchen changed the title [ENG-6673]Fix api_3 test, without elasticsearch and share related [ENG-6673] Check and fix api3_and_osf tests, excluding ElasticSearch and SHARE related failures Dec 12, 2024
osf/management/commands/check_crossref_dois.py Outdated Show resolved Hide resolved
osf/management/commands/check_crossref_dois.py Outdated Show resolved Hide resolved
api_tests/collections/test_views.py Outdated Show resolved Hide resolved
api_tests/collections/test_views.py Outdated Show resolved Hide resolved
@Vlad0n20 Vlad0n20 force-pushed the fix/ENG-6673-api-3-test branch from 41fe000 to ef6a82e Compare December 17, 2024 14:46
Comment on lines -85 to +89
pending_preprint = preprints_with_pending_dois.get(guids___id=guid)
base_guid, version = guid.split(VersionedGuidMixin.GUID_VERSION_DELIMITER)
pending_preprint = preprints_with_pending_dois.get(
versioned_guids__guid___id=base_guid,
versioned_guids__version=version,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Future: let's use .load_referent()

Comment on lines -3897 to +3904
return list(
collection.guid_links.values_list(
'_id', flat=True)
)
res = []
for guid in collection.guid_links.all():
if guid.is_versioned:
for through_item in guid.versions.all():
res.append(f'{guid._id}{VersionedGuidMixin.GUID_VERSION_DELIMITER}{through_item.version}')
else:
res.append(guid._id)
return res
Copy link
Collaborator

Choose a reason for hiding this comment

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

The fix looks good!

TODO for myself: check with Product & QA on collections

@cslzchen cslzchen merged commit 4b8894e into CenterForOpenScience:feature/preprints-doi-versioning Dec 17, 2024
3 of 6 checks passed
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