Skip to content

chore: add Cloud Agent dev environment config - #16

Draft
donny-devops wants to merge 2 commits into
mainfrom
donny-devops/dev-environment-setup-4829
Draft

donny-devops wants to merge 2 commits into
mainfrom
donny-devops/dev-environment-setup-4829

Conversation

@donny-devops

@donny-devops donny-devops commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Two things:

  1. Sets up a reproducible development environment for the FastAPI starter kit so Cloud Agents (and local contributors) can boot the app with dependencies installed and the dev server running automatically.
  2. Fixes the pre-existing CI Docker build failure (also failing on main).

Changes

Dev environment

  • .cursor/environment.json — declares the environment: runs install.sh on setup, exposes port 8000, and launches a uvicorn dev server (with --reload) in a persistent terminal.
  • .cursor/install.sh — idempotent bootstrap that installs python3.12-venv if missing (the default image ships Python 3.12 without ensurepip), creates .venv, installs requirements.txt, and seeds .env from .env.example on first run (never overwriting an existing .env).

CI fix

  • .github/workflows/ci.yml — bumped aquasecurity/trivy-action@v0.28.0@v0.36.0, pinned by commit SHA (ed142fd).

Root cause: trivy-action@v0.28.0's action.yaml referenced aquasecurity/setup-trivy@v0.2.1 by tag. That tag was deleted upstream (only v0.2.6, v0.3.0, v0.3.1, ... remain), so GitHub Actions failed at Set up job with Unable to resolve action aquasecurity/setup-trivy@v0.2.1, unable to find version v0.2.1 before any step ran. v0.36.0 pins setup-trivy by commit SHA internally, so nested resolution succeeds.

Verification

Dev environment (in the Cloud Agent VM):

  • pytest — 74 passed; ruff check . / ruff format --check . — clean.
  • uvicorn main:app served live requests: GET /health200, user/item CRUD, 409 on duplicate email, GET /ops/route?country=JPshard_apac_01/NRT, 404 on missing user.

CI fix (GitHub Actions on this PR):

  • All 14 checks green, including CI / Docker build (59s), which was previously failing. The build step and Trivy config scan now run end-to-end.

Health endpoint in browser

Note: /docs (Swagger UI) loads its assets from an external CDN blocked by the environment egress policy, so it does not render in-browser here. The API itself is fully functional, as shown above.

Open in Web Open in Cursor 

Co-authored-by: Adonis Jimenez <donny-devops@users.noreply.github.com>
@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / Security Evidence

Commit: 687172ca771dbc2498a829c3623755095e653084

Security evidence gate passed (success)

No security-sensitive scanner-evidence gap detected.

Mode: enforce

Scanned 2 changed file(s). No missing scanner-evidence signal was detected.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / PR Risk Taxonomy

Commit: 687172ca771dbc2498a829c3623755095e653084

PR taxonomy clear (success)

Scanned 2 changed file(s). No taxonomy bucket signals were detected.

Scanned 2 changed file(s).

No PR taxonomy bucket signals were detected.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / Reference Set Readiness

Commit: 687172ca771dbc2498a829c3623755095e653084

Reference set readiness gaps detected (neutral)

Reference evidence present for 0/7 areas (0%) across 2 changed file(s).

This check is based on files changed in this PR. Repository-level readiness is still reported by /ecc-tools analyze comments and generated manifests.

Area Status Evidence / Next Step
Deep analyzer corpus Missing Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions.
RAG/evaluator comparison Missing Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior.
PR salvage/review corpus Missing Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation.
Discussion triage corpus Missing Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications.
Harness compatibility Missing Add cross-harness, adapter-compliance, or harness-audit evidence for Claude, Codex, OpenCode, Zed, dmux, and agent surfaces.
Security evidence Missing Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs.
CI failure-mode evidence Missing Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / Hosted Promotion Readiness

Commit: 687172ca771dbc2498a829c3623755095e653084

Hosted promotion readiness passed (success)

No hosted promotion evidence gaps detected across 2 changed file(s); 0 corpus scenarios had matching evidence.

This check compares PR file changes against the evaluator/RAG promotion corpus in src/analyzers/fixtures/evaluator-rag-corpus.ts.
Hosted output scoring inspected 0 completed cached hosted job results.

No evaluator corpus scenarios matched this PR.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

This PR adds Cloud Agent development environment configuration for the FastAPI starter kit. The setup automates dependency installation and server startup, which improves the development experience.

Critical Issues Identified

