diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py index c50aba9085d..04f7ddd961e 100644 --- a/core/dbt/events/types.py +++ b/core/dbt/events/types.py @@ -1517,6 +1517,14 @@ def message(self) -> str: return f"Found duplicate package in packages.yml, removing: {self.removed_package}" +class DepsLockfileRegenerating(WarnLevel): + def code(self): + return "M034" + + def message(self) -> str: + return f"Package lockfile is out of sync with packages.yml. Regenerating lockfile at: {self.lock_filepath}" + + class DepsScrubbedPackageName(WarnLevel): def code(self): return "M035" diff --git a/core/dbt/task/deps.py b/core/dbt/task/deps.py index cd5624a9c71..424739c9e9e 100644 --- a/core/dbt/task/deps.py +++ b/core/dbt/task/deps.py @@ -21,6 +21,7 @@ DepsFoundDuplicatePackage, DepsInstallInfo, DepsListSubdirectory, + DepsLockfileRegenerating, DepsLockUpdating, DepsNoPackagesFound, DepsNotifyUpdatesAvailable, @@ -220,6 +221,7 @@ def run(self) -> None: current_hash = _create_sha1_hash(self.project.packages.packages) previous_hash = load_yml_dict(lock_file_path).get(PACKAGE_LOCK_HASH_KEY, None) if previous_hash != current_hash: + fire_event(DepsLockfileRegenerating(lock_filepath=lock_file_path)) self.lock() # Early return when 'dbt deps --lock'