Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions adventures/planned/00-blind-by-design/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target/

# The repo root .gitignore excludes .vscode/ globally. Re-include the
# launch + task configs that ship as part of this scenario β€” they are not
# editor preferences, they are the F5 / Run-and-Debug entry points the
# participant uses to start the lab.
!*/.vscode/
!*/.vscode/**
12 changes: 12 additions & 0 deletions adventures/planned/00-blind-by-design/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# πŸ§ͺ Adventure 00: Blind by Design

A research lab is testing a vision-enhancement serum on volunteers. The serum is supposed to take ordinary eyes and produce sharper, even enhanced sight. The lab is a Spring Boot service; OpenFeature is the chart system; `flags.json` decides what reading the lab records for each subject. The protocol is the same for everyone β€” what differs is the observed outcome, because subjects come in with different biology, dose adherence, and trial-jurisdiction baseline. The flagship Phase 3 trial β€” a new amplifier algorithm β€” has started showing trouble: subjects stabilise slower, and roughly one in ten emerge blind. The dashboard that should be tracking all of this is dark. Your mission across three levels: stand up the lab, read the chart by cohort, then turn on the lights and roll back the trial before more subjects lose their sight.

**Technologies:** OpenFeature Java SDK, flagd, Spring Boot, Grafana LGTM (Tempo + Prometheus + Loki), Testcontainers

The entire **infrastructure is pre-provisioned in your Codespace**.
**You don't need to set up anything locally. Just focus on solving the problem.**

## πŸš€ Ready to Start?

[Choose your level](https://dynatrace-oss.github.io/open-ecosystem-challenges/00-blind-by-design/) and begin learning!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
14 changes: 14 additions & 0 deletions adventures/planned/00-blind-by-design/beginner/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "πŸ§ͺ Run the Lab",
"request": "launch",
"mainClass": "dev.openfeature.demo.java.demo.Laboratory",
"projectName": "demo",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}"
}
]
}
14 changes: 14 additions & 0 deletions adventures/planned/00-blind-by-design/beginner/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "πŸ§ͺ Verify Solution",
"type": "shell",
"command": "./verify.sh",
"options": { "cwd": "${workspaceFolder}" },
"problemMatcher": [],
"presentation": { "reveal": "always", "panel": "dedicated" },
"group": { "kind": "test", "isDefault": true }
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "πŸ§ͺ Adventure 00 | 🟒 Beginner (Stand up the lab)",
"dockerComposeFile": "docker-compose.yml",
"service": "workspace",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/adventures/planned/00-blind-by-design/beginner",
"postCreateCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/00-blind-by-design_01-beginner/post-create.sh",
"postStartCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/00-blind-by-design_01-beginner/post-start.sh",
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"vmware.vscode-spring-boot",
"vscjava.vscode-spring-boot-dashboard",
"redhat.vscode-xml"
]
},
"codespaces": {
"openFiles": [
Comment thread
aepfli marked this conversation as resolved.
"adventures/planned/00-blind-by-design/docs/beginner.md",
"adventures/planned/00-blind-by-design/beginner/src/main/java/dev/openfeature/demo/java/demo/Trial.java",
"adventures/planned/00-blind-by-design/beginner/flags.json"
]
}
},
"forwardPorts": [8080],
"portsAttributes": {
Comment thread
aepfli marked this conversation as resolved.
"8080": { "label": "Lab (Spring Boot)", "onAutoForward": "notify" }
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Multi-container devcontainer for Beginner. The lab itself runs in
# `workspace`; flagd runs as a sibling so participants meet the realistic
# shape ("the SDK talks RPC to a separate flag service") from level 1
# instead of running file-mode in-process and throwing it away for
# Intermediate.
#
# 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, the next request sees the new variant.

services:
workspace:
image: mcr.microsoft.com/devcontainers/java:1-21
volumes:
- ../..:/workspaces/${localWorkspaceFolderBasename:-open-ecosystem-challenges}:cached
command: sleep infinity
environment:
# The flagd Java provider reads these env vars by default when
# FlagdOptions.builder() is invoked without an explicit host/port.
# Pre-set so a vanilla `Resolver.RPC` config Just Works inside the
# devcontainer β€” and a participant who runs the lab from their host
# machine after `docker compose up flagd` will hit `localhost:8013`
# via the published port.
- FLAGD_HOST=flagd
- FLAGD_PORT=8013

flagd:
image: ghcr.io/open-feature/flagd:v0.15.4
container_name: side-effects-beginner-flagd
volumes:
- ../..:/workspaces/${localWorkspaceFolderBasename:-open-ecosystem-challenges}:ro
command:
- start
- --uri
- file:/workspaces/${localWorkspaceFolderBasename:-open-ecosystem-challenges}/adventures/planned/00-blind-by-design/beginner/flags.json
# No `ports:` block β€” the lab reaches flagd on the docker-internal
# network as `flagd:8013`. We deliberately do not publish to the host:
# only :8080 is forwarded into the Codespace, so participants see one
# port to click in the Ports tab.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
CHALLENGE_DIR="$REPO_ROOT/adventures/planned/00-blind-by-design/beginner"

# shellcheck disable=SC1091
source "$REPO_ROOT/lib/scripts/tracker.sh"
set_tracking_context "00-blind-by-design" "beginner"
track_codespace_created

# Install gum (used by the verify.sh output helpers).
"$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

# Java 21 is provided by the devcontainer image (mcr.microsoft.com/devcontainers/java:1-21-bullseye).
# Pre-fetch Maven dependencies so the IDE is responsive immediately.
Comment thread
aepfli marked this conversation as resolved.
echo "✨ Resolving Maven dependencies for the lab..."
cd "$CHALLENGE_DIR"
chmod +x ./mvnw
./mvnw -q -B -DskipTests dependency:go-offline || true

echo "βœ… Post-create complete."
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -e

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
CHALLENGE_DIR="$REPO_ROOT/adventures/planned/00-blind-by-design/beginner"

cat <<EOF

✨ Adventure 00 β€” Level 1 (🟒 Beginner): Stand up the lab

πŸ“‚ Challenge directory:
$CHALLENGE_DIR

🧬 A flagd sidecar is already running next to your workspace
- gRPC eval :8013 (this is what your FlagdProvider will talk to)
- management :8014 (Prometheus metrics + /healthz, /readyz)
- sync :8015 (used in the Intermediate IN_PROCESS sidebar)
- OFREP :8016 (HTTP eval API, handy for poking flagd directly)
FLAGD_HOST=flagd is exported into this shell, so a default
Resolver.RPC config picks the sidecar up automatically.

β–Ά Run the lab β€” one launch config in .vscode/launch.json:
πŸ§ͺ Run the Lab
Open the Run and Debug view (Ctrl/Cmd + Shift + D) and hit β–Ά.

Or from the terminal:
./mvnw spring-boot:run

πŸ‘‰ In another terminal, hit it:
curl -s http://localhost:8080/ | jq

βœ… 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"
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/beginner.md" \
"$CHALLENGE_DIR/src/main/java/dev/openfeature/demo/java/demo/Trial.java" \
2>/dev/null || true
fi
36 changes: 36 additions & 0 deletions adventures/planned/00-blind-by-design/beginner/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ============================================================================
# Makefile for Blind by Design - Beginner Level: Stand up the lab
# ============================================================================
# This Makefile provides convenient commands for running
# the Spring Boot lab and verifying your solution.
# ============================================================================

.PHONY: help lab probe verify

# Default target - show help
help:
@echo "Blind by Design - Beginner Level: Stand up the lab"
@echo ""
@echo "Application:"
@echo " make lab - Start the Spring Boot lab on :8080"
@echo " make probe - Hit the lab endpoint and pretty-print the response"
@echo ""
@echo "Verification:"
@echo " make verify - Run verification checks"

# ----------------------------------------------------------------------------
# Application Targets
# ----------------------------------------------------------------------------

lab:
@./mvnw spring-boot:run

probe:
@curl -s http://localhost:8080/ | jq

# ----------------------------------------------------------------------------
# Verification Targets
# ----------------------------------------------------------------------------

verify:
@./verify.sh
3 changes: 3 additions & 0 deletions adventures/planned/00-blind-by-design/beginner/flags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flags": {}
}
Loading