Skip to content

ci: Use AlphaSphereDotAI's helpr action#472

Draft
MH0386 wants to merge 26 commits into
devenvfrom
ci-helpr
Draft

ci: Use AlphaSphereDotAI's helpr action#472
MH0386 wants to merge 26 commits into
devenvfrom
ci-helpr

Conversation

@MH0386

@MH0386 MH0386 commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Add Nix-based development environment configuration and integrate automated helpr-based CI checks.

New Features:

  • Introduce a Nix devenv configuration with Python, UV, OpenCV, and helper scripts for building the web frontend, running compatibility checks, and starting the dev server.

Enhancements:

  • Configure extensive git hooks and linting/formatting tooling (ruff, yamllint, prettier, secrets checks, etc.) via the Nix devenv setup.

CI:

  • Add a GitHub Actions workflow using the AlphaSphereDotAI helpr action to run linting via pre-commit on pushes and pull requests.

Chores:

  • Add devenv metadata files (lockfile, YAML config, and envrc) and update ignore rules to support the new development environment.

@semanticdiff-com

semanticdiff-com Bot commented Jan 17, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/ci.yaml  0% smaller
  devenv.nix Unsupported file format

@gitnotebooks

gitnotebooks Bot commented Jan 17, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

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.

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci-helpr

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 and usage tips.

@sourcery-ai

sourcery-ai Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Sets up a Nix-based development environment and CI workflow using AlphaSphereDotAI's helpr GitHub Action, including Python tooling, linting, and extensive pre-commit style checks.

Sequence diagram for helpr GitHub Action workflow on push or pull request

sequenceDiagram
  actor Dev as Developer
  participant GR as GitHub_repo
  participant GH as GitHub_Actions
  participant WF as helpr_workflow
  participant HA as helpr_action

  Dev->>GR: git push / open pull_request
  GR-->>GH: push_or_pull_request_event
  GH->>WF: start_helpr_workflow
  WF->>HA: run_helpr_action(is_test=true, lint=true, linter=pre-commit)
  HA->>HA: setup_environment
  HA->>HA: run_pre_commit_linters
  HA-->>WF: report_lint_results
  WF-->>GH: job_status_success_or_failure
  GH-->>Dev: expose_CI_status_on_commit_PR
Loading

File-Level Changes

Change Details Files
Introduce a Nix/devenv-based local development environment with Python, UV, OpenCV, and helper scripts.
  • Add devenv.nix configuring Python 3.10 with uv, virtualenv support, OpenCV package, and environment variables including LD_LIBRARY_PATH.
  • Define reusable scripts for building the Reflex web frontend, running compatibility checks with uv, and starting the development server.
  • Configure enterShell and enterTest hooks to verify git is available and print its version.
devenv.nix
Add development tooling configuration and lockfiles for devenv.
  • Add devenv.yaml to declare Nix inputs (nixpkgs, nixpkgs-python, treefmt-nix) and allow future extension via imports.
  • Introduce devenv.lock and .envrc placeholders to integrate with direnv/devenv for automatic environment activation.
devenv.yaml
devenv.lock
.envrc
Enable extensive git hooks and linting via devenv for code quality and security.
  • Configure a wide set of git-hooks in devenv.nix including formatters, security scanners, language linters, and dead code checkers.
  • Add a custom ensure-tag-matches-version hook that checks uv-reported version matches the nearest git tag on pre-commit and pre-push.
devenv.nix
Add CI workflow using AlphaSphereDotAI helpr GitHub Action.
  • Create a helpr GitHub Actions workflow triggered on push and pull_request.
  • Configure the helpr job to run helpr_action with test mode enabled and pre-commit-based linting.
.github/workflows/helpr.yaml

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @MH0386, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the project's development environment by integrating devenv. This change provides a consistent and reproducible setup across all developer machines, automating dependency management, standardizing code quality checks with tools like Ruff and Yamllint, and enforcing best practices through a robust suite of Git hooks. The new configuration also includes predefined scripts to streamline common development workflows.

