diff --git a/ccos/data/get_community_team_data.py b/ccos/data/get_community_team_data.py index d7497df..bf00d60 100644 --- a/ccos/data/get_community_team_data.py +++ b/ccos/data/get_community_team_data.py @@ -1,10 +1,3 @@ -""" -This script pulls the members of the "Community Team Tracking" Asana -project, formats it a bit, then pushes it to a databag -"databags/community_team_list.json" -in creativecommons/creativecommons.github.io-source -""" - # Standard library import inspect import logging @@ -33,6 +26,7 @@ def setup_asana_client(): LOG.critical("missin ADMIN_ASANA_TOKEN environment variable") sys.exit(1) asana_client = asana.Client.access_token(asana_token) + asana_client.headers = {"asana-enable": "new_goal_memberships"} try: # Perform simple API operation to test authentication asana_client.workspaces.get_workspace(ASANA_WORKSPACE_GID) diff --git a/normalize_repos.py b/normalize_repos.py index 98511e4..86eda29 100755 --- a/normalize_repos.py +++ b/normalize_repos.py @@ -135,6 +135,10 @@ def update_branch_protection(repo): and is_engineering_project(repo) ): LOG.info(f"{repo.name}: updating branch protections") + # The following empty *_bypass_pull_request_allowance arguments ensure + # the required bypass_pull_request_allowances API parameter is + # populated: + # https://docs.github.com/rest/branches/branch-protection#update-branch-protection if repo.name in branch_protections.REQUIRED_STATUS_CHECK_MAP: default_branch.edit_protection( required_approving_review_count=1, @@ -142,10 +146,17 @@ def update_branch_protection(repo): contexts=branch_protections.REQUIRED_STATUS_CHECK_MAP[ repo.name ], + users_bypass_pull_request_allowances=[], + teams_bypass_pull_request_allowances=[], + apps_bypass_pull_request_allowances=[], ) else: default_branch.edit_protection( - required_approving_review_count=1, user_push_restrictions=[] + required_approving_review_count=1, + user_push_restrictions=[], + users_bypass_pull_request_allowances=[], + teams_bypass_pull_request_allowances=[], + apps_bypass_pull_request_allowances=[], ) else: LOG.info(f"{repo.name}: skipping: exempt")