Skip to content

Add automatic repo permissions sync toggle

Warren Gifford requested to merge pjlast/25903-toggle-background-permissions into main

Created by: pjlast

Adds a new field to the external services config called disableAutomaticRepoPermissionsSync, which is false by default. This maintains backwards compatibility with existing configurations. However, all new configurations will have "disableAutomaticRepoPermissionsSync": true added to the config by default.

Any repositories added by external services with this field set to false will be excluded from the functions ReposIDsWithOldestPerms and RepoIDsWithNoPerms, which are used to fetch repositories that should be automatically synced.

This allows admins to still trigger a manual sync of the repositories if they want to.

Will probably have to think of some sort of a migration for existing customers so that things don't stop working the way they're used to.

Fix #25903

Test plan

Updated unit tests to include code hosts that have disableAutomaticRepoPermissionsSync set to true, and verified that ReposIDsWithOldestPerms and RepoIDsWithNoPerms ignores those repositories.

Merge request reports

Loading