Support ignoring 404s when user is not found in GitHub instance #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new configuration option,
ignore_not_found
, which allows entitlements to ignoreHTTP 404
errors when trying to perform organization and team membership operations on a GitHub instance where the user doesn't exist.Sometimes this option may be desirable when GitHub instance users are ultimately provisioned by other entitlements plugins and there is a race condition where this plugin may try to add a member before they exist.
For example, users may be provisioned in a GitHub instance via Enterprise Managed Users backed by an IdP which is also fed by entitlements. If the SCIM requests don't complete before this plugin is executed, the member will not exist in the instance and the run will fail. Since entitlements is designed to be run often, it may be acceptable to allow an "eventually consistent" state where entitlements would add the user the next time it runs once it's provisioned by the IdP.