Skip to content

Commit 5e80a63

Browse files
Tobie TusingTobie Tusing
authored andcommitted
add a warning when regenerating the lockfile for packages
1 parent ada5d3b commit 5e80a63

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

core/dbt/events/types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,14 @@ def message(self) -> str:
15171517
return f"Found duplicate package in packages.yml, removing: {self.removed_package}"
15181518

15191519

1520+
class DepsLockfileRegenerating(WarnLevel):
1521+
def code(self):
1522+
return "M034"
1523+
1524+
def message(self) -> str:
1525+
return f"Package lockfile is out of sync with packages.yml. Regenerating lockfile at: {self.lock_filepath}"
1526+
1527+
15201528
class DepsScrubbedPackageName(WarnLevel):
15211529
def code(self):
15221530
return "M035"

core/dbt/task/deps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
DepsFoundDuplicatePackage,
2222
DepsInstallInfo,
2323
DepsListSubdirectory,
24+
DepsLockfileRegenerating,
2425
DepsLockUpdating,
2526
DepsNoPackagesFound,
2627
DepsNotifyUpdatesAvailable,
@@ -220,6 +221,7 @@ def run(self) -> None:
220221
current_hash = _create_sha1_hash(self.project.packages.packages)
221222
previous_hash = load_yml_dict(lock_file_path).get(PACKAGE_LOCK_HASH_KEY, None)
222223
if previous_hash != current_hash:
224+
fire_event(DepsLockfileRegenerating(lock_filepath=lock_file_path))
223225
self.lock()
224226

225227
# Early return when 'dbt deps --lock'

0 commit comments

Comments
 (0)