-
Notifications
You must be signed in to change notification settings - Fork 59
Adventure: π§ͺ Blind by Design β π‘ Intermediate #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
KatharinaSick
merged 6 commits into
off-on-dev:main
from
aepfli:adventure/blind-by-design-intermediate
May 11, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4cbf57d
adventure: π§ͺ Blind by Design β π‘ Intermediate
aepfli 07bac0d
review: address PR #42 feedback for Intermediate level
aepfli c00105d
intermediate: add Makefile, drop solution walkthrough
aepfli fa2720c
docs(intermediate): lift "Start the Lab" into its own step
aepfli 8bcf885
review: address PR #43 feedback for Intermediate level
aepfli a26ad06
remove cd commands from docs
KatharinaSick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
.devcontainer/00-blind-by-design_02-intermediate/devcontainer.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "name": "π§ͺ Adventure 00 | π‘ Intermediate (Outcome by cohort)", | ||
| "dockerComposeFile": "docker-compose.yml", | ||
| "service": "workspace", | ||
| "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/adventures/planned/00-blind-by-design/intermediate", | ||
| "postCreateCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/00-blind-by-design_02-intermediate/post-create.sh", | ||
| "postStartCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/00-blind-by-design_02-intermediate/post-start.sh", | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "vscjava.vscode-java-pack", | ||
| "vmware.vscode-spring-boot", | ||
| "vscjava.vscode-spring-boot-dashboard" | ||
| ] | ||
| }, | ||
| "codespaces": { | ||
| "openFiles": [ | ||
| "adventures/planned/00-blind-by-design/docs/intermediate.md", | ||
| "adventures/planned/00-blind-by-design/intermediate/src/main/java/dev/openfeature/demo/java/demo/OpenFeatureConfig.java", | ||
| "adventures/planned/00-blind-by-design/intermediate/flags.json" | ||
| ] | ||
| } | ||
| }, | ||
| "otherPortsAttributes": { | ||
| "onAutoForward": "ignore" | ||
| } | ||
| } |
38 changes: 38 additions & 0 deletions
38
.devcontainer/00-blind-by-design_02-intermediate/docker-compose.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Multi-container devcontainer for Intermediate. The lab itself runs in | ||
| # `workspace`; flagd runs as a sibling so participants who finish the | ||
| # FILE-mode path early can flip the FlagdProvider to RPC mode and talk | ||
| # to flagd:8013 without any Docker-in-Docker dance. | ||
| # | ||
| # Both services bind-mount the same workspace at the same path. flagd | ||
| # watches the participant's flags.json directly β edit it in the IDE, | ||
| # the file watcher reloads. | ||
|
|
||
| services: | ||
| workspace: | ||
| image: mcr.microsoft.com/devcontainers/java:1-21 | ||
| volumes: | ||
| - ../..:/workspaces/${localWorkspaceFolderBasename:-open-ecosystem-challenges}:cached | ||
| command: sleep infinity | ||
| environment: | ||
| # Pre-set FLAGD_HOST so participants who switch to RPC mode in | ||
| # OpenFeatureConfig do not have to hard-code the hostname. | ||
| - FLAGD_HOST=flagd | ||
| - FLAGD_PORT=8013 | ||
| # The trial's country of registration. Used by OpenFeatureConfig | ||
| # via System.getenv("COUNTRY") to populate the global eval context. | ||
| # `de` by default so F5 / Spring Boot Dashboard runs already exercise | ||
| # the country-targeting branch. Override with run-austria.sh or | ||
| # `COUNTRY=at ./mvnw spring-boot:run` to flip. | ||
| - COUNTRY=de | ||
|
|
||
| flagd: | ||
| image: ghcr.io/open-feature/flagd:v0.15.4 | ||
| container_name: side-effects-intermediate-flagd | ||
| volumes: | ||
| - ../..:/workspaces/${localWorkspaceFolderBasename:-open-ecosystem-challenges}:ro | ||
| command: | ||
| - start | ||
| - --uri | ||
| - file:/workspaces/${localWorkspaceFolderBasename:-open-ecosystem-challenges}/adventures/planned/00-blind-by-design/intermediate/flags.json | ||
| # No `ports:` block β the lab reaches flagd on the docker-internal | ||
| # network as `flagd:8013`. Only :8080 is forwarded into the Codespace. |
30 changes: 30 additions & 0 deletions
30
.devcontainer/00-blind-by-design_02-intermediate/post-create.sh
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
|
|
||
| # shellcheck disable=SC1091 | ||
| source "$REPO_ROOT/lib/scripts/tracker.sh" | ||
| set_tracking_context "00-blind-by-design" "intermediate" | ||
| track_codespace_created | ||
|
|
||
| "$REPO_ROOT/lib/shared/init.sh" --version v0.17.0 # https://github.com/charmbracelet/gum/releases | ||
|
|
||
| # jq is needed by verify.sh; the Java devcontainer image is debian-based. | ||
| if ! command -v jq >/dev/null 2>&1; then | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y --no-install-recommends jq | ||
| fi | ||
|
|
||
| CHALLENGE_DIR="$REPO_ROOT/adventures/planned/00-blind-by-design/intermediate" | ||
|
|
||
| # Make the Maven wrapper executable so the participant can just `./mvnw ...` | ||
| if [[ -f "$CHALLENGE_DIR/mvnw" ]]; then | ||
| chmod +x "$CHALLENGE_DIR/mvnw" | ||
| fi | ||
|
|
||
| echo "β¨ Pre-warming the Maven dependency cache so the first ./mvnw is fast..." | ||
| ( cd "$CHALLENGE_DIR" && ./mvnw -q -DskipTests dependency:go-offline ) || \ | ||
| echo "β οΈ Dependency pre-warm skipped (network or wrapper not ready yet)" | ||
|
|
||
| echo "β Post-create complete." |
53 changes: 53 additions & 0 deletions
53
.devcontainer/00-blind-by-design_02-intermediate/post-start.sh
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
| CHALLENGE_DIR="$REPO_ROOT/adventures/planned/00-blind-by-design/intermediate" | ||
|
|
||
| cat <<EOF | ||
|
|
||
| β¨ Level 2 - π‘ Intermediate (Outcome by cohort) | ||
|
|
||
| π Challenge directory: | ||
| $CHALLENGE_DIR | ||
|
|
||
| π§ͺ Sibling services already running (managed by devcontainer compose): | ||
| - flagd β reachable inside the compose network as flagd:8013 (gRPC). | ||
| No host-side forwarding β the lab calls it container-to-container. | ||
|
|
||
| βΆ Run the lab β three named launch configs ship in .vscode/launch.json: | ||
| π©πͺ Run the Lab β Germany (COUNTRY=de) | ||
| π¦πΉ Run the Lab β Austria (COUNTRY=at) | ||
| π Run the Lab β No country | ||
| Open the Run and Debug view (Ctrl/Cmd + Shift + D) and pick one. | ||
|
|
||
| Or from the terminal: | ||
| ./run-germany.sh # COUNTRY=de + tee app.log | ||
| ./run-austria.sh # COUNTRY=at + tee app.log | ||
|
|
||
| π In another terminal, exercise the cohorts: | ||
| curl 'http://localhost:8080/?species=zyklop' # per-subject targeting | ||
| curl 'http://localhost:8080/' # falls through to country branch | ||
|
|
||
| β Run the verification when you're ready: | ||
| ./verify.sh | ||
| or use the π§ͺ Verify Solution task: Tasks β Run Test Task. | ||
|
|
||
| EOF | ||
|
|
||
| # Track that the environment is ready | ||
| # shellcheck disable=SC1091 | ||
| source "$REPO_ROOT/lib/scripts/tracker.sh" | ||
| set_tracking_context "blind-by-design" "intermediate" | ||
| track_codespace_initialized | ||
|
|
||
| # Open the relevant files in the connected editor. customizations.codespaces.openFiles | ||
| # is unreliable for dockerComposeFile-based devcontainers (the orchestrator merges | ||
| # devcontainer.json and the field is sometimes dropped). `code` is the same CLI the | ||
| # editor uses internally and works against either the web or desktop client. | ||
| if command -v code >/dev/null 2>&1; then | ||
| code "$REPO_ROOT/adventures/planned/00-blind-by-design/docs/intermediate.md" \ | ||
| "$CHALLENGE_DIR/src/main/java/dev/openfeature/demo/java/demo/OpenFeatureConfig.java" \ | ||
| "$CHALLENGE_DIR/flags.json" \ | ||
| 2>/dev/null || true | ||
| fi | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple ports mentioned here but only 8080 is forwarded in devcontainer.json. is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As everything happens in teh terminal: do we even need to forward any port?