Skip to content

feat(ecs+ecr): account-setting ARN format + scan findings synthetic flag#730

Merged
vieiralucas merged 1 commit intomainfrom
worktree-scoped-out-batch1
Apr 24, 2026
Merged

feat(ecs+ecr): account-setting ARN format + scan findings synthetic flag#730
vieiralucas merged 1 commit intomainfrom
worktree-scoped-out-batch1

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 24, 2026

Summary

Batch 1 of the scoped-out tightening pass. Two small correctness fixes that had been silently no-opping since both services first landed.

  • ECS ARN format enforcementserviceLongArnFormat / taskLongArnFormat / containerInstanceLongArnFormat set to disabled now actually emits short-form ARNs. New EcsState::effective_account_setting helper resolves principal overrides over account defaults (matching AWS).
  • ECR isSynthetic: trueDescribeImageScanFindings response now flags fakecloud's stub scanner output so introspection callers can tell it from real Inspector findings. AWS SDKs ignore unknown fields; no downstream impact.

Test plan

  • 5 new unit tests in fakecloud-ecs::state
  • 4 new E2E tests in ecs_account_settings_arn
  • 1 new E2E test in ecr_scan_synthetic_flag (raw HTTP since Smithy decode drops unknown fields)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • Existing ECS + ECR E2E suites — no regressions
  • CI + Cubic

Summary by cubic

Enforces ECS ARN format account settings and flags ECR scan findings as synthetic to match AWS behavior and aid introspection.

  • Bug Fixes
    • ECS: serviceLongArnFormat, taskLongArnFormat, and containerInstanceLongArnFormat now control ARN shape. When set to disabled, short-form ARNs are emitted; default is long-form. Added EcsState::effective_account_setting (principal overrides beat account defaults) and EcsState::container_instance_arn(...) to unify ARN generation.
    • ECR: DescribeImageScanFindings now includes isSynthetic: true inside imageScanFindings so tooling can spot fakecloud data. AWS SDKs ignore unknown fields, so no downstream impact.

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

… synthetic flag

Two small ECR+ECS correctness fixes shipped together. Both had been
silently no-opping since the services first landed.

- ECS: `serviceLongArnFormat`, `taskLongArnFormat`, and
  `containerInstanceLongArnFormat` account settings now actually
  influence ARN generation. When any is `disabled` (via
  `PutAccountSettingDefault` or `PutAccountSetting`), new service /
  task / container-instance ARNs drop the cluster segment — matching
  AWS's pre-Nov-2018 short form. Default is long, matching AWS.

  New helpers on `EcsState`:
  - `container_instance_arn(cluster, id)` — mirrors the existing
    `task_arn` / `service_arn` shape so all three ARN sites go
    through one format-switch.
  - `effective_account_setting(name, principal_arn)` — resolves
    principal-level overrides on top of the account default.

  Principal overrides win over defaults, matching AWS's
  PutAccountSetting vs PutAccountSettingDefault layering.

- ECR: `DescribeImageScanFindings` now returns `isSynthetic: true`
  inside the `imageScanFindings` object. Callers inspecting scan
  results via raw HTTP / introspection can cleanly tell fakecloud's
  stub scanner output from real Inspector findings. AWS SDKs using
  Smithy codegen drop unknown fields during decode, so downstream
  consumers aren't affected.

- Tests: 5 new state unit tests covering long/short ARN round-trip
  and principal-override precedence; 4 new ECS E2E tests driving
  `PutAccountSettingDefault` via the AWS SDK + asserting ARN shape
  on RunTask / CreateService; 1 ECR E2E test asserting
  `isSynthetic=true` via raw HTTP.
@vieiralucas vieiralucas merged commit 2da96a9 into main Apr 24, 2026
15 checks passed
@vieiralucas vieiralucas deleted the worktree-scoped-out-batch1 branch April 24, 2026 12:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 91.89189% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fakecloud-ecs/src/state.rs 94.44% 4 Missing ⚠️
crates/fakecloud-ecr/src/service.rs 0.00% 1 Missing ⚠️
crates/fakecloud-ecs/src/service.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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