Skip to content

feat(lambda): close conformance gap with 72 missing ops#705

Merged
vieiralucas merged 13 commits intomainfrom
worktree-worktree-lambda-72ops
Apr 23, 2026
Merged

feat(lambda): close conformance gap with 72 missing ops#705
vieiralucas merged 13 commits intomainfrom
worktree-worktree-lambda-72ops

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 23, 2026

Summary

  • 72 new Lambda handlers in extras.rs covering aliases, layers, function URL configs, concurrency (reserved + provisioned), code signing, event invoke configs, runtime management, scaling, recursion, capacity providers, durable executions + callbacks, and lifecycle extras (GetFunctionConfiguration, UpdateFunction{Code,Configuration}, GetAccountSettings, InvokeAsync, InvokeWithResponseStream).
  • Resolver rewritten to recognise the many date prefixes the SDK uses per op family.
  • Big new state surface: aliases, layers, function URL configs, concurrency, provisioned concurrency, code signing configs + function bindings, event invoke configs, runtime/scaling/recursion configs, tags, capacity providers, durable executions, account settings.
  • Lambda conformance: 13/85 -> 85/85 (100%); workspace baseline +2615 passing variants.

Test plan

  • cargo test -p fakecloud-conformance --test lambda -> 24 pass
  • cargo run -p fakecloud-conformance -- run --services lambda -> 85/85 OK
  • cargo run -p fakecloud-conformance -- audit / check -> PASS
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt

Summary by cubic

Adds 72 missing Lambda operations to fakecloud-lambda to reach 100% conformance (85/85). State now persists all new resources and configs.

  • New Features

    • Handlers for aliases/versions/layers; function URLs; reserved and provisioned concurrency; code signing + function bindings; event invoke configs; runtime/scaling/recursion; tags; capacity providers; durable executions + callbacks; and lifecycle extras (Get/UpdateFunction*, GetAccountSettings, InvokeAsync/InvokeWithResponseStream).
    • Includes per-resource policies/permissions and per-qualifier configs.
  • Refactors

    • Router matches by path shape across mixed Lambda API date prefixes; removed date-specific branches.
    • Added extras.rs; exposed LambdaService state; durable executions now persist FunctionArn for correct list-by-function filtering.
    • Tests: tightened InvokeWithResponseStream failure handling; added 5 unit tests.
    • Conformance baseline updated (variants passed now 58,040; Lambda 3,347/3,347).

Written for commit d231c84. Summary will update on new commits.

Adds 72 Lambda operations across 13 domains in a new lambda/extras.rs:
- Aliases (5): Create/Get/List/Update/Delete with persisted routing
  configuration and revision IDs.
- Versions (1): ListVersionsByFunction (per-function versions list).
- Layers (9): Publish, Get, GetByArn, List, ListVersions, Delete,
  GetVersionPolicy, AddVersionPermission, RemoveVersionPermission with
  per-layer policy mutation.
- Function URL (5): Create/Get/Update/Delete + List (per-bucket cfg).
- Concurrency (7): Reserved + provisioned put/get/delete + list,
  per-qualifier provisioned configs.
- Code signing (9): CSC create/get/update/delete/list +
  function-association put/get/delete + ListByCSC.
- Event invoke (5): Put/Get/Update/Delete + List per qualifier.
- Runtime + scaling + recursion (6): Per-function configs.
- Tagging (3): Tag/Untag/List on resource ARNs.
- Capacity providers (6): CRUD + list + ListVersionsByCapacityProvider.
- Durable executions (9): Checkpoint, Get/History/State, ListByFunction,
  Stop, plus three callback variants (success/failure/heartbeat) at
  both function-rooted and dedicated callback paths.
- Function lifecycle extras (5): GetFunctionConfiguration,
  UpdateFunctionConfiguration, UpdateFunctionCode, GetAccountSettings,
  InvokeAsync + InvokeWithResponseStream.

Resolver now treats date prefixes as advisory and matches on path
structure to handle the SDK using different vintages per op
(2014-11-13, 2017-10-31, 2019-09-25, 2021-10-31, 2024-08-31,
2024-09-01, 2025-04-01, 2025-11-30, 2025-12-01).

