Skip to content

Enhance CI pipeline and fix duplicate code false-positives - #152

Draft
NITISH-R-G wants to merge 2 commits into
mainfrom
ci-pipeline-improvements-18021403520543559634
Draft

Enhance CI pipeline and fix duplicate code false-positives#152
NITISH-R-G wants to merge 2 commits into
mainfrom
ci-pipeline-improvements-18021403520543559634

Conversation

@NITISH-R-G

@NITISH-R-G NITISH-R-G commented Jul 27, 2026

Copy link
Copy Markdown
Owner

This commit enhances the CI pipeline by unifying server-side validation with local checks. It integrates bandit and openenv validate into GitHub Actions, ensuring zero SAST vulnerabilities are merged. It also pins jscpd to avoid false positives, ignores static analysis cache directories, explicitly lists necessary dev dependencies in pyproject.toml, and creates the CYCLE_8_REPORT.md.


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

Summary by Sourcery

Enhance the code quality CI pipeline with additional security and env validation checks while tightening duplicate code detection and dev tooling configuration.

New Features:

  • Add Bandit SAST and OpenEnv validation steps to the GitHub Actions code-quality workflow.
  • Introduce a Cycle 8 repository health and CI improvements report document.

Bug Fixes:

  • Pin jscpd to a stable version and update ignore patterns to avoid false-positive duplicate code detections on build artifacts.
  • Suppress Gradio click handler type-checking issues with explicit mypy ignore annotations.

Enhancements:

  • Ensure CI installs security and typing tools (bandit, openenv-core, mypy) via pip and declares mypy and bandit in dev dependencies.
  • Document repository health, CI gaps, and planned improvements in CYCLE_8_REPORT.md.

- Added `bandit` and `openenv-core` to `.github/workflows/code-quality.yml`.
- Pinned `jscpd` to version `4.0.0` and updated the ignore pattern.
- Ignored `.mypy_cache/` and `.ruff_cache/` in `.gitignore`.
- Added `mypy` and `bandit` to the `dev` dependencies in `pyproject.toml`.
- Documented changes in `CYCLE_8_REPORT.md`.
- Suppressed `mypy` false positives for Gradio `click` methods in `viz/gradio_demo.py`.

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.

@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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Jul 27, 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: e8566091-5d83-4856-a55a-b53e7af8459c

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 ci-pipeline-improvements-18021403520543559634

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.

@sourcery-ai

sourcery-ai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

Enhances the CI code-quality workflow to align server-side validation with local checks, hardens static analysis and security scanning, stabilizes duplicate-code detection, and tweaks the demo to satisfy type checking while documenting the changes in a new cycle report.

Flow diagram for updated CI code-quality workflow

flowchart TD
  A[Push or PR to main] --> B[GitHub Actions code-quality job]
  B --> C[Install Python tools
ruff, mypy, pydantic,
vulture, radon, bandit,
openenv-core]
  C --> D[Run mypy]
  D --> E[Run bandit -r . -c pyproject.toml]
  E --> F[Run openenv validate .]
  F --> G[Run pytest]
  G --> H[Install jscpd@4.0.0]
  H --> I[Run jscpd .
--ignore dist/, build/,
venv/.venv]
  I --> J[Report CI status]
Loading

File-Level Changes

Change Details Files
Align CI workflow with local validation by adding security and env validation tools and stabilizing duplicate-code detection.
  • Extend Python dependencies installed in the CI workflow to include bandit and openenv-core
  • Add a Bandit security scan step configured via pyproject.toml
  • Add an OpenEnv validation step that runs openenv validate .
  • Pin jscpd to version 4.0.0 in the Node-based job
  • Extend jscpd ignore patterns to skip dist and build directories in addition to existing exclusions
.github/workflows/code-quality.yml
Make Gradio demo callbacks compatible with stricter type checking.
  • Annotate gradio click handler registrations with # type: ignore[attr-defined] to satisfy mypy for dynamically-added attributes on UI components
viz/gradio_demo.py
Ensure dev tooling is explicitly installable via project metadata.
  • Add mypy and bandit to the dev extra in pyproject.toml so they are installed with pip install -e ".[dev]"
pyproject.toml
Document CI and repo health changes for cycle 8.
  • Add a new cycle report summarizing CI/DevOps changes, identified risks, and planned improvements including bandit/openenv integration, jscpd pinning, and cache ignores
CYCLE_8_REPORT.md

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

The recent upgrade of `ruff` to 0.16.0 introduced many new linting rules that caused the CI to fail with thousands of errors, while local runs with an older `ruff` version passed. Pinning `ruff` to `<0.16.0` ensures the CI environment matches the stable local environment and passes without needing a full-codebase refactor for the new rules at this time.

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

@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.

Your trial has ended. Reactivate Greptile to resume code reviews.

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