Highlights

  • devenv Integration: Introduces devenv for a declarative and reproducible development environment, including direnv integration via .envrc for automatic environment loading.
  • Tooling Configuration: Establishes consistent configurations for code quality tools like ruff (for Python linting and formatting) and yamllint (for YAML linting) through devenv.nix.
  • Automated Git Hooks: Implements a comprehensive set of Git hooks (e.g., actionlint, nixfmt, ruff, trufflehog, uv-check) to enforce code standards and security checks automatically during development.
  • Dependency Management: Locks devenv dependencies in devenv.lock and defines external Nix flake inputs in devenv.yaml for precise and reproducible version control of the development environment's components.
  • Development Scripts: Defines devenv scripts for common development tasks such as building the web frontend, checking compatibility, and starting the development server, streamlining workflows.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/helpr.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@deepsource-io

deepsource-io Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Here's the code health analysis summary for commits ad75259..8bf328a. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a Nix-based development environment using devenv, which is a great step towards reproducible builds and a consistent developer experience. The configuration includes Python, various development tools, and an extensive set of git hooks for linting and formatting. My review focuses on the new devenv.nix configuration file. I've found a few issues: a mismatch in the configured Python version for ruff, an incorrect option name for a git hook, and a critical logic error in a custom git hook script. The provided suggestions aim to fix these issues to ensure the development environment works as intended.

Comment thread devenv.nix Outdated
Comment on lines +169 to +177
entry = ''
UV_VERSION=$(uv version --short 2>/dev/null)
NEAREST_TAG=$(git describe --tags --match "*.*.*" --abbrev=0 2>/dev/null)
if [ "$UV_VERSION" != "$NEAREST_TAG" ]; then
echo "Error: UV version ($UV_VERSION) does not match nearest tag ($NEAREST_TAG)"
exit 1
fi
exit 0
'';

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.

critical

The custom git hook ensure-tag-matches-version has incorrect logic. It compares the version of the uv tool with the nearest git tag, but the intention is likely to compare the project's version from pyproject.toml.

Additionally, running this check on pre-commit might disrupt the development workflow. A version is typically bumped in a commit, and then that commit is tagged. This hook would cause such a commit to fail. You might want to reconsider the stages for this hook, for example by only running it in CI when a tag is pushed.

Here is a suggested implementation for the script that correctly checks the project version and is more robust:

      entry = ''
        set -e
        PROJECT_VERSION=$(grep '^version = ' pyproject.toml | sed -e 's/version = "//' -e 's/"//')
        NEAREST_TAG=$(git describe --tags --match "*.*.*" --abbrev=0 2>/dev/null || true)

        if [ -n "$NEAREST_TAG" ] && [ "$PROJECT_VERSION" != "${NEAREST_TAG#v}" ]; then
          echo "Error: Project version ($PROJECT_VERSION) in pyproject.toml does not match nearest tag ($NEAREST_TAG)."
          exit 1
        fi
      '';

Comment thread devenv.nix
};
};
".ruff.toml".toml = {
target-version = "py313";

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.

high

The ruff configuration specifies target-version = "py313", but the project is configured to use Python 3.10 (in this file on line 77 and in pyproject.toml). This mismatch can cause ruff to suggest or apply changes that are incompatible with Python 3.10. Please align the target-version with the project's Python version.

      target-version = "py310";

Comment thread devenv.nix Outdated
ensure-tag-matches-version = {
name = "Ensure Tag Matches Version";
enable = true;
file = "pyproject.toml";

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.

high

The pre-commit-hooks.nix integration uses the option files (plural) to specify a regex for files the hook should run on. You are using file (singular), which will be ignored. This means the hook will not be limited to running on pyproject.toml changes as intended. Please correct the option name to files. Note that the value should be a valid regex.

      files = "pyproject\\.toml";

@mergify

mergify Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

🧪 CI Insights

Here's what we observed from your CI run for 8bf328a.

🟢 All jobs passed!

But CI Insights is watching 👀

Comment thread .github/workflows/helpr.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
@mergify

mergify Bot commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Hi @MH0386, Your PR is in conflict and cannot be merged.

@sonarqubecloud

Copy link
Copy Markdown

@openhands-ai

openhands-ai Bot commented Jan 18, 2026

Copy link
Copy Markdown

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Test
    • CI

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #472 at branch `ci-helpr`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

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.

2 participants