Skip to content

chore: improve CI pipeline in .github/workflows/code-quality.yml#91

Draft
NITISH-R-G wants to merge 1 commit into
mainfrom
fix-ci-code-quality-1738601844328498335
Draft

chore: improve CI pipeline in .github/workflows/code-quality.yml#91
NITISH-R-G wants to merge 1 commit into
mainfrom
fix-ci-code-quality-1738601844328498335

Conversation

@NITISH-R-G

@NITISH-R-G NITISH-R-G commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Improve CI pipeline in .github/workflows/code-quality.yml according to rules stored in memory and Sprint requirements. This ensures the CI runs properly without false positives and covers all necessary tests and lints!


PR created automatically by Jules for task 1738601844328498335 started by @NITISH-R-G

Summary by Sourcery

Enhance the code-quality CI workflow to improve reliability and expand static analysis and validation coverage.

CI:

  • Harden Git LFS setup in the code-quality workflow to avoid hook-related issues and ensure assets are pulled correctly.
  • Expand backend code-quality checks by adding Bandit SAST scanning, OpenEnv validation, and required Python dependencies.
  • Adjust pytest invocation in CI to include the project root in PYTHONPATH for correct module resolution.
  • Pin the jscpd version and refine duplicate-code ignore patterns to exclude additional build artefact directories in frontend-quality.

- Configure proper path to Git hooks for Git LFS to resolve testing errors (gzip.BadGzipFile)
- Add Bandit SAST for security linting
- Add OpenEnv verification step
- Add `PYTHONPATH=.` prefix to pytest running step to resolve module finding errors
- Pin `jscpd` to `4.0.0` and skip compiling directories (`dist/` and `build/`) for more accurate codebase duplication detection

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4b62201c-c2ef-4642-b79a-348aa33df66a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-ci-code-quality-1738601844328498335

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot 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.

NITISH-R-G has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@sourcery-ai

sourcery-ai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR tightens the code-quality CI workflow by hardening Git LFS setup, expanding Python/static analysis tooling (Bandit, OpenEnv), ensuring tests run with the correct PYTHONPATH, and pinning/adjusting frontend duplicate-code detection via jscpd.

Flow diagram for updated backend code-quality CI job

flowchart TD
  A[Checkout and setup python] --> B[Pull Git LFS objects
 git lfs install
 git config core.hookspath
 git lfs update --force
 git lfs pull]
  B --> C[Install python dependencies
 ruff mypy pydantic vulture radon bandit openenv-core]
  C --> D[Ruff lint and format]
  D --> E[Mypy type checking]
  E --> F[Bandit SAST scan
 bandit -r . -c pyproject.toml]
  F --> G[Vulture dead code detection]
  G --> H[Radon complexity analysis]
  H --> I[Pytest validation
 PYTHONPATH=. python -m pytest]
  I --> J[OpenEnv validate
 openenv validate .]
Loading

Flow diagram for updated frontend duplicate-code detection

flowchart TD
  A[Checkout and setup node] --> B[Install jscpd version 4.0.0]
  B --> C[Run jscpd duplicate-code check
 ignore json md yaml yml package-lock node_modules venv .venv dist build
 threshold 5]
Loading

File-Level Changes

Change Details Files
Harden Git LFS setup in the backend-quality job to avoid missing LFS objects and misconfigured hooks.
  • Replace a single git lfs pull command with a multi-step script that installs Git LFS, points core.hookspath to .git/hooks, forces an LFS update, and then pulls objects
.github/workflows/code-quality.yml
Expand and adjust backend-quality tooling to cover security scanning, environment validation, and correct test module resolution.
  • Add bandit and openenv-core to the Python dependencies install step
  • Introduce a Bandit SAST job step that scans the repository using pyproject.toml configuration
  • Add an OpenEnv validation step that runs openenv validate . after tests
  • Modify the pytest step to set PYTHONPATH=. before running tests to ensure proper package discovery
.github/workflows/code-quality.yml
Tighten frontend duplicate-code analysis by pinning jscpd version and expanding ignore patterns to avoid noise from build artifacts.
  • Pin global jscpd installation to version 4.0.0 instead of the latest
  • Extend jscpd ignore glob to include dist and build directories in addition to existing exclusions
.github/workflows/code-quality.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

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.

1 participant