permissions-center: expose new permissionSyncJobs GraphQL API.#47933
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff ccfa75c...a0efa5d.
|
There was a problem hiding this comment.
Currently we use a reason as a message, I'm still not 100% sure should we convert stuff like REASON_USER_EMAIL_REMOVED to more user friendly string in frontend or backend.
Anyway, I will add this function to our backend/UI code in one of the following PRs.
There was a problem hiding this comment.
Umm, I won't mind doing it on frontend eve. Your choice.
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 309a464 and ccfa75c or learn more. Open explanation
|
2df4b80 to
5c3bdcc
Compare
There was a problem hiding this comment.
I just realised we are not showing the priority on the frontend. Might be a good idea to show it somehow.
There was a problem hiding this comment.
What is PermissionSyncJobProvider ?
There was a problem hiding this comment.
this is effectively a code host AFAIR
described here https://github.com/sourcegraph/sourcegraph/issues/47301
There was a problem hiding this comment.
NO, any user can also trigger manual sync for themselves.
It should be CheckSiteAdminOrSameUser
There was a problem hiding this comment.
hmm, this is an unintended change, something weird must have happened during rebase. Will revert it
There was a problem hiding this comment.
NO, any user can also view their own perms info.
It should be CheckSiteAdminOrSameUser
There was a problem hiding this comment.
☝️ This. I recently changed it so that users can view the info as well, so please don't take it away 😄
There was a problem hiding this comment.
First will be nil in case of backward pagination. This condition is wrong.
You should be able to remove this check safely.
0xnmn
left a comment
There was a problem hiding this comment.
Everything looks good except the 2 security checks. Non-site admin users can also view their own perms info and trigger a manual sync for themselves.
This substitutes experimental `permissionsSyncJobs` API and removes storing permission sync stats into Redis. Test plan: Unit tests updated and added. Local sg run and API query tests.
There was a problem hiding this comment.
What about this TODO? Where should the link point to? This PR? :)
There was a problem hiding this comment.
nice, forgot about it 😬
There was a problem hiding this comment.
Why did we change from a pointer to a non-pointer on args? As far as I see, the graphql schema is defined in almost the same way, so would like to understand this for my own sake.
There was a problem hiding this comment.
ListPermissionSyncJobsArgs is an interface (we sometimes declare interfaces, sometimes don't, I just like the former approach)
There was a problem hiding this comment.
What is the difference between MANUAL and SOURCEGRAPH?
There was a problem hiding this comment.
MANUAL is a manual sync for a user triggered by user.
SOURCEGRAPH is a sync due to internal sg event (email is added/deleted, user is added to sg org, etc.)
There was a problem hiding this comment.
What if both UserID and RepositoryID are 0? Should we return an error in that case?
There was a problem hiding this comment.
it is mutually exclusive via DB constraint.
Should not happen (c)
There was a problem hiding this comment.
☝️ This. I recently changed it so that users can view the info as well, so please don't take it away 😄
There was a problem hiding this comment.
A unit test would be nice for a lib function like this...
3e3bed5 to
cc24d48
Compare
| ### Changed | ||
|
|
||
| - | ||
| - Experimental GraphQL query, `permissionsSyncJobs` is removed and substituted with new non-experimental `permissionSyncJobs` query (mind the singular form of permission) which provides full information about permission sync jobs stored in the database. `authz.syncJobsRecordsTTL`. [#47933](https://github.com/sourcegraph/sourcegraph/pull/47933) |
There was a problem hiding this comment.
Incomplete sentence I think? there's a mention of authz.syncJobsRecordsTTL that seems to have been moved to the removed section
There was a problem hiding this comment.
whoops, that's true, I'm gonna fix it now
There was a problem hiding this comment.
thanks for catching it!
This substitutes experimental
permissionsSyncJobsAPI and removes storing permission sync stats into Redis.Test plan:
Unit tests updated and added.
Local sg run and API query tests.
Closes https://github.com/sourcegraph/sourcegraph/issues/47731.
Closes https://github.com/sourcegraph/sourcegraph/issues/47308.