Skip to content

feat(lambdai): implement provider simulator#200

Merged
ravisoundar merged 4 commits into
mainfrom
rs-lambda-sim
Jan 24, 2026
Merged

feat(lambdai): implement provider simulator#200
ravisoundar merged 4 commits into
mainfrom
rs-lambda-sim

Conversation

@ravisoundar
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Ravi Shankar <ravish@nvidia.com>
@ravisoundar ravisoundar requested a review from dmitsh as a code owner January 23, 2026 17:46
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jan 23, 2026

Greptile Summary

This PR adds a simulation provider for Lambda (lambdai-sim) that enables testing Lambda topology generation without requiring actual Lambda API access.

  • Implements simClient that reads topology from model YAML files instead of calling Lambda API
  • Supports pagination through InstanceList with proper bounds checking
  • Provides GetComputeInstances for engine support with appropriate error handling
  • Follows established patterns from existing simulation providers (aws-sim, gcp-sim, oci-sim)
  • Includes comprehensive test coverage for error cases, pagination, and both tree and block topology formats
  • Integrates with the server test suite for end-to-end validation

Confidence Score: 5/5

  • This PR is safe to merge - it adds a new simulation provider following well-established patterns with comprehensive test coverage.
  • The implementation follows existing patterns from other simulation providers (aws-sim, gcp-sim), includes proper error handling, has comprehensive unit and integration tests, and makes no changes to production code paths. The code has better bounds checking than some existing providers.
  • No files require special attention.

Important Files Changed

Filename Overview
pkg/providers/lambdai/provider_sim.go New simulation provider for Lambda with proper pagination, error handling, and consistent implementation following existing patterns from other cloud providers.
pkg/providers/lambdai/provider_sim_test.go Comprehensive test suite covering error cases, pagination, and topology generation for both tree and block formats.
pkg/registry/registry.go Registers the new Lambda simulation provider in the global provider registry.
pkg/server/http_server_test.go Adds integration test case for Lambda simulation provider alongside existing AWS and GCP tests.

Sequence Diagram

sequenceDiagram
    participant Test as Test/Client
    participant LoaderSim as LoaderSim
    participant simProvider as simProvider
    participant simClient as simClient
    participant Model as models.Model

    Test->>LoaderSim: LoaderSim(ctx, cfg)
    LoaderSim->>Model: NewModelFromFile(modelPath)
    Model-->>LoaderSim: model
    LoaderSim->>simProvider: NewSim(clientFactory)
    simProvider-->>Test: provider

    Test->>simProvider: GenerateTopologyConfig(ctx, pageSize, instances)
    simProvider->>simClient: clientFactory(pageSize)
    simClient-->>simProvider: client

    loop For each ComputeInstances
        simProvider->>simClient: InstanceList(ctx, req)
        simClient->>Model: Access Nodes
        Model-->>simClient: Node data
        simClient-->>simProvider: InstanceListResponse
    end

    simProvider-->>Test: topology.Vertex
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread pkg/providers/lambdai/provider_sim.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 82.81250% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.55%. Comparing base (7c9b841) to head (cabfa08).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pkg/providers/lambdai/provider_sim.go 82.81% 9 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   64.34%   65.55%   +1.20%     
==========================================
  Files          80       81       +1     
  Lines        4384     4448      +64     
==========================================
+ Hits         2821     2916      +95     
+ Misses       1454     1419      -35     
- Partials      109      113       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Ravi Shankar <ravish@nvidia.com>
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment thread pkg/providers/lambdai/provider_sim_test.go
Comment thread pkg/providers/lambdai/provider_sim_test.go
Comment thread pkg/server/http_server_test.go Outdated
Comment thread pkg/providers/lambdai/provider_sim.go
ravisoundar and others added 2 commits January 23, 2026 14:15
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: ravisoundar <49925398+ravisoundar@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: ravisoundar <49925398+ravisoundar@users.noreply.github.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jan 23, 2026

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@ravisoundar ravisoundar changed the title initial commit for lambda provider simulator feat(lambdai): implement provider simulator Jan 24, 2026
@ravisoundar ravisoundar merged commit 2c3c981 into main Jan 24, 2026
7 checks passed
@ravisoundar ravisoundar deleted the rs-lambda-sim branch January 24, 2026 01:14
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