cli icon indicating copy to clipboard operation
cli copied to clipboard

Improve git config section validation

Open denik opened this issue 1 year ago • 5 comments

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.

denik avatar Nov 27 '24 21:11 denik

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.

github-actions[bot] avatar Dec 09 '24 17:12 github-actions[bot]

Test Details: go/deco-tests/12240512958

eng-dev-ecosystem-bot avatar Dec 09 '24 17:12 eng-dev-ecosystem-bot

Thanks, this looks great!

Does the e2e coverage of LoadGitDetails cover 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.

denik avatar Dec 10 '24 13:12 denik

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.

github-actions[bot] avatar Jan 10 '25 00:01 github-actions[bot]

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.

github-actions[bot] avatar Mar 15 '25 00:03 github-actions[bot]