Skip to content

[ENG-10146] Changes in Admin by Support Staff should be visible in activity logs#11697

Merged
cslzchen merged 3 commits into
CenterForOpenScience:feature/pbs-26-9from
antkryt:feature/ENG-10146
Jun 3, 2026
Merged

[ENG-10146] Changes in Admin by Support Staff should be visible in activity logs#11697
cslzchen merged 3 commits into
CenterForOpenScience:feature/pbs-26-9from
antkryt:feature/ENG-10146

Conversation

@antkryt
Copy link
Copy Markdown
Contributor

@antkryt antkryt commented Apr 16, 2026

Ticket

Purpose

add missing logs for admin actions

Changes

  • expose foreign_user in logs response
  • add requested logs for admin actions

Side Effects

QE Notes

CE Notes

Documentation

@antkryt
Copy link
Copy Markdown
Contributor Author

antkryt commented Apr 17, 2026

tests passed on my local branch

Copy link
Copy Markdown
Contributor

@mkovalua mkovalua left a comment

Choose a reason for hiding this comment

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

LGTM, small changings are needed for Front End side to render foreign_user

An OSF Support Team member made a node private

for logs

image

@mkovalua
Copy link
Copy Markdown
Contributor

@adlius try please test job rerun , maybe some CI/CD issue

@antkryt antkryt changed the base branch from feature/pbs-26-6 to feature/pbs-26-9 May 26, 2026 16:34
@antkryt antkryt force-pushed the feature/ENG-10146 branch from f70f672 to 85f02ee Compare May 27, 2026 13:12
Copy link
Copy Markdown
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.

Looks good overall 👍 with a few questions to help me understand and some nitpicking suggestions.

Comment thread admin/nodes/views.py Outdated
Comment thread admin/nodes/views.py
Comment thread admin/nodes/views.py

if permissions_changed:
params = resource.log_params
params['contributors'] = permissions_changed
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am noticed that the type of params['contributors'] can be a integer (user.pk) earlier and a dict here. Seems inconsistent to me?

Copy link
Copy Markdown
Contributor Author

@antkryt antkryt Jun 2, 2026

Choose a reason for hiding this comment

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

Yeah, permissions_changed is the dict with user.pk, so technically it would be better to use some iterable (e.g., [user.pk]) instead of a single user.pk. I will update it

Comment thread admin/nodes/views.py
).save()
auth=None,
foreign_user=NodeLog.SUPPORT_USER_LABEL,
params=dict(node.log_params),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar to an earlier question, node.log_params vs params={'project': node.parent_id}. Is this a required functional change? i.e. passing everything instead of just the one needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see my first comment

Comment thread admin/nodes/views.py Outdated
Comment thread admin/nodes/views.py Outdated
Comment on lines +956 to +961
params={
'project': node.parent_id,
'node': node._primary_key,
'pathType': 'file',
'path': file_path,
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here. Maybe there is a reason we have to manually / explicitly set the params in some cases like this and a couple of following ones.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see my comments above

Comment thread admin_tests/nodes/test_views.py Outdated
Copy link
Copy Markdown
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.

⭐ thanks for the detailed response and 👍 for unit tests

@cslzchen cslzchen merged commit ebde26c into CenterForOpenScience:feature/pbs-26-9 Jun 3, 2026
8 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.

3 participants