From e88f1f1edb20f96cb245828be71661be1bd1363d Mon Sep 17 00:00:00 2001 From: VS Date: Fri, 12 Feb 2021 22:34:49 -0500 Subject: [PATCH 1/2] 3057 Replacing 'master' to 'HEAD' for default git commit --- core/dbt/clients/git.py | 2 +- core/dbt/deps/git.py | 4 ++-- test/unit/test_deps.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/dbt/clients/git.py b/core/dbt/clients/git.py index dc3b573c0e7..0bbf937d42d 100644 --- a/core/dbt/clients/git.py +++ b/core/dbt/clients/git.py @@ -52,7 +52,7 @@ def _checkout(cwd, repo, branch): def checkout(cwd, repo, branch=None): if branch is None: - branch = 'master' + branch = 'HEAD' try: return _checkout(cwd, repo, branch) except dbt.exceptions.CommandResultError as exc: diff --git a/core/dbt/deps/git.py b/core/dbt/deps/git.py index b8018e1bb07..f5c05576f15 100644 --- a/core/dbt/deps/git.py +++ b/core/dbt/deps/git.py @@ -72,7 +72,7 @@ def _checkout(self): def _fetch_metadata(self, project, renderer) -> ProjectPackageMetadata: path = self._checkout() - if self.revision == 'master' and self.warn_unpinned: + if self.revision == 'HEAD' and self.warn_unpinned: warn_or_error( 'The git package "{}" is not pinned.\n\tThis can introduce ' 'breaking changes into your project without warning!\n\nSee {}' @@ -133,7 +133,7 @@ def incorporate( def resolved(self) -> GitPinnedPackage: requested = set(self.revisions) if len(requested) == 0: - requested = {'master'} + requested = {'HEAD'} elif len(requested) > 1: raise_dependency_error( 'git dependencies should contain exactly one version. ' diff --git a/test/unit/test_deps.py b/test/unit/test_deps.py index 4741a77e1bb..e4fcda2ba14 100644 --- a/test/unit/test_deps.py +++ b/test/unit/test_deps.py @@ -104,7 +104,7 @@ def test_default_revision(self): a_pinned = a.resolved() self.assertEqual(a_pinned.name, 'http://example.com') - self.assertEqual(a_pinned.get_version(), 'master') + self.assertEqual(a_pinned.get_version(), 'HEAD') self.assertEqual(a_pinned.source_type(), 'git') self.assertIs(a_pinned.warn_unpinned, True) From ad07d59a78ac56edd9b8c9ffd470bf052e23436d Mon Sep 17 00:00:00 2001 From: VS Date: Mon, 15 Feb 2021 17:06:36 -0500 Subject: [PATCH 2/2] 3057 Changelog.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 170427bfb31..7e91e035119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Fix exit code from dbt debug not returning a failure when one of the tests fail ([#3017](https://github.com/fishtown-analytics/dbt/issues/3017)) - Auto-generated CTEs in tests and ephemeral models have lowercase names to comply with dbt coding conventions ([#3027](https://github.com/fishtown-analytics/dbt/issues/3027), [#3028](https://github.com/fishtown-analytics/dbt/issues/3028)) - Fix incorrect error message when a selector does not match any node [#3036](https://github.com/fishtown-analytics/dbt/issues/3036)) +- Moving from 'master' to 'HEAD' default branch in git ([#3057](https://github.com/fishtown-analytics/dbt/issues/3057)) ### Features - Add optional configs for `require_partition_filter` and `partition_expiration_days` in BigQuery ([#1843](https://github.com/fishtown-analytics/dbt/issues/1843), [#2928](https://github.com/fishtown-analytics/dbt/pull/2928)) @@ -19,6 +20,7 @@ Contributors: - [@rvacaru](https://github.com/rvacaru) ([#2974](https://github.com/fishtown-analytics/dbt/pull/2974)) - [@NiallRees](https://github.com/NiallRees) ([#3028](https://github.com/fishtown-analytics/dbt/pull/3028)) - [ran-eh](https://github.com/ran-eh) ([#3036](https://github.com/fishtown-analytics/dbt/pull/3036)) +- [@VasiliiSurov](https://github.com/VasiliiSurov) ([#3104](https://github.com/fishtown-analytics/dbt/pull/3104)) ## dbt 0.19.1 (Release TBD)