Skip to content

feat: add robyn-config as optional dependencies#1387

Open
Lehsqa wants to merge 1 commit into
sparckles:mainfrom
Lehsqa:feature/robin-config-depends
Open

feat: add robyn-config as optional dependencies#1387
Lehsqa wants to merge 1 commit into
sparckles:mainfrom
Lehsqa:feature/robin-config-depends

Conversation

@Lehsqa
Copy link
Copy Markdown

@Lehsqa Lehsqa commented May 9, 2026

Description

This PR adds robyn-config as an optional dependency to the Robyn framework, along with documentation and integration tests.

Summary

  • Adds robyn-config >= 1.0.0, < 2.0.0 as an optional dependency group in pyproject.toml
  • Includes robyn-config in the "all" extras group
  • Documents robyn-config in the plugins page (docs/en/plugins.mdx) with both standalone (pip install robyn-config) and optional dependency (pip install robyn[robyn-config]) installation methods
  • Updates the installation guide (docs/en/api_reference/index.mdx) to list all available optional dependencies: robyn[templating], robyn[pydantic], robyn[robyn-config], and robyn[all]
  • Adds 10 integration tests covering CLI accessibility, project scaffolding (DDD/MVC × SQLAlchemy/Tortoise), admin panel generation, and monitoring pipeline setup

PR Checklist

Please ensure that:

  • The PR contains a descriptive title
  • The PR contains a descriptive summary of the changes
  • You build and test your changes before submitting a PR.
  • You have added relevant documentation
  • You have added relevant tests. We prefer integration tests wherever possible

Pre-Commit Instructions:

Summary by CodeRabbit

  • Documentation

    • Added optional pip install forms for Robyn extensions and a new Robyn Config plugin guide with CLI usage, scaffolding, admin panel, and monitoring examples.
  • Tests

    • Added integration tests verifying the Robyn Config CLI and end-to-end scaffolding flows (project creation, admin panel, monitoring).
  • Chores

    • Packaging updated to expose an optional Robyn Config dependency and include it in the consolidated "all" extra.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
robyn Error Error May 9, 2026 10:37pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e998031-ad31-4994-8360-d1eb2a7678e4

📥 Commits

Reviewing files that changed from the base of the PR and between 30b359d and 621be80.

📒 Files selected for processing (4)
  • docs_src/src/pages/documentation/en/api_reference/index.mdx
  • docs_src/src/pages/documentation/en/plugins.mdx
  • integration_tests/test_robyn_config.py
  • pyproject.toml
✅ Files skipped from review due to trivial changes (2)
  • docs_src/src/pages/documentation/en/plugins.mdx
  • docs_src/src/pages/documentation/en/api_reference/index.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • pyproject.toml
  • integration_tests/test_robyn_config.py

📝 Walkthrough

Walkthrough

Declares robyn-config as an optional dependency, documents its CLI and install options, and adds integration tests that validate CLI availability, project scaffolding, adminpanel creation, and monitoring scaffolding.

Changes

Robyn Config CLI Plugin

Layer / File(s) Summary
Dependency Declaration
pyproject.toml
Adds optional dependency robyn-config >= 1.0.0, < 2.0.0 and includes it in the all extra; mirrors change in Poetry sections.
User Documentation
docs_src/src/pages/documentation/en/plugins.mdx, docs_src/src/pages/documentation/en/api_reference/index.mdx
Adds "Robyn Config" plugin docs with install instructions (including optional extra) and CLI usage examples; updates API reference pip snippets to list extras including robyn[robyn-config].
Integration Tests
integration_tests/test_robyn_config.py
Adds tests that skip if CLI missing, assert help commands exit 0, run parametrized create scaffolds, verify generated artifacts, test adminpanel (default and custom creds), and test monitoring scaffolding.

Sequence Diagram(s)

