Skip to content

chore: refactor CI workflow and add test coverage for Oumi and MCP server#16

Merged
crypticsaiyan merged 1 commit into
devfrom
chore/cleanup
Dec 14, 2025
Merged

chore: refactor CI workflow and add test coverage for Oumi and MCP server#16
crypticsaiyan merged 1 commit into
devfrom
chore/cleanup

Conversation

@crypticsaiyan

@crypticsaiyan crypticsaiyan commented Dec 14, 2025

Copy link
Copy Markdown
Owner

Description

Add comprehensive unit tests for core services, cleanup unused files, and fix bugs to improve code quality and maintainability.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Configuration change
  • ♻️ Refactor (no functional changes)
  • 🏗️ Infrastructure/IaC change

Changes Made

  • Add unit tests for Oumi serve API (29 tests)
  • Add unit tests for training data generator (43 tests)
  • Add JS tests for Kestra utilities
  • Add MCP server integration test
  • Fix missing json import in training data generator
  • Update license from Apache-2.0 to MIT
  • Remove unused compute_reward and simulate_load scripts
  • Remove redundant test files and empty placeholder directories
  • Update CI workflow to run actual tests
  • Add requirements.txt for Python dependencies

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • IaC validation (terraform validate) passes

Test Evidence

============================== 72 passed in 5.33s ==============================

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally
  • Any dependent changes have been merged and published

CodeRabbit Review

  • I have addressed all CodeRabbit suggestions
  • Critical security/performance issues resolved
  • IaC best practices followed (for infrastructure changes)

This PR will be automatically reviewed by CodeRabbit 🐰

Summary by CodeRabbit

  • Documentation

    • Rebranded project from CloudGenesis to InFoundry throughout documentation
    • Added comprehensive Quick Start guide with installation and run instructions
    • Updated architecture and contributing documentation with new workflow details
  • Chores

    • Changed project license from Apache 2.0 to MIT
    • Restructured CI/CD pipeline with dedicated Python tests, MCP server build, and UI lint jobs
    • Removed placeholder services and example datasets
    • Added Python testing framework with pytest integration

✏️ Tip: You can customize this high-level summary in your review settings.

Tests:
- Add unit tests for oumi/serve.py and generate_training_data.py (72 tests)
- Add JS tests for ui/lib/kestra.js
- Add MCP server integration test

Fixes:
- Add missing `import json` in oumi/generate_training_data.py
- Update license to MIT

Cleanup:
- Remove redundant test files and unused scripts
- Remove compute_reward.py and simulate_load.py
- Update CI workflow to run actual tests
- Add requirements.txt
@coderabbitai

coderabbitai Bot commented Dec 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR rebrand the project from CloudGenesis to InFoundry, restructures CI/CD workflows to build MCP server and lint UI separately, updates licensing to MIT, removes placeholder microservices, adds comprehensive test coverage, and rewrites documentation with concrete setup instructions and architecture details.

Changes

Cohort / File(s) Summary
Documentation & Branding Overhaul
README.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, docs/architecture.md, docs/runlocally.md, ui/README.md, infoundry-mcp-server/README.md
Renamed project references from CloudGenesis to InFoundry across all docs; expanded README with Features section, Quick Start, and project structure; rewrote runlocally guide with structured sections for UI, Oumi, MCP, and tests; updated architecture documentation with detailed system overview and Kestra workflow; revised CODE_OF_CONDUCT enforcement process and CONTRIBUTING guidelines with updated development steps.
License & Package Metadata Updates
LICENSE, infoundry-mcp-server/package.json
Changed license from Apache-2.0 to MIT across project and MCP server package.
Build Configuration
.gitignore, requirements.txt
Added Python venv, log, IDE, coverage, and compiled artifact patterns to .gitignore; created requirements.txt with FastAPI, Uvicorn, Pydantic, Pytest, and optional Oumi dependencies.
CI/CD Workflow Restructuring
.github/workflows/ci.yml
Renamed test job to test-python with pytest on tests/; added new test-mcp-server job for Node.js 20 MCP build; added lint-ui job for Node.js 20 UI linting.
Placeholder Service Removal
services/auth/app.py, services/auth/Dockerfile, services/payments/app.py, services/payments/Dockerfile
Removed entire FastAPI microservices (auth and payments) including endpoints, Docker containers, and FastAPI app initialization.
Utility Scripts & Tests Cleanup
scripts/compute_reward.py, scripts/simulate_load.py, infoundry-mcp-server/test.mjs
Deleted reward calculation function, load simulation generator, and standalone MCP test script.
Infrastructure Directory Placeholders
infra/.gitkeep, infra/modules/.gitkeep, infra/templates/.gitkeep, tests/.gitkeep
Removed .gitkeep placeholder files from infrastructure and test directories.
New Test Suite
tests/test_generate_training_data.py, tests/test_kestra.js, tests/test_mcp_server.mjs, tests/test_oumi_serve.py
Added comprehensive unit tests for training data generation (pattern/component/rationale/example functions), Kestra pipeline progress mapping and duration calculations, MCP server integration, and Oumi FastAPI endpoints (heuristic response, health, chat completions).
Source Code Updates
oumi/generate_training_data.py
Added import json to support JSON handling in training data generation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

