dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.7k stars 1.61k forks source link

Use `git tag --no-column` for listing tags for `dbt deps` #10381

Open dbeatty10 opened 3 months ago

dbeatty10 commented 3 months ago

Housekeeping

Short description

Use git tag --no-column instead of git tag --list to prevent the issue described in https://github.com/dbt-labs/dbt-core/issues/10305

Acceptance criteria

Use git tag --no-column instead of git tag --list.

Suggested Tests

  1. Current tests in CI.
  2. Manual testing after changing the git configuration:
    git config --local column.ui always

Impact to Other Teams

Should not have impact to other teams

Will backports be required?

No

Context

As described in https://github.com/dbt-labs/dbt-core/issues/10305#issuecomment-2171943583, if a user updates their git client to always use columnar output like the following, it will break dbt deps:

git config --local column.ui always

So in order to make dbt deps more resilient, we could update this to be:

    out, err = run_cmd(cwd, ["git", "tag", "--no-column"], env={"LC_ALL": "C"})

The thing to be careful of is git clients that might not have the --no-column flag available.

It looks like --no-column was introduced in v1.7.11 by https://github.com/git/git/commit/d96e3c150f2b4508f2e7d23ce9183d5b807c2155 around June 2012, so we might be okay there.

jx2lee commented 3 months ago

is it possible to take this issue for community contributor? this fixes don't seem difficult, and affected tests or additional tests also not difficult to write.

dbeatty10 commented 3 months ago

is it possible to take this issue for community contributor?

Yep! We'd welcome a PR from a community contributor 👍