Skip to content

Enable silencing warnings for UnpinnedRefNewVersionAvailable messages #11442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Mar 28, 2025

Resolves #11221

Problem

From #11221:

As a dbt-core user, I would expect that I would be able to silence UnpinnedRefNewVersionAvailable messages using the documented warning and error silencing process[^1]. As such, I should be able to add the following flag to my dbt_project.yml to silence these messages entirely:

flags:
  warn_error_options:
    silence:
      - UnpinnedRefNewVersionAvailable

But the YAML above doesn't work to silence the warnings.

Solution

From #11221:

I suspect the cause of the issue is that UnpinnedRefNewVersionAvailable inherits from InfoLevel and not WarnLevel1. If this is the case, it should be relatively easy to resolve this issue.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

Footnotes

  1. https://github.com/dbt-labs/dbt-core/blob/3de3b827bfffdc43845780f484d4d53011f20a37/core/dbt/events/types.py#L832

Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.89%. Comparing base (e264675) to head (c1cc55a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11442      +/-   ##
==========================================
- Coverage   88.89%   88.89%   -0.01%     
==========================================
  Files         191      191              
  Lines       24391    24393       +2     
==========================================
+ Hits        21682    21683       +1     
- Misses       2709     2710       +1     
Flag Coverage Δ
integration 85.90% <100.00%> (+<0.01%) ⬆️
unit 62.82% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.82% <100.00%> (+<0.01%) ⬆️
Integration Tests 85.90% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@QMalcolm
Copy link
Contributor

So this is partially because the issue wasn't a warning. It's also because the warning isn't fired via warn_error, but instead fire_event. Interestingly it was the case that only events via warn_error were controllable via --warn-error-options, however, we're making it the case that all warnings will be handleable via --warn-error-options, though gated behind a behavior flag. We'll have to wait for that work to be merged (#11483) in order to solve this completely. And at that point people will have to flip the behavior flag for their project to handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] UnpinnedRefNewVersionAvailable messages cannot be silenced
2 participants