feat: add AppConfigData stub and local demo infrastructure for AWS mocks#2
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an offline local demo stack to exercise Otto Config’s AWS + Vault integrations without requiring real AWS credentials or access to the corporate Vault, including an AppConfigData data-plane stub to compensate for moto’s missing support.
Changes:
- Updated root documentation to run demos from the repo root and added guidance for the local docker-compose stack.
- Added new
motoprofile configuration for Spring and Helidon demos to point at local moto/Vault endpoints and enable change notifications. - Introduced
demo/localdocker-compose infrastructure, bootstrap scripts, a change-event helper, and a JDK-only AppConfigData stub server.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates demo run instructions and documents the new local stack entrypoint. |
| demo/spring/src/main/resources/application-moto.properties | Adds Spring “moto” profile overrides for local moto/Vault usage and queue-based refresh. |
| demo/helidon/src/main/resources/META-INF/microprofile-config-moto.properties | Adds Helidon “moto” profile overrides matching the Spring demo behavior. |
| demo/local/README.md | Documents how the local stack works, how to run demos against it, and how to live-edit AppConfig JSON. |
| demo/local/docker-compose.yml | Defines moto + Vault + AppConfigData stub services plus init containers to seed resources and generate .env. |
| demo/local/init-moto.sh | Seeds moto with Secrets Manager, SSM parameters, and the SQS change-notification queue. |
| demo/local/init-vault.sh | Seeds Vault KV/AppRole and writes role/secret IDs plus AWS endpoint env vars to .env. |
| demo/local/notify-change.sh | Helper to push EventBridge-shaped change events into the moto SQS queue for immediate refresh. |
| demo/local/appconfigdata-stub/AppConfigDataStub.java | Implements minimal AppConfigData endpoints backed by local JSON files, including FeatureFlags value extraction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+123
to
+125
| Long previous = LAST_SEEN_MTIME.get(token); | ||
| String nextToken = encodeToken(profile); | ||
| LAST_SEEN_MTIME.put(nextToken, mtime); |
Comment on lines
+86
to
+89
| if (!PROFILE_TO_FILE.containsKey(profile)) { | ||
| respondJson(ex, 404, "{\"Message\":\"unknown profile '" + profile + "'\"}"); | ||
| return; | ||
| } |
| ports: | ||
| - "8200:8200" | ||
| healthcheck: | ||
| test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8200/v1/sys/health"] |
| # the original inode and keep serving the old content. | ||
| - ../terraform:/data:ro | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/5001 && printf 'GET /configuration HTTP/1.0\\r\\n\\r\\n' >&3 && head -n1 <&3"] |
Comment on lines
+268
to
+269
| cd demo/local && docker compose up -d && source ./.env && cd ../.. | ||
| ./gradlew :demo:spring:bootRun --args='--spring.profiles.active=moto' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.