Improve git config section validation
Previously we checked if ActualBranch (from .git) and Branch disagreed and issued an error unless --force was passed.
We still do that, but also:
- if --force is passed, we now log this as a warning (previously it went silent)
- we do the same logic for commit (previously unchecked)
- we do similar logic for originURL except it always logs warning and never prevent the deployment
I removed separate mutator (validate_git_details.go) and put everything into load_git_details.go.
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:
Trigger: go/deco-tests-run/cli
Inputs:
- PR number: 1940
- Commit SHA:
48e6b9215e4d908926dc2117bba11f187dbe9fd3
Checks will be approved automatically on success.
Test Details: go/deco-tests/12240512958
Thanks, this looks great!
Does the e2e coverage of
LoadGitDetailscover this as well?
Not, E2E, but there is https://github.com/databricks/cli/blob/main/bundle/tests/git_test.go#L45 that checks Branch validation behavior.
This PR has not received an update in a while. If you want to keep this PR open, please leave a comment below or push a new commit and auto-close will be canceled.
This PR has not received an update in a while. If you want to keep this PR open, please leave a comment below or push a new commit and auto-close will be canceled.