Skip to content

Commit fadf50d

Browse files
bonclay7awsimayasunkavar
authored
New petfood service (#347)
* PetSite updates (#350) * useId in querystring, userId in trace context, and new layout + more * Basecontroller changes to avoid dual redirect * Change SSM approach * Change SSM Access and change petitem layout slightly * Comment cuteness rate for testing * TryParse check * Comment Food stuff * Aggressive logging for debugging purposes * Add app wide error page * Adding logging to AdoptionController * Add DataProtection dependency for TempData * Make TempData use Session * Get rid of TempData altogether * Logging for ViewData checks * Change from HttpSession Cookies for Payment * Moved userId management to ViewData and hidden controls * Validate querystring in URLs, use inline input fields for userIds * Add Helpers * App wide Error page * enable app-signals and autoinstrumentation on petsite * remove xray sdk and add custom span attributes to the traces from auto-instrumentation * .NET Version, new page design, favicon etc * Remove stuff from appsettings * Add appsettings.development.json to gitignore * Remove duplicate entries from gitignore * payforadoption async split into pethistory (#334) * Add UserId to completeadoption API * Complete adoption moves from transaction to event * Add SQS permissions * Modify adoption schema * Add pet adopter lambda function * Fix app signals requirements * Rework petadopter to focus on history in async mode * Enable testing on staging branch * Split adoption and history logic * Update CI tests * Remove dead param * Update stack name * Remove db stats metrics as not collected * Disable code guru comments (#337) * Fix petsite ADOT migration (#341) * Create tracing span with activity source on PetSite * add ASPNETCORE_HTTP_PORTS env variable for PetSite to listen on Port 80 * useId in querystring, userId in trace context, and new layout + more (#342) * Set up Rust project structure and core dependencies * Implement core data models and validation * Set up configuration management and AWS integration * Implement DynamoDB repository layer * Implement business logic services * Add observability middleware to handle metrics and tracing * Implement HTTP API endpoints and routing * Add admin API operations * Add checkout API * Cleanup and tests * Fix docker build * Add CDK definition * Update CI tests * cleanup * fixup! Update CI tests * fixup! Update CI tests * Fix shutdown * cargo fmt * Update task def settings * Improve docker build * Cargo fmt * Fix cargo tests --------- Co-authored-by: Imaya Kumar Jagannathan <[email protected]> Co-authored-by: Raviteja Sunkavalli <[email protected]> Co-authored-by: Imaya Kumar Jagannathan <[email protected]> Co-authored-by: sunkavar <[email protected]>
1 parent d31490a commit fadf50d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+19794
-667
lines changed
File renamed without changes.

.github/workflows/cdk-test.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main, staging ]
6+
paths:
7+
- 'PetAdoptions/cdk/**'
8+
- 'PetAdoptions/petfood-rs/**'
9+
push:
10+
branches: [ main, staging ]
11+
paths:
12+
- 'PetAdoptions/cdk/**'
13+
- 'PetAdoptions/petfood-rs/**'
14+
15+
jobs:
16+
cdk-synth-test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
28+
- name: Cache node modules
29+
uses: actions/cache@v4
30+
with:
31+
path: PetAdoptions/cdk/pet_stack/node_modules
32+
key: ${{ runner.os }}-node-${{ hashFiles('PetAdoptions/cdk/pet_stack/package.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-node-
35+
36+
- name: Install dependencies
37+
run: npm install
38+
working-directory: PetAdoptions/cdk/pet_stack
39+
40+
- name: Build TypeScript
41+
run: npm run build
42+
working-directory: PetAdoptions/cdk/pet_stack
43+
44+
- name: TypeScript compilation check
45+
run: npx tsc --noEmit
46+
working-directory: PetAdoptions/cdk/pet_stack
47+
48+
- name: CDK context validation
49+
run: |
50+
echo "Validating CDK context and configuration..."
51+
npx cdk context --clear
52+
npx cdk ls
53+
working-directory: PetAdoptions/cdk/pet_stack
54+
env:
55+
AWS_DEFAULT_REGION: us-east-1
56+
AWS_REGION: us-east-1
57+
AWS_ACCESS_KEY_ID: dummy
58+
AWS_SECRET_ACCESS_KEY: dummy
59+
60+
- name: Run CDK synth (dry run)
61+
run: npx cdk synth --no-staging
62+
working-directory: PetAdoptions/cdk/pet_stack
63+
env:
64+
# Set required AWS environment variables for synth
65+
AWS_DEFAULT_REGION: us-east-1
66+
AWS_REGION: us-east-1
67+
# CDK doesn't need real AWS credentials for synth, but some constructs might check
68+
AWS_ACCESS_KEY_ID: dummy
69+
AWS_SECRET_ACCESS_KEY: dummy
70+
71+
- name: Run CDK diff (if applicable)
72+
run: npx cdk diff --no-staging || true
73+
working-directory: PetAdoptions/cdk/pet_stack
74+
env:
75+
AWS_DEFAULT_REGION: us-east-1
76+
AWS_REGION: us-east-1
77+
AWS_ACCESS_KEY_ID: dummy
78+
AWS_SECRET_ACCESS_KEY: dummy
79+
80+
petfood-rust-test:
81+
runs-on: ubuntu-latest
82+
83+
steps:
84+
- name: Checkout code
85+
uses: actions/checkout@v4
86+
87+
- name: Setup Rust
88+
uses: actions-rs/toolchain@v1
89+
with:
90+
toolchain: stable
91+
profile: minimal
92+
override: true
93+
components: rustfmt, clippy
94+
95+
- name: Cache cargo registry
96+
uses: actions/cache@v4
97+
with:
98+
path: ~/.cargo/registry
99+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('PetAdoptions/petfood-rs/Cargo.lock') }}
100+
restore-keys: |
101+
${{ runner.os }}-cargo-registry-
102+
103+
- name: Cache cargo index
104+
uses: actions/cache@v4
105+
with:
106+
path: ~/.cargo/git
107+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('PetAdoptions/petfood-rs/Cargo.lock') }}
108+
restore-keys: |
109+
${{ runner.os }}-cargo-index-
110+
111+
- name: Cache cargo build
112+
uses: actions/cache@v4
113+
with:
114+
path: PetAdoptions/petfood-rs/target
115+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('PetAdoptions/petfood-rs/Cargo.lock') }}
116+
restore-keys: |
117+
${{ runner.os }}-cargo-build-target-
118+
119+
- name: Check Rust formatting
120+
run: cargo fmt --all -- --check
121+
working-directory: PetAdoptions/petfood-rs
122+
123+
- name: Run Clippy (linting)
124+
run: cargo clippy --all-targets --all-features -- -D warnings
125+
working-directory: PetAdoptions/petfood-rs
126+
127+
- name: Run cargo unit tests
128+
run: cargo test --lib --bins
129+
working-directory: PetAdoptions/petfood-rs
130+
env:
131+
RUST_BACKTRACE: 1
132+
133+
# - name: Run cargo tests with all features
134+
# run: cargo test --all-features --verbose
135+
# working-directory: PetAdoptions/petfood-rs
136+
# env:
137+
# RUST_BACKTRACE: 1
138+
139+
- name: Check cargo build
140+
run: cargo build --release
141+
working-directory: PetAdoptions/petfood-rs

0 commit comments

Comments
 (0)