Areas requiring extra attention:

  • Test files — Verify test coverage is sufficient and assertions are correctly validating expected behavior (especially test_oumi_serve.py endpoint mocking and test_kestra.js state mapping logic)
  • Removed services — Confirm no other code depends on the deleted auth/payments microservices and that removal aligns with project architecture goals
  • CI/CD workflow — Review the new MCP server build and UI lint job configurations for correct Node.js version, dependency paths, and error handling

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring the CI workflow and adding test coverage for Oumi and MCP server. It's specific, clear, and directly reflects the primary work in the changeset.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/cleanup

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

@github-actions

github-actions Bot commented Dec 14, 2025

Copy link
Copy Markdown

🐰 CodeRabbit Review Reminder

This PR will be automatically reviewed by CodeRabbit. Please ensure:

  • All CodeRabbit suggestions have been addressed
  • Critical issues are resolved before requesting human review
  • IaC changes follow security best practices

Tip: Reply to CodeRabbit comments with @coderabbitai to get clarifications or request re-reviews.


Maintainer approval is required after addressing CodeRabbit feedback.

@coderabbitai

coderabbitai Bot commented Dec 14, 2025

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Hey there! 👋

I see this automated reminder went out. Just to let you know, I'm here and ready to help! Since I don't have context from earlier comments in this thread, I'm responding fresh to this reminder.

This PR looks like it's got some solid work - tests, cleanup, and bug fixes. If you'd like me to do a full review of all the changes in this PR, just let me know and I'll dive in!

You can either:

  • Reply with something like "review the changes" or "do a full review"
  • Or if you have specific questions about any part of the code, just tag me with @coderabbitai and ask away!

I'm here to help make sure everything looks good before merging. What would you like me to do? 🐰

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
docs/architecture.md (1)

7-25: Optional: Quiet the markdown linter.

The static analysis tool is complaining that the fenced code block (the ASCII diagram) doesn't have a language specified. You can add text or plaintext after the opening triple backticks to make it happy, but this is totally optional since it's just documentation formatting.

docs/runlocally.md (1)

62-62: Optional: Format the URL properly.

Markdown linters prefer URLs to be either in angle brackets <https://...> or as proper links [text](url). No big deal, but it's a small best practice thing.

-1. Install Kestra: https://kestra.io/docs/installation
+1. Install Kestra: <https://kestra.io/docs/installation>
README.md (1)

53-63: Optional: Add language specifier to the code block.

The markdown linter wants a language specified for the project structure tree. You can add text after the opening triple backticks to make it happy:

-```
+```text
 infoundry/
 ├── docs/                    # Documentation

Not a big deal, just keeps the linter quiet!

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 009bc86 and 4d29d00.