Lambda conformance closes to 85/85 (100%); workspace baseline +2615.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai 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 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-lambda/src/service.rs">

<violation number="1" location="crates/fakecloud-lambda/src/service.rs:449">
P2: This `if false { ... }` block is dead code that can never execute. If it's kept as documentation, convert it to a comment; otherwise remove it entirely. Dead code behind `if false` confuses readers about whether routes are actually handled.</violation>

<violation number="2" location="crates/fakecloud-lambda/src/service.rs:471">
P2: Several date-specific routing blocks (prefixes `2019-09-25`, `2024-08-31`, `2025-11-30`/`2025-04-01`, `2024-09-01`/`2025-12-01`, `2020-04-22`) are unreachable dead code — the "any prefix" handlers above already return early for the same path patterns. These ~150 lines of dead routing add maintenance burden and make the router harder to reason about. Consider removing them.</violation>
</file>

<file name="crates/fakecloud-lambda/src/extras.rs">

<violation number="1" location="crates/fakecloud-lambda/src/extras.rs:1511">
P1: Checkpointed durable executions are created without a function ARN, so list-by-function filtering can miss them.</violation>
</file>

<file name="crates/fakecloud-conformance/tests/lambda.rs">

<violation number="1" location="crates/fakecloud-conformance/tests/lambda.rs:379">
P2: Don't discard the `invoke_with_response_stream` result; this test currently passes even when the route fails.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread crates/fakecloud-lambda/src/extras.rs Outdated
Comment thread crates/fakecloud-lambda/src/service.rs Outdated
Comment thread crates/fakecloud-lambda/src/service.rs Outdated
Comment thread crates/fakecloud-conformance/tests/lambda.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 33.18182% with 1323 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fakecloud-lambda/src/extras.rs 34.52% 1047 Missing ⚠️
crates/fakecloud-lambda/src/service.rs 20.91% 276 Missing ⚠️

📢 Thoughts on this report? Let us know!

- checkpoint_durable_execution: persist function ARN derived from
  body FunctionArn or FunctionName so list-by-function filtering
  catches checkpointed executions
- service.rs: remove dead 'if false' block and unreachable date-
  specific routing blocks (concurrency, event-invoke-config,
  recursion-config, capacity-providers, durable-executions,
  code-signing-configs, function URLs) — all handled by the
  prefix-agnostic blocks above
- lambda invoke_with_response_stream test: explicitly accept Ok
  / ServiceError / ResponseError but panic on dispatch failures
  so a missing route doesn't pass silently
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-lambda/src/extras.rs">

<violation number="1" location="crates/fakecloud-lambda/src/extras.rs:1517">
P2: Avoid hardcoding `us-east-1` when deriving the function ARN; use the account’s configured region so durable execution metadata is correct in other regions.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment on lines +1517 to +1519
"arn:aws:lambda:us-east-1:{}:function:{name}",
req.account_id
),
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 23, 2026

Choose a reason for hiding this comment

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

P2: Avoid hardcoding us-east-1 when deriving the function ARN; use the account’s configured region so durable execution metadata is correct in other regions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/fakecloud-lambda/src/extras.rs, line 1517:

<comment>Avoid hardcoding `us-east-1` when deriving the function ARN; use the account’s configured region so durable execution metadata is correct in other regions.</comment>

<file context>
@@ -1501,20 +1501,39 @@ impl LambdaService {
+        let derived_arn = body_arn.unwrap_or_else(|| match body_function {
+            Some(name) if name.starts_with("arn:") => name,
+            Some(name) => format!(
+                "arn:aws:lambda:us-east-1:{}:function:{name}",
+                req.account_id
+            ),
</file context>
Suggested change
"arn:aws:lambda:us-east-1:{}:function:{name}",
req.account_id
),
"arn:aws:lambda:{}:{}:function:{name}",
state.region, req.account_id
Fix with Cubic

@vieiralucas vieiralucas merged commit 0acea92 into main Apr 23, 2026
48 checks passed
@vieiralucas vieiralucas deleted the worktree-worktree-lambda-72ops branch April 23, 2026 11:09
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