Skip to content

Commit 7f7cf99

Browse files
committed
feat: adopt EMBP architecture and Docker-based development workflow
- Implement Explicit Module Boundary Pattern (EMBP) across crate - Add `domain.rs` and `lib.rs` gateway modules - Refactor imports for consistent boundaries and encapsulation - Containerize development and CI workflows using Docker Compose - Add `scripts/build.sh` for unified lint/format/test pipeline - Pin Rust toolchain to 1.85 for reproducible builds - Mount volumes for hot-reload development - Replace curl healthchecks with netcat port checks - Run full integration tests using containerized cargo-lambda - Fix flakiness with order-agnostic assertions - Ensure full test parity between local dev and CI - Update CI workflows to match container-based dev setup - Improve documentation (README, CHANGELOG) BREAKING CHANGE: Local development now requires Docker; native Rust-only workflows are no longer supported.
1 parent baecd61 commit 7f7cf99

File tree

16 files changed

+846
-161
lines changed

16 files changed

+846
-161
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,19 @@ on:
77
branches: [ main ]
88

99
env:
10-
CARGO_TERM_COLOR: always
10+
CARGO_TERM_COLOR: never
1111

1212
jobs:
1313
test:
1414
name: Test
1515
runs-on: ubuntu-latest
1616

17+
env:
18+
COMPOSE_BAKE: true
19+
1720
steps:
1821
- name: Checkout code
1922
uses: actions/checkout@v4
2023

21-
- name: Install Rust
22-
uses: dtolnay/rust-toolchain@stable
23-
with:
24-
components: rustfmt
25-
26-
- name: Cache Cargo dependencies
27-
uses: actions/cache@v4
28-
with:
29-
path: |
30-
~/.cargo/bin/
31-
~/.cargo/registry/index/
32-
~/.cargo/registry/cache/
33-
~/.cargo/git/db/
34-
target/
35-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36-
restore-keys: |
37-
${{ runner.os }}-cargo-
38-
39-
- name: Check formatting
40-
run: cargo fmt --check
41-
42-
- name: Build release
43-
run: cargo build --release --quiet
44-
45-
- name: Run tests
46-
run: cargo test --release --quiet
24+
- name: Run build and test script
25+
run: ./scripts/build.sh

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
88

99
## [Unreleased]
1010

11-
- Awaiting license and attribution confirmation from the original author
11+
## [0.2.0] – 2025-06-28
12+
13+
### Added
14+
15+
* **EMBP Architecture**: Adopted Explicit Module Boundary Pattern for clean crate structure
16+
17+
* Created `mod.rs` gateways across all key modules (`domain/`, `repository/`, etc.)
18+
* Improved encapsulation, import hygiene, and module boundaries
19+
* **Docker-Based Development Workflow**:
20+
21+
* Added Docker Compose setup with Postgres and Redis
22+
* Hot-reload development via volume mounts
23+
* Introduced `scripts/build.sh` for unified format/lint/test/build pipeline
24+
* **Standardized CI Pipeline**:
25+
26+
* GitHub Actions CI mirrors local container-based workflow
27+
* Includes clippy, rustfmt, unit tests, and integration tests
28+
* Added containerized end-to-end tests using `cargo lambda`
29+
* **Toolchain Pinning**: Rust version pinned to 1.85 for consistency
30+
31+
### Changed
32+
33+
* CI and local development now fully containerized
34+
* Replaced fragile curl healthchecks with robust netcat-based port checks
35+
36+
### Fixed
37+
38+
* Integration test flakiness due to HashMap ordering:
39+
40+
* Added order-agnostic assertions
41+
* Ensured reliable deduplication across input variants
42+
43+
### ⚠️ Breaking Changes
44+
45+
* Local development now **requires Docker**; native Rust-only workflow is no longer supported
1246

1347
---
1448

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-lambda-action-filter"
3-
version = "0.1.1"
3+
version = "0.2.0"
44
edition = "2021"
55

66
[dependencies]
@@ -11,5 +11,4 @@ serde_json = "1.0"
1111
serde = { version = "1.0", features = ["derive"] }
1212
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
1313
tracing = "0.1"
14-
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
15-
14+
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }

Dockerfile.lambda-runtime

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM rust:1.85-slim
2+
3+
# Install system deps for building Rust packages and running cargo-lambda
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
libssl-dev \
7+
pkg-config \
8+
curl \
9+
ca-certificates \
10+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
11+
12+
# Add cargo bin path explicitly
13+
ENV PATH="/usr/local/cargo/bin:${PATH}"
14+
15+
# Install rustfmt component
16+
RUN rustup component add rustfmt
17+
18+
# Install cargo-lambda
19+
RUN cargo install cargo-lambda --version 1.8.5 --locked --quiet
20+
21+
# Default user
22+
RUN useradd -m dev
23+
WORKDIR /app
24+
25+
USER root
26+
27+
# Entry point overriden by docker-compose.yml
28+
CMD [ "bash" ]

0 commit comments

Comments
 (0)