📒 Files selected for processing (29)
  • .github/workflows/ci.yml (1 hunks)
  • .gitignore (2 hunks)
  • CODE_OF_CONDUCT.md (1 hunks)
  • CONTRIBUTING.md (2 hunks)
  • LICENSE (1 hunks)
  • README.md (1 hunks)
  • docs/architecture.md (1 hunks)
  • docs/runlocally.md (1 hunks)
  • examples/telemetry/metrics.json (0 hunks)
  • infoundry-mcp-server/README.md (1 hunks)
  • infoundry-mcp-server/package.json (1 hunks)
  • infoundry-mcp-server/test.mjs (0 hunks)
  • infra/.gitkeep (0 hunks)
  • infra/modules/.gitkeep (0 hunks)
  • infra/templates/.gitkeep (0 hunks)
  • oumi/generate_training_data.py (1 hunks)
  • requirements.txt (1 hunks)
  • scripts/compute_reward.py (0 hunks)
  • scripts/simulate_load.py (0 hunks)
  • services/auth/Dockerfile (0 hunks)
  • services/auth/app.py (0 hunks)
  • services/payments/Dockerfile (0 hunks)
  • services/payments/app.py (0 hunks)
  • tests/.gitkeep (0 hunks)
  • tests/test_generate_training_data.py (1 hunks)
  • tests/test_kestra.js (1 hunks)
  • tests/test_mcp_server.mjs (2 hunks)
  • tests/test_oumi_serve.py (1 hunks)
  • ui/README.md (1 hunks)
💤 Files with no reviewable changes (12)
  • scripts/compute_reward.py
  • tests/.gitkeep
  • services/auth/Dockerfile
  • scripts/simulate_load.py
  • infra/.gitkeep
  • infra/modules/.gitkeep
  • services/payments/app.py
  • services/payments/Dockerfile
  • services/auth/app.py
  • infra/templates/.gitkeep
  • infoundry-mcp-server/test.mjs
  • examples/telemetry/metrics.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

⚙️ CodeRabbit configuration file

Do not emphasize these files too much

Files:

  • ui/README.md
  • CODE_OF_CONDUCT.md
  • docs/runlocally.md
  • CONTRIBUTING.md
  • infoundry-mcp-server/README.md
  • README.md
  • docs/architecture.md
🧬 Code graph analysis (2)
tests/test_kestra.js (2)
ui/components/StepOutputCard.jsx (1)
  • step (318-318)
ui/lib/kestra.js (1)
  • calculateDuration (132-143)
tests/test_generate_training_data.py (1)
oumi/generate_training_data.py (5)
  • determine_pattern (81-139)
  • generate_components (142-183)
  • generate_rationale (186-235)
  • generate_example (238-364)
  • main (429-494)
🪛 markdownlint-cli2 (0.18.1)
docs/runlocally.md

62-62: Bare URL used

(MD034, no-bare-urls)

README.md

53-53: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/architecture.md

53-53: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 Ruff (0.14.8)
tests/test_generate_training_data.py

152-152: Local variable result is assigned to but never used

Remove assignment to unused variable result

(F841)


156-156: Loop control variable comp not used within loop body

Rename unused comp to _comp

(B007)

🔇 Additional comments (15)
.gitignore (1)

4-6: Nice organization on the .gitignore update!

The new entries follow solid conventions for Python + Node projects. Love that you grouped them with section comments (Logs, IDE, Test coverage, Compiled files)—that makes it really easy to scan and maintain. All the patterns make sense: virtual env dirs, log files, IDE artifacts (.idea/, .vscode/, vim swaps), pytest coverage outputs, and Python package metadata. This should keep your repo clean without accidentally ignoring anything important.

Also applies to: 16-32

LICENSE (1)

1-21: License change looks good!

The MIT license text is complete and correct, and it's consistent with the license field update in package.json. Clean branding update.

infoundry-mcp-server/package.json (1)

16-16: License field update is consistent!

Matches the root LICENSE file change. Simple and aligned with the rebranding.

CODE_OF_CONDUCT.md (1)

20-20: Smart contact change!

Replacing a hard-coded email with "the project maintainers" reduces maintenance friction if contact methods need to change later. Good practice for long-term project health.

requirements.txt (1)

1-13: Dependency selection is solid!

FastAPI + Uvicorn + Pydantic is the standard modern Python web stack, and pytest + httpx are great for testing. The commented-out oumi[gpu] is a nice touch for optional local development.

