fix: fix Minimal Tests workflow for OSS repo structure#34
Merged
abhizipstack merged 2 commits intomainfrom Apr 2, 2026
Merged
Conversation
- Fix setup-python action: point cache to backend/uv.lock, run uv sync --group test from backend/ directory - Use Python 3.10 (matches pyproject.toml constraint >=3.10, <3.11.1) - Set working-directory: backend, DJANGO_SETTINGS_MODULE for tests - Run ../tests/unit with broken test dirs excluded - Remove pre-commit step (handled by pre-commit.ci) - SonarCloud: fix project key to Zipstack_visitran, continue-on-error - Fix outdated test: primary_key is now optional (APPEND mode) Verified locally: 23 passed, 0 failed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| .github/actions/setup-python/action.yaml | Fixed cache-dependency-path to backend/uv.lock and added working-directory + --group test to uv sync; structurally clean. |
| .github/workflows/core-backend-tests.yaml | Reformatted YAML (fixed indentation that was breaking the workflow), switched to Python 3.10, added working-directory defaults, DJANGO_SETTINGS_MODULE env var, and SonarCloud step pinned to @V3 with continue-on-error. |
| sonar-project.properties | Updated project key to Zipstack_visitran and corrected coverage report path to backend/coverage.xml, now consistent with coverage xml output location. |
| tests/unit/test_incremental_validation.py | Renamed test to reflect APPEND-mode behavior; test class docstring and name still say "Invalid" which is now misleading. |
Sequence Diagram
sequenceDiagram
participant GH as GitHub Actions
participant Setup as setup-python action
participant UV as uv (backend/)
participant Coverage as coverage.xml (backend/)
participant Sonar as SonarCloud
GH->>GH: checkout (shallow, depth=1)
GH->>Setup: python-version=3.10
Setup->>UV: cache backend/uv.lock
Setup->>UV: uv sync --group test (cwd: backend/)
GH->>UV: uv run coverage run ... pytest ../tests/unit (cwd: backend/)
UV-->>Coverage: writes backend/coverage.xml
GH->>GH: git fetch --unshallow (cwd: .)
GH->>Sonar: sonarcloud-github-action@v3 (projectBaseDir: ./)
Sonar->>Coverage: reads backend/coverage.xml ✓
Prompt To Fix All With AI
This is a comment left during a code review.
Path: tests/unit/test_incremental_validation.py
Line: 24-34
Comment:
**Misleading class name and docstring after behavioral change**
The class is still named `InvalidIncrementalModelNoPrimaryKey` with the docstring `"Invalid incremental model missing primary key."` — but the test now asserts that this configuration is perfectly valid (APPEND mode). This is confusing for future readers who may expect this fixture to represent a broken model. Consider renaming it to something like `IncrementalModelWithoutPrimaryKey` to match the new semantics.
```suggestion
class IncrementalModelWithoutPrimaryKey(VisitranModel):
"""Incremental model without a primary key — uses APPEND mode."""
def __init__(self):
super().__init__()
self.materialization = Materialization.INCREMENTAL
# No primary_key — incremental falls back to APPEND mode
self.delta_strategy = create_timestamp_strategy(column="updated_at")
def select(self):
return None
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: .github/workflows/core-backend-tests.yaml
Line: 57-59
Comment:
**`git fetch --unshallow` will fail on a complete repository**
`git fetch --unshallow` exits with a fatal error (`fatal: --unshallow on a complete repository does not make sense`) if the clone is already unshallow (e.g., on a `workflow_dispatch` triggered from a full clone, or if the checkout step is ever changed to `fetch-depth: 0`). Since this step has no `continue-on-error`, that failure would abort the workflow before SonarCloud runs.
A common defensive pattern is:
```suggestion
- name: Git fetch unshallow
working-directory: .
run: git fetch --unshallow || true
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "fix: address Greptile review — coverage ..." | Re-trigger Greptile
- Fix coverage report path for SonarCloud: backend/coverage.xml - Pin SonarSource/sonarcloud-github-action to v3 (was @master) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deepak-Gnanasekar
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Why
How
backend/uv.lock, runuv sync --group testfrombackend/working-directory: backend,DJANGO_SETTINGS_MODULEenv var../tests/unit, ignore broken dirs (test_logs,test_visitran_adapters,test_visitran_backend)Zipstack_visitran,continue-on-erroruntil baselinetest_invalid_model_no_primary_key→ primary_key is now optional (APPEND mode)Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
Database Migrations
Env Config
DJANGO_SETTINGS_MODULE=backend.server.settings.dev— CI workflow onlySONAR_TOKEN— already in repo secretsRelevant Docs
Related Issues or PRs
Dependencies Versions
Notes on Testing
Screenshots
N/A
Checklist
I have read and understood the Contribution Guidelines.