Skip to content

chore(ci): diagnose failing checks — fix SECRET import#30

Merged
UsamaSadiq merged 4 commits into
foss-sandboxfrom
chore/ci-check-diagnosis
Jun 4, 2026
Merged

chore(ci): diagnose failing checks — fix SECRET import#30
UsamaSadiq merged 4 commits into
foss-sandboxfrom
chore/ci-check-diagnosis

Conversation

@AhtishamShahid

Copy link
Copy Markdown

Purpose

Test PR to diagnose CI failures that have been merged through on multiple PRs.

What this fixes

Adds the missing SECRET import to app.py (imported from app.users).
This resolves the ruff F821 Undefined name SECRET errors on lines 883, 893, 942.

Known remaining failures (from prior PR analysis)

Based on analysis of PRs #21#28, the following checks have been consistently failing:

1. TypeScript/JavaScript Quality (every PR)

@rocicorp/zero-sqlite3 fails to compile during pnpm install because the GitHub Actions Ubuntu runner is missing readline/readline.h (libreadline-dev).
Fix: add sudo apt-get install -y libreadline-dev as a step before pnpm install.

2. Security Scan (bandit — HIGH severity)

Three files use weak hash functions flagged as B324:

  • scrape_webpage.py:36hashlib.md5(url.encode())
  • doom_loop.py:61hashlib.sha1(...)
  • generate_image.py:257hashlib.md5(image_url.encode())

Fix: add usedforsecurity=False to each call (they're used for IDs, not security).

3. Python Backend Quality — ruff-format

ruff-format reports 2 files need reformatting.

4. Quality Gate

Always fails because it depends on the above three.

Test plan

  • Observe CI results — Python Backend Quality should now pass ruff-check
  • Confirm TypeScript/JavaScript Quality still fails (readline issue)
  • Confirm Security Scan still fails (bandit hashlib issues)

UsamaSadiq and others added 2 commits June 2, 2026 16:31
Resolves F821 ruff errors on lines 883, 893, 942 where SECRET was used
but never imported into app.py (it lives in app.users).
Copilot AI review requested due to automatic review settings June 3, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a CI lint failure in the backend by ensuring the Google OAuth secret constant used in app.py is actually imported, eliminating ruff F821 Undefined name SECRET errors.

Changes:

  • Add missing SECRET import from app.users in surfsense_backend/app/app.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 45 to 49
from app.users import (
SECRET,
auth_backend,
current_active_user,
fastapi_users,
- ruff-format: reformat surfsense_backend/app/app.py (trailing newline
  after the new SECRET import)
- biome check --write: fix import ordering and formatting violations
  across 28 files in surfsense_web/ (atoms, components/ui, components/
  tool-ui, lib/apis, svgr.d.ts) — these pre-existing issues caused the
  TypeScript/JavaScript Quality check to fail on every PR
@rocicorp/zero-sqlite3 requires readline/readline.h to compile its
native extension. The GitHub Actions Ubuntu runner doesn't include
libreadline-dev by default, causing pnpm install to fail with a gyp
build error before biome can even run.
@UsamaSadiq UsamaSadiq changed the base branch from foss-main to foss-sandbox June 4, 2026 12:19
@UsamaSadiq UsamaSadiq merged commit 21a6794 into foss-sandbox Jun 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants