Comments (11)
interesting, ill have to find some time to see if I can reproduce this and see whats up
from diff_cover.
An update: This issue is non-deterministic.
Scenario: We have a file that would fail a lint/violation check, but it shouldn't be scanned in our given scenario. I've confirmed via git diff --name-only master
the file failing is not present, only the removed files are. My expectation is diff-quality
would pass 0 files to the violations tool. (as I write this, I realize I'm making some assumptions on how the interaction between diff_cover and the sqlfluff plugin might work)
When attempting to replicate locally, my first attempt running diff-quality passed. I re-traced my steps to ensure I did the same thing as CI/CD and got it to fail on the file that wasn't modified. I then re-ran the exact same command listed in my first comment 5 times in succession. The result was 4 failures and 1 pass.
from diff_cover.
Upgraded to 8.0 with same result. Using Python 3.9.9.
from diff_cover.
So its not immediately obvious to me why diff-quality would be acting differently on removed files.
the basic algorithm is
run the quality tool command over the project
Run
'git -c diff.mnemonicprefix=no -c diff.noprefix=no diff --no-color --no-ext-diff -U0 origin/main...HEAD'
compare the lines reported the quality tool to the lines in the diff.
Now, I do think sql fluff is a bit different in that it runs over each and every file. https://github.com/sqlfluff/sqlfluff/blob/9579127595333037aa893adb4384d7612c32e0ed/src/sqlfluff/diff_quality_plugin.py#L63
@barrywhart do you have any insight on anything on this issue?
@cboden do you have an example repo we can use to debug this at all? Also the branch with the deleted files. Can you share if its a ton of deleted files? Or just s small number?
from diff_cover.
No immediate insights, but I see that the SQLFluff plugin logs the SQLFluff command before running it. It may be helpful to look at that.
One random thought (no evidence, just brainstorming) -- is it possible it's running SQLFluff against one or more directory paths, hence processing all the files in that directory?
from diff_cover.
Two more thoughts:
- A sample repo would definitely be useful. I can't help but wonder if the user's repo or their git installation is corrupted somehow.
- Maybe the core
diff-quality
command (not using SQLFluff plugin) has the same issue. As they say, "absence of evidence is not evidence of absence." From this code, it's clear that both branches (batch or non-batch handling) processsrc_paths_changed
.
from diff_cover.
do you have an example repo we can use to debug this at all? Also the branch with the deleted files. Can you share if its a ton of deleted files? Or just s small number?
It's a small number and is happening on every PR we open like it. The latest PR had the following changes to a dbt repository:
- 33 line .sql file removed
- 15 lines removed from a medium sized .md file
- 40 lines removed from a medium sized .yml file
- 5 lines removed from a huge .yml file
from diff_cover.
My guess is that this is not a bug; that the repo is corrupted somehow.
from diff_cover.
My guess is that this is not a bug; that the repo is corrupted somehow.
How can we test/confirm this? How would a corruption apply to diff_cover or sqlfluff?
from diff_cover.
Run the same git command that diff-cover uses and see if it includes more files than it should.
from diff_cover.
I've confirmed via git diff --name-only master the file failing is not present, only the removed files are.
Is there another git command I should test?
from diff_cover.
Related Issues (20)
- Blank lines not factored into range HOT 2
- Few tests fails in rmtree HOT 6
- 7.3.1: test suite is failing in `tests/test_integration.py::TestDiffQualityIntegration::test_html_with_external_css` unit HOT 2
- Make chardet a optional dependency HOT 1
- In cpp file,The coverage of changed lines is not being counted HOT 2
- any ways to get all measured lines' numbers from json report HOT 2
- Feature request — Invert output to find flaky tests and help determine test failures HOT 1
- does this tool support C++ opencppcoverage? cppcoverage has html, cobertura reports. HOT 1
- urgent!! work environment!!No lines with coverage information in this diff. HOT 2
- new Github action for diff-cover HOT 1
- There is a folder code that cannot be counted. It has been analyzed for a long time, please help HOT 1
- 5 tests fail HOT 2
- Package has classifier "License :: Other/Proprietary License" - raising licensing flags for Sonatype HOT 3
- Enhancing Report Visualization in 'diff-cover' Project for Improved Code Analysis HOT 2
- 7.7.0: pytest is failing in `tests/test_violations_reporter.py::TestFlake8QualityReporterTest::test_file_does_not_exist` unit HOT 33
- Support ruff for quality checking HOT 1
- Diff between two coverage files instead of coverage file from branch HOT 2
- Running diff-quality with a tool which is not installed gives FIleNotFoundError rather than helpful "<tool> is not installed" error message HOT 2
- Add support for Pyright as a quality-checking tool HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diff_cover.