Two crash scenarios were identified in the install.sh script where missing files (requirements.txt and .env.example) would cause the script to fail with unclear errors due to the set -euo pipefail setting. Both issues have been flagged with suggested fixes that add explicit file existence checks and graceful error handling.

After addressing these issues, the configuration should provide a robust and reliable development environment setup.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread .cursor/install.sh
Comment on lines +21 to +23
if [ ! -f .env ]; then
cp .env.example .env
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Crash Risk: Script will exit with unclear error if .env.example is missing. Add explicit check before copying template file.

Suggested change
if [ ! -f .env ]; then
cp .env.example .env
fi
# Provide a local .env from the template on first setup (never overwrite an existing one).
if [ ! -f .env ] && [ -f .env.example ]; then
cp .env.example .env
elif [ ! -f .env ]; then
echo "Warning: .env.example not found, skipping .env creation"
fi

Comment thread .cursor/install.sh
source .venv/bin/activate

python -m pip install --upgrade pip
pip install -r requirements.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Crash Risk: Script will exit with unclear error if requirements.txt is missing. Add explicit check before installing dependencies.

Suggested change
pip install -r requirements.txt
if [ -f requirements.txt ]; then
pip install -r requirements.txt
else
echo "Warning: requirements.txt not found, skipping dependency installation"
fi

trivy-action@v0.28.0 referenced the deleted setup-trivy@v0.2.1 tag,
causing 'unable to resolve action' failures during job setup. v0.36.0
pins setup-trivy by commit SHA, so nested resolution succeeds.

Co-authored-by: Adonis Jimenez <donny-devops@users.noreply.github.com>
@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / Security Evidence

Commit: 4eaebd401d6e94934646501a0c63434a651f13d7

Security evidence gate passed (success)

No security-sensitive scanner-evidence gap detected.

Mode: enforce

Scanned 3 changed file(s). No missing scanner-evidence signal was detected.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / PR Risk Taxonomy

Commit: 4eaebd401d6e94934646501a0c63434a651f13d7

PR taxonomy review recommended (neutral)

Detected 2 PR taxonomy bucket(s): Security Evidence, CI/CD Recommendation.

Scanned 3 changed file(s).

Roadmap taxonomy buckets:

Security Evidence

Security-sensitive changes should carry explicit scanner, code-scanning, or focused regression evidence.

Signals:

  • 1 security-sensitive path(s) changed

Paths:

  • .github/workflows/ci.yml

CI/CD Recommendation

CI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work.

Signals:

  • CI workflow changes may ship without failure-mode evidence
  • Dependency or CI drift could surface after merge
  • 1 CI or workflow path(s) changed

Paths:

  • .github/workflows/ci.yml
  • .cursor/environment.json

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / Reference Set Readiness

Commit: 4eaebd401d6e94934646501a0c63434a651f13d7

Reference set readiness gaps detected (neutral)

Reference evidence present for 0/7 areas (0%) across 3 changed file(s).

This check is based on files changed in this PR. Repository-level readiness is still reported by /ecc-tools analyze comments and generated manifests.

Area Status Evidence / Next Step
Deep analyzer corpus Missing Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions.
RAG/evaluator comparison Missing Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior.
PR salvage/review corpus Missing Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation.
Discussion triage corpus Missing Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications.
Harness compatibility Missing Add cross-harness, adapter-compliance, or harness-audit evidence for Claude, Codex, OpenCode, Zed, dmux, and agent surfaces.
Security evidence Missing Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs.
CI failure-mode evidence Missing Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / Hosted Promotion Readiness

Commit: 4eaebd401d6e94934646501a0c63434a651f13d7

Hosted promotion readiness passed (success)

No hosted promotion evidence gaps detected across 3 changed file(s); 0 corpus scenarios had matching evidence.

This check compares PR file changes against the evaluator/RAG promotion corpus in src/analyzers/fixtures/evaluator-rag-corpus.ts.
Hosted output scoring inspected 0 completed cached hosted job results.

No evaluator corpus scenarios matched this PR.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / PR Config Audit

Commit: 4eaebd401d6e94934646501a0c63434a651f13d7

No changed-config issues detected (success)

Scanned 1 config file(s) present at this commit across 1 changed config path(s) and found no issues in the supported security rules.

Changed config files:

  • .github/workflows/ci.yml

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 14, 2026

Copy link
Copy Markdown

ECC Tools / PR Harness Audit

Commit: 4eaebd401d6e94934646501a0c63434a651f13d7

No harness issues detected (success)

Scanned 1 changed config file(s) and found no harness issues.

Changed config files:

  • .github/workflows/ci.yml

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

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