-
Notifications
You must be signed in to change notification settings - Fork 11
fix: Sync plan_activated_users during sync_teams #902
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #902 +/- ##
=======================================
Coverage ? 98.06%
=======================================
Files ? 444
Lines ? 35474
Branches ? 0
=======================================
Hits ? 34786
Misses ? 688
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
✅ All tests successful. No failed tests were found. 📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
8774da8
to
3b28bbb
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
7e09bf5
to
f1eddb4
Compare
cfbad10
to
a001d68
Compare
Actually it looks like this logic is handled upstream by the place this job is called EDIT - see pr description - this is only 1 of many places this can be called |
closing because this logic already takes place here - https://github.com/codecov/codecov-api/blob/ae83c2fa69b4d572b0096c54803d8068a8f13ebe/webhook_handlers/views/github.py#L611C13-L616C21 |
sync_teams
runs to take a user (e.g.,suejung-sentry
) and update itsorganizations
.When it does this, it should also remove from that organization (e.g.,
codecov
)'splan_activated_users
, so the 2 places remain consistent.That is, owners table row for owner
suejung-sentry
hasowners.organizations=['codecov','other-org','other-org-2']
and owners table row for ownercodecov
hasowners.plan_activated_users=['suejung-sentry','other-user','other-user-2']
and we need both those updated.Special handling for "outside collaborators" - There may be "outside collaborators" that are not members of the org but may still be activated seats in codecov, so does keeping the 2 lists consistent make sense? Per here, I think we don't expressly support this feature and can employ a manual workaround in the infrequent cases a particular customer requires it.
sync_teams
job is triggered from hereHere's another place it can be triggered by https://github.com/codecov/codecov-api/blob/354b64076170dd4115a4c83fbda63ba4478a23d7/services/refresh.py#L38
https://github.com/codecov/codecov-api/blob/354b64076170dd4115a4c83fbda63ba4478a23d7/graphql_api/types/mutation/sync_with_git_provider/sync_with_git_provider.py#L12 (graphql api resolve_sync_with_git_provider)
where it's called in gazebo
https://github.com/codecov/gazebo/blob/26d07c7dd517ae4a45751fa5b2d45785a264f98f/src/services/user/useResyncUser.ts#L33
Can't find your repo resync button (https://github.com/codecov/gazebo/blob/26d07c7dd517ae4a45751fa5b2d45785a264f98f/src/shared/ListRepo/OrgControlTable/RepoOrgNotFound/RepoOrgNotFound.tsx#L61)
Closes https://github.com/codecov/internal-issues/issues/1085