Skip to content

Commit

Permalink
Restore warning on unpinned git packages (#9157)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 authored Nov 29, 2023
1 parent c836b75 commit 0935570
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/dbt/deps/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ def _fetch_metadata(
self, project: Project, renderer: PackageRenderer
) -> ProjectPackageMetadata:
path = self._checkout()
# overwrite 'revision' with actual commit SHA
self.revision = git.get_current_sha(path)

# raise warning (or error) if this package is not pinned
if (self.revision == "HEAD" or self.revision in ("main", "master")) and self.warn_unpinned:
warn_or_error(DepsUnpinned(git=self.git))
warn_or_error(DepsUnpinned(revision=self.revision, git=self.git))

# now overwrite 'revision' with actual commit SHA
self.revision = git.get_current_sha(path)

partial = PartialProject.from_project_root(path)
return partial.render_package_metadata(renderer)

Expand Down

0 comments on commit 0935570

Please sign in to comment.