sequenceDiagram
  participant TestRunner
  participant CLI as robyn-config
  participant FS as Filesystem
  TestRunner->>CLI: --help / create --help / add --help
  CLI-->>TestRunner: exit 0, usage
  TestRunner->>FS: create temp dir
  TestRunner->>CLI: create scaffold (design, orm)
  CLI-->>FS: generate pyproject.toml, src/, Makefile
  TestRunner->>CLI: adminpanel, monitoring commands
  CLI-->>FS: generate adminpanel dir, docker-compose.monitoring.yml, compose/monitoring/*
  TestRunner->>FS: assert files exist and cleanup
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through docs and tests today,

scaffolds and panels in tidy array,
A config CLI joins the run,
With files created, our work is done,
Tiny paws applaud the play.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding robyn-config as optional dependencies with clear, concise phrasing.
Description check ✅ Passed The description follows the template with all required sections completed: descriptive title, comprehensive summary, completed PR checklist, and pre-commit confirmation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pyproject.toml (2)

78-88: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Add robyn-config to Poetry dependencies.

The PEP 621 [project.optional-dependencies] section includes robyn-config, but the corresponding Poetry [tool.poetry.dependencies] section does not declare it as an optional dependency. This creates an inconsistency between installation methods.

🔧 Proposed fix
 [tool.poetry.dependencies]
 python = "^3.10"
 inquirerpy = "0.3.4"
 maturin = "1.7.4"
 watchdog = "^6.0.0"
 multiprocess = "^0.70.18"
 uvloop = { version = "0.22.1", markers = "sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')" }
 jinja2 = { version = "^3.1.6", optional = true }
 pydantic = { version = "^2.0.0", optional = true }
+robyn-config = { version = "^1.0.0", optional = true }
 rustimport = "^1.3.4"
 orjson = "^3.11.5"
🤖 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 `@pyproject.toml` around lines 78 - 88, The pyproject.toml is inconsistent: the
PEP 621 [project.optional-dependencies] lists robyn-config but
[tool.poetry.dependencies] does not declare it as optional; add an entry for
robyn-config under [tool.poetry.dependencies] (e.g. robyn-config = { version =
"<same-version-as-in-[project.optional-dependencies]>", optional = true }) so
Poetry knows it is an optional dependency and the versions match between the two
sections.

90-93: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Update Poetry extras to include robyn-config.

The PEP 621 [project.optional-dependencies] section's "all" extra includes robyn-config (line 41), but the Poetry [tool.poetry.extras] section does not. Users installing via pip install robyn[all] will get robyn-config, while those using Poetry with the all extra will not.

🔧 Proposed fix
 [tool.poetry.extras]
 templating = ["jinja2"]
 pydantic = ["pydantic"]
-all = ["jinja2", "pydantic"]
+robyn-config = ["robyn-config"]
+all = ["jinja2", "pydantic", "robyn-config"]
🤖 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 `@pyproject.toml` around lines 90 - 93, The Poetry extras block
([tool.poetry.extras]) is missing the robyn-config package in the "all" extra;
update the "all" list to include "robyn-config" and optionally add a dedicated
extra key "robyn-config" = ["robyn-config"] so Poetry users get the same
optional dependency set as the PEP 621 [project.optional-dependencies]
configuration; edit the existing keys templating, pydantic and all to include
the robyn-config entry (e.g., add "robyn-config" to the all array and add a new
robyn-config extra if you want a named extra).
🧹 Nitpick comments (2)
integration_tests/test_robyn_config.py (2)

52-70: ⚖️ Poor tradeoff

Consider parameterizing the scaffolded_project fixture.

The scaffolded_project fixture always creates a DDD project with SQLAlchemy (line 64), which means the adminpanel and monitoring tests only validate one configuration. Consider making this fixture parameterized or creating separate fixtures for different design patterns to ensure broader test coverage.

This is especially relevant since test_create_project_scaffold tests all design×ORM combinations (lines 72-89), but subsequent tests don't.

🤖 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 `@integration_tests/test_robyn_config.py` around lines 52 - 70, The
scaffolded_project fixture is hard-coded to ("ddd","sqlalchemy"); change it to
be parameterized so tests run against multiple design×ORM combos: convert
scaffolded_project to accept a pytest request (or use
`@pytest.fixture`(params=[("ddd","sqlalchemy"), ("layered","tortoise"), ...])) and
build the subprocess.run args from request.param (e.g., design, orm) when
invoking "robyn-config create"; alternatively add distinct fixtures (e.g.,
scaffolded_project_ddd_sqlalchemy, scaffolded_project_layered_tortoise) that run
subprocess.run with the desired design/orm combinations and update tests that
use scaffolded_project to either use the parametrized fixture or the new named
fixtures.

91-116: ⚖️ Poor tradeoff

Add adminpanel tests for MVC design pattern.

The scaffolded_project fixture hardcodes --design ddd (line 64), so the adminpanel tests (lines 102, 115) never validate MVC projects. Since MVC is a documented design pattern (as shown in test_create_project_scaffold at line 72), consider parameterizing the adminpanel tests to cover both design patterns, or document why only DDD is tested.

🤖 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 `@integration_tests/test_robyn_config.py` around lines 91 - 116, The adminpanel
tests (test_adminpanel_scaffolding and test_adminpanel_with_custom_credentials)
only exercise the scaffolded_project fixture which currently hardcodes "--design
ddd", so they never validate MVC projects; update the tests to cover both
designs by either parameterizing these two tests with pytest.mark.parametrize
over designs ["ddd","mvc"] and invoking the scaffold creation with the design
parameter, or modify/extend the scaffolded_project fixture to accept a design
argument (or add a separate mvc_scaffolded_project fixture) and run the same
assertions for both designs; refer to scaffolded_project,
test_adminpanel_scaffolding, test_adminpanel_with_custom_credentials and
test_create_project_scaffold to implement the parameterization or fixture
change.
🤖 Prompt for all review comments with 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.

Inline comments:
In `@docs_src/src/pages/documentation/en/plugins.mdx`:
- Around line 48-60: Update the CLI examples to match the actual robyn-config
signatures: for the create example include the required destination directory
argument (use the form "robyn-config create my_project destination_dir --design
ddd --orm sqlalchemy"), and ensure the other commands include the target project
directory argument as required by the implementation—i.e., change "robyn-config
add users", "robyn-config adminpanel", and "robyn-config monitoring" to include
the project directory parameter (e.g., "robyn-config add users <project_dir>",
"robyn-config adminpanel <project_dir>", "robyn-config monitoring
<project_dir>") so the examples align with the robyn-config
create/adminpanel/monitoring/add command signatures.

In `@integration_tests/test_robyn_config.py`:
- Around line 74-89: The test test_create_project_scaffold assumes the
robyn-config CLI supports a positional target directory (it calls subprocess.run
with ["robyn-config", "create", project_name, temp_dir, "--design", design,
"--orm", orm]) and expects created files directly in temp_dir; confirm whether
the CLI command handler for "create" accepts a second positional argument for
destination and whether implementation places files in destination vs
destination/project_name; if the CLI does not accept that positional arg or
places files under destination/project_name, either update the CLI handler to
accept and write into the provided directory or change the test to call the
documented signature (e.g., ["robyn-config", "create", project_name, "--design",
design, "--orm", orm]) and assert files exist under temp_dir/project_name, and
update docs_src/src/pages/documentation/en/plugins.mdx to match the chosen
behavior.

---

Outside diff comments:
In `@pyproject.toml`:
- Around line 78-88: The pyproject.toml is inconsistent: the PEP 621
[project.optional-dependencies] lists robyn-config but
[tool.poetry.dependencies] does not declare it as optional; add an entry for
robyn-config under [tool.poetry.dependencies] (e.g. robyn-config = { version =
"<same-version-as-in-[project.optional-dependencies]>", optional = true }) so
Poetry knows it is an optional dependency and the versions match between the two
sections.
- Around line 90-93: The Poetry extras block ([tool.poetry.extras]) is missing
the robyn-config package in the "all" extra; update the "all" list to include
"robyn-config" and optionally add a dedicated extra key "robyn-config" =
["robyn-config"] so Poetry users get the same optional dependency set as the PEP
621 [project.optional-dependencies] configuration; edit the existing keys
templating, pydantic and all to include the robyn-config entry (e.g., add
"robyn-config" to the all array and add a new robyn-config extra if you want a
named extra).

---

Nitpick comments:
In `@integration_tests/test_robyn_config.py`:
- Around line 52-70: The scaffolded_project fixture is hard-coded to
("ddd","sqlalchemy"); change it to be parameterized so tests run against
multiple design×ORM combos: convert scaffolded_project to accept a pytest
request (or use `@pytest.fixture`(params=[("ddd","sqlalchemy"),
("layered","tortoise"), ...])) and build the subprocess.run args from
request.param (e.g., design, orm) when invoking "robyn-config create";
alternatively add distinct fixtures (e.g., scaffolded_project_ddd_sqlalchemy,
scaffolded_project_layered_tortoise) that run subprocess.run with the desired
design/orm combinations and update tests that use scaffolded_project to either
use the parametrized fixture or the new named fixtures.
- Around line 91-116: The adminpanel tests (test_adminpanel_scaffolding and
test_adminpanel_with_custom_credentials) only exercise the scaffolded_project
fixture which currently hardcodes "--design ddd", so they never validate MVC
projects; update the tests to cover both designs by either parameterizing these
two tests with pytest.mark.parametrize over designs ["ddd","mvc"] and invoking
the scaffold creation with the design parameter, or modify/extend the
scaffolded_project fixture to accept a design argument (or add a separate
mvc_scaffolded_project fixture) and run the same assertions for both designs;
refer to scaffolded_project, test_adminpanel_scaffolding,
test_adminpanel_with_custom_credentials and test_create_project_scaffold to
implement the parameterization or fixture change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58b15882-1243-4fb2-950c-d57ce7e70451

📥 Commits

Reviewing files that changed from the base of the PR and between d19b67f and 0e35e28.

📒 Files selected for processing (4)
  • docs_src/src/pages/documentation/en/api_reference/index.mdx
  • docs_src/src/pages/documentation/en/plugins.mdx
  • integration_tests/test_robyn_config.py
  • pyproject.toml

Comment thread docs_src/src/pages/documentation/en/plugins.mdx
Comment thread integration_tests/test_robyn_config.py
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