Skip to content

Commit 2dee1b2

Browse files
committed
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf.io into refactor-notifications
* 'develop' of https://github.com/CenterForOpenScience/osf.io: Update chagnelog and bump version [ENG-6835] VRL Project PR - BE (#11204) # Conflicts: # api_tests/registrations/views/test_registration_detail.py # conftest.py # tests/test_registrations/test_retractions.py
2 parents 9a10a63 + 831b9ec commit 2dee1b2

File tree

70 files changed

+1520
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1520
-108
lines changed

.docker-compose.gv.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ POSTGRES_DB="gravyvalet"
99
SECRET_KEY="secret"
1010
PYTHONUNBUFFERED=1 # This when set to 0 will allow print statements to be visible in the Docker logs
1111
OSF_AUTH_COOKIE_NAME=osf
12+
SESSION_COOKIE_SECURE=false
13+
SESSION_COOKIE_HTTPONLY=true
14+
SESSION_COOKIE_SAMESITE=Lax
1215
OSF_SENSITIVE_DATA_SECRET="TrainglesAre5Squares"
1316
OSF_SENSITIVE_DATA_SALT="yusaltydough"
1417
DEBUG=1
15-
16-

.github/actions/gen-report/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ description: 'Generate test report from junit xml file'
33
runs:
44
using: "composite"
55
steps:
6+
- name: Archive code coverage results
7+
uses: actions/upload-artifact@v4
8+
with:
9+
name: ${{github.job}} HTML REPORT
10+
path: report.html
611
- name: Generate Report
7-
uses: dorny/test-reporter@v1
12+
uses: dorny/test-reporter@v2
813
if: success() || failure() # run this step even if previous step failed
914
with:
1015
name: ${{github.job}} REPORT # Name of the check run which will be created

.github/workflows/test-build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/cache@v4
2323
with:
2424
path: ~/.cache
25-
key: reqs_${{ hashFiles('**/pyproject.toml') }}
25+
key: reqs_${{ hashFiles('poetry.lock') }}
2626
restore-keys: reqs
2727
- run: |
2828
mkdir -p ~/.cache/downloads
@@ -31,7 +31,7 @@ jobs:
3131
mkdir -p ~/.cache/testmon
3232
rm -rf node_modules ## TODO remove this later
3333
34-
addons:
34+
addons_and_admin:
3535
runs-on: ubuntu-22.04
3636
needs: build-cache
3737
permissions:
@@ -53,9 +53,9 @@ jobs:
5353
- uses: actions/checkout@v2
5454
- uses: ./.github/actions/start-build
5555
- name: Run tests
56-
run: poetry run python3 -m invoke test-ci-addons -n 1 --junit
56+
run: poetry run python3 -m invoke test-ci-addons --junit
5757
- name: Upload report
58-
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
58+
if: (success() || failure()) # run this step even if previous step failed
5959
uses: ./.github/actions/gen-report
6060

6161
website:
@@ -80,9 +80,9 @@ jobs:
8080
- uses: actions/checkout@v2
8181
- uses: ./.github/actions/start-build
8282
- name: Run tests
83-
run: poetry run python3 -m invoke test-ci-website -n 1 --junit
83+
run: poetry run python3 -m invoke test-ci-website --junit
8484
- name: Upload report
85-
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
85+
if: (success() || failure()) # run this step even if previous step failed
8686
uses: ./.github/actions/gen-report
8787

8888
api1_and_js:
@@ -109,9 +109,9 @@ jobs:
109109
- name: NVM & yarn install
110110
run: poetry run python3 -m invoke assets --dev
111111
- name: Run test
112-
run: poetry run python3 -m invoke test-ci-api1-and-js -n 1 --junit
112+
run: poetry run python3 -m invoke test-ci-api1-and-js --junit
113113
- name: Upload report
114-
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
114+
if: (success() || failure()) # run this step even if previous step failed
115115
uses: ./.github/actions/gen-report
116116

117117
api2:
@@ -136,9 +136,9 @@ jobs:
136136
- uses: actions/checkout@v2
137137
- uses: ./.github/actions/start-build
138138
- name: Run tests
139-
run: poetry run python3 -m invoke test-ci-api2 -n 1 --junit
139+
run: poetry run python3 -m invoke test-ci-api2 --junit
140140
- name: Upload report
141-
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
141+
if: (success() || failure()) # run this step even if previous step failed
142142
uses: ./.github/actions/gen-report
143143

144144
api3_and_osf:
@@ -164,9 +164,9 @@ jobs:
164164
- uses: actions/checkout@v2
165165
- uses: ./.github/actions/start-build
166166
- name: Run tests
167-
run: poetry run python3 -m invoke test-ci-api3-and-osf -n 1 --junit
167+
run: poetry run python3 -m invoke test-ci-api3-and-osf --junit
168168
- name: Upload report
169-
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
169+
if: (success() || failure()) # run this step even if previous step failed
170170
uses: ./.github/actions/gen-report
171171