One quick note: Since these version constraints predate late 2024, you might want to double-check that these are still the latest stable versions. The pins aren't super strict (just >=), so you've got room to upgrade. Want me to help verify the current versions?

CONTRIBUTING.md (1)

28-59: CodeRabbit section is well-structured!

The expanded guidance on IaC validation, merge blocking, and interaction patterns is clear and helpful. This gives contributors a much better sense of how the review process works.

ui/README.md (1)

1-49: Documentation upgrade is really clean!

The restructuring from generic getting-started to a feature-focused layout with clear dev setup, Pages table, and environment variables is way more helpful. The .env.local example for KESTRA_API_URL is especially nice — saves contributors a config headache. Good work on the Next.js 15 bump too.

.github/workflows/ci.yml (3)

9-26: Python test job looks great!

Separate Python test job with proper requirements.txt installation, pytest with verbose output, and the right ignore flags for JS test files. Clean setup.


28-43: MCP server build job is well-isolated!

Node 20 setup, npm ci (clean installs are best practice in CI), and npm run build in the right directory. Solid separation of concerns.


45-62: Clarify intent of || true in the lint step.

Line 62 has npm run lint || true, which means linting warnings won't fail the job. This is sometimes intentional (to allow warnings without blocking merges) but it can also hide real issues.

A few questions to clarify:

  1. Are lint warnings intentionally non-blocking? If so, awesome — just make sure your team knows warnings exist (maybe log them).
  2. Should this be stricter? If lint errors should block merges, remove the || true.

The || true pattern is a common gotcha in CI configs, so just making sure it's intentional!

infoundry-mcp-server/README.md (1)

64-65: Documentation looks solid!

Nice update to reflect running tests from the project root. This aligns perfectly with the refactored test script structure.

tests/test_mcp_server.mjs (1)

15-18: Nice refactor to support project-root test execution!

Adding the mcpServerDir constant and using it as the working directory for the spawned process is clean. This lets you run the test from anywhere in the project while ensuring the MCP server starts up in the right context.

tests/test_oumi_serve.py (1)

1-292: Excellent test coverage for the Oumi serve API!

This is a really solid test suite! You've got 29 tests covering:

  • The heuristic response logic with different pattern triggers (Kafka, Kubernetes, serverless, etc.)
  • Health endpoint validation
  • Chat completions with both happy and sad paths (nice 400 test!)
  • Response structure validation including JSON parsing

The test organization into classes is clean, and your docstrings make it super clear what each test is checking. This kind of comprehensive testing is exactly what you want to see in production code.

tests/test_kestra.js (1)

1-260: Great test coverage for the Kestra utilities!

You've done a nice job testing all the key utility functions here. I especially like:

  • The comprehensive STATE_MAP tests covering all the lifecycle states
  • The edge case handling in calculateDuration (null dates, sub-second durations, etc.)
  • The mapToStepProgress tests validating both the happy path and missing data scenarios

Using the native Node.js test runner (node:test) is a solid choice too - keeps dependencies minimal. The test structure is easy to follow with clear describe blocks and descriptive test names.

tests/test_generate_training_data.py (1)

1-149: Solid test suite overall!

Outside of that one incomplete test, this is really comprehensive coverage of the training data generation functions. You've got:

  • All the pattern determination logic tested (GPU, Kafka, service counts, etc.)
  • Component generation with database and queue mappings
  • Rationale generation for all patterns
  • Example generation with JSON validation

The test organization is clean, and I like how you're testing the randomness in generate_example() by running it multiple times. Good thinking!

Also applies to: 159-387

Comment thread CONTRIBUTING.md
Comment thread oumi/generate_training_data.py
Comment thread tests/test_generate_training_data.py
@crypticsaiyan crypticsaiyan changed the title chore: add tests, cleanup repo, and fix bugs chore: refactor CI workflow and add test coverage for Oumi and MCP server Dec 14, 2025
@crypticsaiyan crypticsaiyan merged commit 0fb4132 into dev Dec 14, 2025
12 checks passed
@crypticsaiyan crypticsaiyan deleted the chore/cleanup branch December 14, 2025 13:50
@coderabbitai coderabbitai Bot mentioned this pull request Dec 14, 2025
26 tasks
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