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

Fix unexpected errors with deactivated accounts and managed group membership #410

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

amstilp
Copy link
Contributor

@amstilp amstilp commented Oct 25, 2023

  • Update the ManagedGroupMembershipAudit to consider account status when checking membership. It now does not show audit errors for a deactivated account when the record of a group membership exists in the app but not on AnVIL, and does show audit errors if the deactivated account is in the group on AnVIL.

Closes #404

The ManagedGroupMembershipAudit currently gives an error if there
is a deactivated account that is in a group in the app, but is not
in the group on AnVIL. This is expected because the app stores the
record of what groups the account was in (so there is a record for
the GroupAccountMembership), but removes the account from all groups
on AnVIL (so the account email do not appear in the list of members/
admin returned by the AnVIL API). This should not raise an audit
error.
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #410 (2904ea1) into main (c44b091) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #410   +/-   ##
=======================================
  Coverage   99.82%   99.82%           
=======================================
  Files         121      121           
  Lines       22803    22873   +70     
=======================================
+ Hits        22763    22834   +71     
+ Misses         40       39    -1     
Files Coverage Δ
anvil_consortium_manager/__init__.py 100.00% <100.00%> (ø)
anvil_consortium_manager/audit/audit.py 100.00% <100.00%> (+0.36%) ⬆️
anvil_consortium_manager/tests/test_audit.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

The __init__ method failed with an unexpected exception if a
group was not managed by the app (AttributeError instead of
AnVILNotGroupAdminError). Fix the __init__ method and add a test.
@amstilp amstilp merged commit 5b42501 into main Oct 25, 2023
@amstilp amstilp deleted the bugfix/404-audit-deactivated-accounts branch October 25, 2023 22:24
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.

Audit errors for deactivated accounts
1 participant