172172
mailhog:

CHANGELOG

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
44

5+
25.12.0 (2025-07-08)
6+
====================
7+
8+
- Verified Resource Linking project release - BE
9+
- OSF support for GV session optimization
10+
- OSF node log for add-ons
11+
- CI improvements
12+
- Task routing fixes
13+
14+
515
25.11.1 (2025-07-03)
616
====================
717

admin_tests/nodes/test_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ def setUp(self):
546546
self.user = AuthUserFactory()
547547
self.node = ProjectFactory(creator=self.user)
548548

549+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
549550
def test_request_approval_is_approved(self):
550551
now = timezone.now()
551552
self.approval = RegistrationApprovalFactory(

admin_tests/registrations/test_registrations.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ def test_embargoed_registration_from_changed_to_private_project_spam_ham(self, e
9292
embargoed_registration_from_changed_to_private_project.confirm_ham(save=True)
9393
assert not embargoed_registration_from_changed_to_private_project.is_public
9494

95+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
9596
def test_public_registration_from_public_project_spam_ham(self, superuser, public_registration_from_public_project):
9697
public_registration_from_public_project.confirm_spam(save=True)
9798
assert not public_registration_from_public_project.is_public
9899
public_registration_from_public_project.confirm_ham(save=True)
99100
assert public_registration_from_public_project.is_public
100101

102+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
101103
def test_public_registration_from_private_project_spam_ham(self, superuser, public_registration_from_private_project):
102104
public_registration_from_private_project.confirm_spam(save=True)
103105
assert not public_registration_from_private_project.is_public
@@ -110,18 +112,21 @@ def test_private_registration_from_private_project_spam_ham(self, superuser, pri
110112
private_registration_from_public_project.confirm_ham(save=True)
111113
assert not private_registration_from_public_project.is_public
112114

115+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
113116
def test_public_registration_from_changed_to_public_project_spam_ham(self, superuser, public_registration_from_changed_to_public_project):
114117
public_registration_from_changed_to_public_project.confirm_spam(save=True)
115118
assert not public_registration_from_changed_to_public_project.is_public
116119
public_registration_from_changed_to_public_project.confirm_ham(save=True)
117120
assert public_registration_from_changed_to_public_project.is_public
118121

122+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
119123
def test_public_registration_from_changed_to_private_project_spam_ham(self, superuser, public_registration_from_changed_to_private_project):
120124
public_registration_from_changed_to_private_project.confirm_spam(save=True)
121125
assert not public_registration_from_changed_to_private_project.is_public
122126
public_registration_from_changed_to_private_project.confirm_ham(save=True)
123127
assert public_registration_from_changed_to_private_project.is_public
124128

129+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
125130
def test_unapproved_registration_task(self, embargoed_registration_from_changed_to_public_project):
126131
embargoed_registration_from_changed_to_public_project.registration_approval.state = 'unapproved'
127132
embargoed_registration_from_changed_to_public_project.registration_approval.initiation_date -= timedelta(3)
@@ -131,6 +136,7 @@ def test_unapproved_registration_task(self, embargoed_registration_from_changed_
131136
embargoed_registration_from_changed_to_public_project.registration_approval.refresh_from_db()
132137
assert embargoed_registration_from_changed_to_public_project.registration_approval.state == 'approved'
133138

139+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
134140
def test_unapproved_registration_task_after_spam(self, embargoed_registration_from_changed_to_public_project):
135141
embargoed_registration_from_changed_to_public_project.registration_approval.state = 'unapproved'
136142
embargoed_registration_from_changed_to_public_project.registration_approval.initiation_date -= timedelta(3)
@@ -141,6 +147,7 @@ def test_unapproved_registration_task_after_spam(self, embargoed_registration_fr
141147
embargoed_registration_from_changed_to_public_project.registration_approval.refresh_from_db()
142148
assert embargoed_registration_from_changed_to_public_project.registration_approval.state == 'unapproved'
143149

150+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
144151
def test_unapproved_registration_task_after_spam_ham(self, embargoed_registration_from_changed_to_public_project):
145152
embargoed_registration_from_changed_to_public_project.registration_approval.state = 'unapproved'
146153
embargoed_registration_from_changed_to_public_project.registration_approval.initiation_date -= timedelta(3)

api/share/utils.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from framework.celery_tasks.handlers import enqueue_task
1313
from framework.encryption import ensure_bytes
1414
from framework.sentry import log_exception
15+
from osf.external.gravy_valet.exceptions import GVException
1516
from osf.metadata.osf_gathering import (
1617
OsfmapPartition,
1718
pls_get_magic_metadata_basket,
@@ -78,15 +79,20 @@ def task__update_share(self, guid: str, is_backfill=False, osfmap_partition_name
7879
raise ValueError(f'unknown osfguid "{guid}"')
7980
_resource = _osfid_instance.referent
8081
_is_deletion = _should_delete_indexcard(_resource)
81-
_response = (
82-
pls_delete_trove_record(_resource, osfmap_partition=_osfmap_partition)
83-
if _is_deletion
84-
else pls_send_trove_record(
85-
_resource,
86-
is_backfill=is_backfill,
87-
osfmap_partition=_osfmap_partition,
82+
try:
83+
_response = (
84+
pls_delete_trove_record(_resource, osfmap_partition=_osfmap_partition)
85+
if _is_deletion
86+
else pls_send_trove_record(
87+
_resource,
88+
is_backfill=is_backfill,
89+
osfmap_partition=_osfmap_partition,
90+
)
8891
)
89-
)
92+
except GVException as e:
93+
log_exception(e)
94+
raise self.retry(exc=e)
95+
9096
try:
9197
_response.raise_for_status()
9298
except Exception as e:

api_tests/identifiers/managment_commands/test_sync_dois.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def preprint_identifier(self, preprint):
5353
identifier.save(update_modified=False)
5454
return identifier
5555

56+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
5657
@pytest.mark.enable_enqueue_task
5758
def test_doi_synced_datacite(self, app, registration, registration_identifier, mock_datacite):
5859
assert registration_identifier.modified.date() < datetime.datetime.now().date()
@@ -66,6 +67,7 @@ def test_doi_synced_datacite(self, app, registration, registration_identifier, m
6667
registration_identifier.reload()
6768
assert registration_identifier.modified.date() == datetime.datetime.now().date()
6869

70+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
6971
@pytest.mark.enable_enqueue_task
7072
def test_doi_synced_crossref(self, app, preprint_identifier, mock_crossref):
7173
assert preprint_identifier.modified.date() < datetime.datetime.now().date()
@@ -77,6 +79,7 @@ def test_doi_synced_crossref(self, app, preprint_identifier, mock_crossref):
7779
preprint_identifier.reload()
7880
assert preprint_identifier.modified.date() == datetime.datetime.now().date()
7981

82+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
8083
@pytest.mark.enable_enqueue_task
8184
def test_doi_sync_private(self, app, registration_private, registration_identifier, mock_datacite):
8285

@@ -91,6 +94,7 @@ def test_doi_sync_private(self, app, registration_private, registration_identifi
9194
assert registration_identifier.modified.date() < datetime.datetime.now().date()
9295
assert registration_identifier.modified.date() < datetime.datetime.now().date()
9396

97+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
9498
@pytest.mark.enable_enqueue_task
9599
def test_doi_sync_public_only(self, app, registration_private, registration_identifier, mock_datacite):
96100
call_command('sync_doi_metadata', f'-m={datetime.datetime.now()}')

api_tests/identifiers/views/test_identifier_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ def ark_payload(self):
475475
def client(self, resource):
476476
return DataCiteClient(resource)
477477

478+
@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
478479
@responses.activate
479480
def test_create_identifier(self, app, resource, client, identifier_url, identifier_payload, user,
480481
write_contributor, read_contributor, ark_payload):

api_tests/metadata_records/test_custom_item_metadata.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414

1515
@pytest.mark.usefixtures('with_class_scoped_db')
16+
@pytest.mark.django_db
1617
class TestCustomItemMetadataRecordDetail:
1718
APIV2_PATH = 'custom_item_metadata_records/'
1819
APIV2_RESOURCE_TYPE = 'custom-item-metadata-record'
@@ -56,19 +57,19 @@ def assert_expected_log(self, osfguid, user, updated_fields):
5657
return log
5758

5859
@pytest.fixture(scope='class')
59-
def user_admin(self):
60+
def user_admin(self, _class_scoped_db):
6061
return AuthUserFactory(username='some admin')
6162

6263
@pytest.fixture(scope='class')
63-
def user_readwrite(self):
64+
def user_readwrite(self, _class_scoped_db):
6465
return AuthUserFactory(username='some readwrite')
6566

6667
@pytest.fixture(scope='class')
67-
def user_readonly(self):
68+
def user_readonly(self, _class_scoped_db):
6869
return AuthUserFactory(username='some readonly')
6970

7071
@pytest.fixture(scope='class')
71-
def user_rando(self):
72+
def user_rando(self, _class_scoped_db):
7273
return AuthUserFactory(username='some rando')
7374

7475
@pytest.fixture(scope='class')

0 commit comments

Comments
 (0)