-
Notifications
You must be signed in to change notification settings - Fork 443
Fix handling of force
option in databricks_git_credential
#4873
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
base: main
Are you sure you want to change the base?
Conversation
With introduction of support for multiple Git credentials the error message did change a bit, so the `force` option may not work in all cases. Resolves #4871
func isOnlyOneGitCredentialError(err error) bool { | ||
errStr := err.Error() | ||
return errors.Is(err, apierr.ErrResourceConflict) || | ||
(strings.Contains(errStr, "Only one Git credential is supported ") && strings.Contains(errStr, " at this time")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the old error message. Are you intending to parse the new one for SPs + multiple git creds? https://sourcegraph.prod.databricks-corp.com/databricks-eng/universe/-/blob/projects/main/scala/credentials/messages/GitCredentialsMessages.scala?L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main question here is - can we rely only on HTTP 409, or do we still need to rely on error messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case for single credential for SP is handled now via errors.Is(err, apierr.ErrResourceConflict)
Co-authored-by: Grant Eaton <[email protected]>
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
With introduction of support for multiple Git credentials the error message did change a bit, so the
force
option may not work in all cases.Resolves #4871
Changes
Tests
make test
run locallydocs/
folderinternal/acceptance
NEXT_CHANGELOG.md
file