-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): disable coverage fail-under for package placeholder tests #4
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
Changes from all commits
d3a17b8
2249de5
5c516fc
f8deede
a71ad35
a5572ee
7bb1512
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| [darglint] | ||
| # Google-style docstrings (matches ruff pydocstyle convention) | ||
| docstring_style = google | ||
|
|
||
| # Strictness levels: short, long, full | ||
| # - short: Only documented items must exist in signature | ||
| # - long: All parameters must be documented (recommended) | ||
| # - full: Types in docstring must match annotations | ||
| strictness = long | ||
|
|
||
| # Ignore these error codes | ||
| # DAR101: Missing parameter(s) in Docstring | ||
| # DAR201: Missing "Returns" in Docstring | ||
| # DAR202: Excess "Returns" in Docstring (documented but not returned) | ||
| # DAR301: Missing "Yields" in Docstring | ||
| # DAR401: Missing exception(s) in Raises section | ||
| # DAR402: Excess exception(s) in Raises section (documented but not raised directly) | ||
| ignore = DAR101,DAR201,DAR202,DAR301,DAR401,DAR402 | ||
|
|
||
| # Ignore in these directories (tests, scripts, benchmarks, tools) | ||
| ignore_regex = ^(tests|scripts|benchmarks|tools|\.claude)/.*$ |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |||||
| # - Quality gate enforcement | ||||||
| # - Pull request decoration | ||||||
| # | ||||||
| # SonarCloud Dashboard: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python_libs | ||||||
| # SonarCloud Dashboard: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python-libs | ||||||
| # Documentation: https://docs.sonarsource.com/sonarqube-cloud/ | ||||||
| # | ||||||
| # Note: This workflow requires SONAR_TOKEN secret to be configured. | ||||||
|
|
@@ -106,17 +106,31 @@ jobs: | |||||
| fi | ||||||
|
|
||||||
| - name: SonarCloud Scan | ||||||
| id: sonar-scan | ||||||
| uses: SonarSource/sonarqube-scan-action@884b79409bbd464b2a59edc326a4b77dc56b2195 # v4.0.0 | ||||||
| continue-on-error: true # Don't fail if project not yet configured in SonarCloud | ||||||
| env: | ||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR decoration | ||||||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # SonarCloud authentication | ||||||
| with: | ||||||
| args: > | ||||||
| -Dsonar.organization=ByronWilliamsCPA | ||||||
| -Dsonar.projectKey=ByronWilliamsCPA_python_libs | ||||||
| -Dsonar.projectKey=ByronWilliamsCPA_python-libs | ||||||
| -Dsonar.python.version=3.12 | ||||||
|
|
||||||
| - name: SonarCloud Setup Notice | ||||||
| if: steps.sonar-scan.outcome == 'failure' | ||||||
| run: | | ||||||
| echo "::warning::SonarCloud scan failed. This may indicate the project needs to be created." | ||||||
| echo "" | ||||||
| echo "To set up SonarCloud:" | ||||||
| echo "1. Go to https://sonarcloud.io and sign in with GitHub" | ||||||
| echo "2. Import the ByronWilliamsCPA/python-libs repository" | ||||||
| echo "3. The project key should be: ByronWilliamsCPA_python-libs" | ||||||
| echo "4. Re-run this workflow after project creation" | ||||||
|
|
||||||
| - name: Check Quality Gate | ||||||
| if: steps.sonar-scan.outcome == 'success' | ||||||
| uses: sonarsource/sonarqube-quality-gate-action@master | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and read the sonarcloud.yml file around line 134
find . -path "./.github/workflows/sonarcloud.yml" -type f | head -1 | xargs -I {} sh -c 'wc -l {} && echo "---" && sed -n "130,140p" {} | cat -n'Repository: ByronWilliamsCPA/python-libs Length of output: 603 🏁 Script executed: # Also check all actions in the workflow to see pinning patterns
find . -path "./.github/workflows/sonarcloud.yml" -type f | xargs -I {} grep -n "uses:" {}Repository: ByronWilliamsCPA/python-libs Length of output: 504 🌐 Web query:
💡 Result: Latest release: v1.2.0 — published June 5, 2025. [1][2] Sources: Pin the SonarCloud quality gate action to a specific version. The action currently references - uses: sonarsource/sonarqube-quality-gate-action@master
+ uses: sonarsource/sonarqube-quality-gate-action@v1.2.0📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| timeout-minutes: 5 | ||||||
| env: | ||||||
|
|
@@ -128,7 +142,7 @@ jobs: | |||||
| run: | | ||||||
| echo "### SonarCloud Quality Gate" >> $GITHUB_STEP_SUMMARY | ||||||
| echo "" >> $GITHUB_STEP_SUMMARY | ||||||
| echo "View detailed results: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python_libs" >> $GITHUB_STEP_SUMMARY | ||||||
| echo "View detailed results: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python-libs" >> $GITHUB_STEP_SUMMARY | ||||||
| echo "" >> $GITHUB_STEP_SUMMARY | ||||||
| echo "**Metrics analyzed:**" >> $GITHUB_STEP_SUMMARY | ||||||
| echo "- Code Quality (bugs, code smells, maintainability)" >> $GITHUB_STEP_SUMMARY | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,18 +1,16 @@ | ||||||||||
| --- | ||||||||||
| schema_type: adr | ||||||||||
| schema_type: common | ||||||||||
| title: "ADR-NNN: Short Descriptive Title of the Decision" | ||||||||||
| description: "Brief one-sentence description of what decision this ADR documents" | ||||||||||
| tags: | ||||||||||
| - architecture | ||||||||||
| - decision | ||||||||||
| - your-topic | ||||||||||
| - relevant-area | ||||||||||
| status: proposed | ||||||||||
| owner: "Your Team Role or Name" | ||||||||||
| - adr | ||||||||||
| - decisions | ||||||||||
| status: draft | ||||||||||
| owner: core-maintainer | ||||||||||
| authors: | ||||||||||
| - name: "Author Name" | ||||||||||
| email: "author@example.com" | ||||||||||
| purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered" | ||||||||||
| purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered." | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line length exceeds 120 character limit for YAML configuration. Line 13 contains a purpose string that exceeds the 120 character line length guideline for YAML files (approximately 130 characters). Consider refactoring to a multi-line YAML string for compliance. Apply this refactor: -purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered."
+purpose: |
+ Document the decision to [choose X approach] for [problem area], with
+ rationale for alternatives considered.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| --- | ||||||||||
|
|
||||||||||
| > **Status**: `proposed` → Change to `published` once approved, or `deprecated`/`superseded` if no longer valid | ||||||||||
|
|
@@ -258,20 +256,22 @@ How will we validate that this decision achieved its goals? | |||||||||
|
|
||||||||||
| ### Related ADRs | ||||||||||
|
|
||||||||||
| - [ADR-001: Previous Decision](0001-previous-decision.md) - Related context | ||||||||||
| - [ADR-005: Future Decision](0005-future-decision.md) - Builds on this ADR | ||||||||||
| <!-- Replace with actual ADR links when available --> | ||||||||||
| - ADR-NNN: Previous Decision - Related context | ||||||||||
| - ADR-NNN: Future Decision - Builds on this ADR | ||||||||||
|
|
||||||||||
| ### External References | ||||||||||
|
|
||||||||||
| - [Technology/Framework Documentation](https://example.com/docs) | ||||||||||
| - [Research Paper or Article](https://example.com/research) | ||||||||||
| - [Related GitHub Issues](https://github.com/yourusername/yourrepo/issues/123) | ||||||||||
| - Technology/Framework Documentation: `https://example.com/docs` | ||||||||||
| - Research Paper or Article: `https://example.com/research` | ||||||||||
| - Related GitHub Issues: `https://github.com/org/repo/issues/NNN` | ||||||||||
|
|
||||||||||
| ### Implementation References | ||||||||||
|
|
||||||||||
| - [Implementation File](../../src/component.py) | ||||||||||
| - [Test Coverage](../../tests/test_component.py) | ||||||||||
| - [Configuration](../../config.yaml) | ||||||||||
| <!-- Replace with actual file paths when implementing --> | ||||||||||
| - Implementation File: `src/your_component.py` | ||||||||||
| - Test Coverage: `tests/test_your_component.py` | ||||||||||
| - Configuration: `config.yaml` | ||||||||||
|
|
||||||||||
| ## Questions & Discussion | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 766
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 2711
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 4755
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 313
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 104
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 54
🏁 Script executed:
# Get the full workflow file to see all test jobs cat .github/workflows/ci.ymlRepository: ByronWilliamsCPA/python-libs
Length of output: 6791
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 144
🌐 Web query:
pytest-cov --no-cov-on-fail flag documentation💡 Result:
--no-cov-on-fail is a pytest-cov CLI flag that prevents printing/generating the coverage report when the test run fails. Default: False (coverage report is shown unless you pass the flag). See the pytest-cov options reference. [1][2]
Example: pytest --cov=myproj --cov-report=term --no-cov-on-fail
Sources:
Critical issue: Missing root-level coverage threshold enforcement
The
--no-cov-on-failflag is valid and supported by pytest-cov>=4.1.0, and--cov-fail-under=0correctly allows package tests to pass without coverage requirements. However, the workflow lacks the complementary root-level or workspace-level test job that enforces the 80% coverage threshold. Per project learnings, a minimum 80% coverage requirement must be enforced by the CI/CD pipeline, but the current workflow has no such enforcement anywhere—package jobs use--cov-fail-under=0and there is no root test job to maintain coverage discipline.Add a root-level test job that runs with
--cov-fail-under=80to preserve overall coverage standards, or document why the 80% enforcement has been removed.🤖 Prompt for AI Agents