Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python CI

on:
push:
branches: [ main, master ]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install -e . 2>/dev/null || pip install -r requirements.txt 2>/dev/null || true
pip install pytest pytest-cov flake8 mypy
Comment on lines +23 to +24
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# First, let's check if the workflow file exists and read the relevant section
if [ -f .github/workflows/python-ci.yml ]; then
  echo "=== File exists ==="
  wc -l .github/workflows/python-ci.yml
  echo ""
  echo "=== Lines 20-30 context ==="
  sed -n '20,30p' .github/workflows/python-ci.yml
else
  echo "File not found"
fi

Repository: TeamPiped/Piped

Length of output: 619


🏁 Script executed:

# Check for dependency files in the project root
echo "=== Checking for dependency manifest files ==="
ls -la | grep -E '(pyproject\.toml|setup\.py|requirements\.txt|setup\.cfg)'

Repository: TeamPiped/Piped

Length of output: 106


🏁 Script executed:

# Also check the full file to understand the workflow structure
echo "=== Full workflow file ==="
cat .github/workflows/python-ci.yml

Repository: TeamPiped/Piped

Length of output: 1163


🏁 Script executed:

# Search for any dependency-related files that might exist elsewhere
echo "=== Searching for dependency configuration files ==="
find . -type f \( -name "setup.cfg" -o -name "tox.ini" -o -name "pyproject.toml" -o -name "setup.py" -o -name "requirements*.txt" -o -name "poetry.lock" -o -name "Pipfile" \) 2>/dev/null

Repository: TeamPiped/Piped

Length of output: 112


🏁 Script executed:

# Check if there's any Python package structure at all
echo "=== Checking for Python package structure ==="
ls -la | head -20
echo ""
echo "=== Checking for __init__.py files ==="
find . -name "__init__.py" -type f 2>/dev/null | head -10

Repository: TeamPiped/Piped

Length of output: 1335


🏁 Script executed:

# Check what languages/file types are in this project
echo "=== Checking project file types ==="
find . -type f -name "*.py" 2>/dev/null | head -20
echo ""
echo "=== Checking project structure ==="
ls -la .github/
echo ""
echo "=== Checking main content directories ==="
ls -d */ 2>/dev/null | head -10

Repository: TeamPiped/Piped

Length of output: 485


🏁 Script executed:

# Check if there's any git history that shows dependency files were removed
echo "=== Git history of dependency files ==="
git log --name-only --oneline | grep -E '(setup\.py|pyproject\.toml|requirements\.txt)' | head -20

Repository: TeamPiped/Piped

Length of output: 99


🏁 Script executed:

# Verify this is a JavaScript/TypeScript project
echo "=== Check package.json ==="
cat package.json 2>/dev/null | head -30
echo ""
echo "=== Check for TypeScript/JavaScript files ==="
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) 2>/dev/null | head -15

Repository: TeamPiped/Piped

Length of output: 1430


This Python CI workflow is entirely incompatible with this JavaScript project.

This repository contains only JavaScript/Vue.js code with a Node.js package.json file. The Python workflow at .github/workflows/python-ci.yml attempts to install Python packages and run Python linters (flake8, mypy) and test runners (pytest) on a project that has:

  • No Python source files
  • No Python dependency manifests (setup.py, pyproject.toml, or requirements.txt)
  • No Python package structure

The || true on line 23 compounds the problem by masking the inevitable dependency installation failures. Even with the proposed fix, this workflow would still fail since the project has no Python code to lint or test. The workflow should either be removed or replaced with appropriate Node.js CI tooling (eslint, prettier, vitest, etc.) that matches the actual project technologies.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/python-ci.yml around lines 23 - 24, The workflow is
installing Python deps and running Python linters/tests even though this repo is
JS-only; remove or replace the Python CI workflow by deleting the lines that run
"pip install -e . 2>/dev/null || pip install -r requirements.txt 2>/dev/null ||
true" and "pip install pytest pytest-cov flake8 mypy" (and remove the entire
python-ci YAML if you prefer) and add a Node.js CI that uses npm/yarn: run 'npm
ci' (or yarn install), run lint (eslint/prettier) and tests (vitest/jest) and
optional build steps; also remove the "|| true" masking so failures surface.
Ensure the new job steps reference npm scripts like "npm run lint" and "npm
test" (or the project's actual scripts) instead of any pip commands.

- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Type check with mypy
run: |
mypy . --ignore-missing-imports 2>/dev/null || echo "mypy not configured"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# Check if the file exists and read around line 30
if [ -f ".github/workflows/python-ci.yml" ]; then
  echo "=== File content around line 30 ==="
  sed -n '20,40p' ".github/workflows/python-ci.yml"
  echo ""
  echo "=== Full file for context ==="
  cat -n ".github/workflows/python-ci.yml"
else
  echo "File not found"
fi

Repository: TeamPiped/Piped

Length of output: 2100


🏁 Script executed:

# Check if there are any mypy configuration files in the repo
echo "=== Looking for mypy configuration files ==="
find . -maxdepth 2 -type f \( -name "mypy.ini" -o -name "pyproject.toml" -o -name "setup.cfg" -o -name "tox.ini" \) | head -20

echo ""
echo "=== Checking for mypy section in setup.cfg or pyproject.toml ==="
if [ -f "setup.cfg" ]; then
  grep -A 5 "\[mypy\]" setup.cfg || echo "No [mypy] section in setup.cfg"
fi

if [ -f "pyproject.toml" ]; then
  grep -A 5 "\[tool.mypy\]" pyproject.toml || echo "No [tool.mypy] section in pyproject.toml"
fi

Repository: TeamPiped/Piped

Length of output: 170


Type-check failures are being masked in CI.

Line 30 runs mypy . --ignore-missing-imports 2>/dev/null || echo "mypy not configured". Since mypy is explicitly installed and invoked, any real type errors cause mypy to fail with non-zero exit code, triggering the || clause. The echo command then succeeds, causing the entire step to pass despite type errors being found.

Note: The suggested fix checks for config file existence, but mypy doesn't require configuration files—it runs with defaults. The actual issue is that the || clause masks all mypy failures regardless of cause. Either remove the fallback entirely, or use proper conditional logic if mypy should truly be optional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/python-ci.yml at line 30, Remove the fallback that masks
mypy failures in the CI step that runs the command `mypy .
--ignore-missing-imports 2>/dev/null || echo "mypy not configured"` so
type-check errors cause the job to fail; either delete the `|| echo "mypy not
configured"` portion or replace the whole line with a conditional that checks
for a deliberate "skip mypy" flag before running mypy, ensuring the mypy
invocation (`mypy . --ignore-missing-imports`) is allowed to exit non-zero on
real type errors.

- name: Run tests
run: |
pytest --tb=short --cov=. --cov-report=term-missing 2>/dev/null || python -m unittest discover 2>/dev/null || echo "No test framework found"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/python-ci.yml | head -50

Repository: TeamPiped/Piped

Length of output: 1367


🏁 Script executed:

find . -type f \( -name "test_*.py" -o -name "*_test.py" -o -path "*/tests/*" \) | head -20

Repository: TeamPiped/Piped

Length of output: 41


🏁 Script executed:

find . -type f \( -name "pytest.ini" -o -name "setup.py" -o -name "pyproject.toml" -o -name "conftest.py" -o -name "tox.ini" \) 2>/dev/null

Repository: TeamPiped/Piped

Length of output: 41


🏁 Script executed:

# Check overall repository structure
ls -la

# Search for any py files that might be tests
find . -name "*.py" | head -20

Repository: TeamPiped/Piped

Length of output: 1816


🏁 Script executed:

# Check what's in the src directory
ls -la src/

# Search for any Python files in entire repo
find . -type f -name "*.py"

Repository: TeamPiped/Piped

Length of output: 705


Test step can pass even when no tests run.

On Line 33, the final || echo "No test framework found" returns success, which allows green CI with zero executed tests. Since there are no Python files in this JavaScript project, pytest and unittest discover both return nothing, and the echo fallback silently succeeds. This undermines the workflow's testing gate and masks the fact that no tests were actually executed.

The suggested fix is sound: explicitly check for pytest availability before executing rather than allowing a silent success.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/python-ci.yml at line 33, Replace the current test command
line ("pytest --tb=short --cov=. --cov-report=term-missing 2>/dev/null || python
-m unittest discover 2>/dev/null || echo \"No test framework found\"") with a
controlled check: first verify pytest exists (e.g., "command -v pytest" or
"python -m pytest --version") and run "pytest --tb=short --cov=.
--cov-report=term-missing" only if present, otherwise run "python -m unittest
discover"; if neither framework is available or if the chosen runner reports
zero tests run, exit with a non-zero status so the workflow fails instead of
silently succeeding. Ensure the replacement preserves existing flags and
redirects only error noise, but does not end with a permissive "echo" fallback.

Loading