Skip to content

fix(inventory-agentic): working Codespaces/Dev Container setup + GitHub onboarding in Challenge 1 - #608

Merged
Marco Weber (qxsch) merged 3 commits into
microsoft:mainfrom
Digvijay:fix/inventory-agentic-codespaces
Nov 9, 2026
Merged

Marco Weber (qxsch) merged 3 commits into
microsoft:mainfrom
Digvijay:fix/inventory-agentic-codespaces

Conversation

@Digvijay

Copy link
Copy Markdown

Fixes the Agentic Inventory Planning hack setup reported by the first delivery team (Fatih Durgut): the Codespace had no Python, post-create.sh was never called, and Challenge 1 had no GitHub account / fork / Codespaces steps.

Root causes

  • Codespaces uses the repo-root config .devcontainer/03-azure-01-04-ai-03-inventory-planning-agentic/devcontainer.json, which was a bare base:ubuntu image with no Python, no tooling and no postCreateCommand. The hack-local .devcontainer/ (which had the hook) is ignored by Codespaces.
  • Hard-coded /workspaces/microhack paths break for forks with unique names (microhack-labuser-0001).
  • lab-defaults.json had groups: [], so lab users got no GitHub account.

Changes

  • Root dev container: python:3.12-bookworm + Azure CLI + azd + gh, runs post-create.sh, forwards port 8000, paths via ${localWorkspaceFolderBasename}. Same pattern as Fraud Intelligence.
  • post-create.sh: runs from any cwd, checks Python 3.11+, installs uv (pip, falling back to the astral installer), persists PATH, and uses a volume-backed src/.venv because Docker Desktop bind mounts fail with I/O errors on venv installs.
  • .gitattributes: LF for this hack's *.sh and the shared /.devcontainer/**/*.sh. welcome.sh currently fails on every local Windows clone with core.autocrlf=true.
  • lab-defaults.json: "groups": ["GHCPUsers"].
  • Challenge 1: Azure portal sign-in, GitHub sign-in via the IdP, fork with a unique name, Code → Codespaces → New with options → Azure / AI / Inventory Planning Agentic, local VS Code Dev Containers option, verification commands, and new troubleshooting rows. Screenshots are reused from Fraud Intelligence (images/setup-*.png).
  • README, walkthrough solution-01 and labautomation README updated to match.

Verification

Built the root config with @devcontainers/cli up on a simulated fork named microhack-labuser-0001 (Docker Desktop on Windows):

  • postCreate: Python 3.12.16, uv, 52 packages installed, src/.env seeded; postAttach welcome.sh OK
  • az, azd, gh present; PYTHONPATH set; app imports OK
  • uv run uvicorn ui.app:app --port 8000 → GET / 200 (/api/state returns 503 until az login + real .env values, as documented)

Not yet tested in an actual GitHub Codespace. Please have Fatih re-run Challenge 1 there before merging.

Digvijay Chauhan and others added 3 commits November 9, 2026 14:52
…ub onboarding in Challenge 1

- Root Codespaces config now uses the Python 3.12 image with Azure CLI, azd and gh,
  runs post-create.sh (uv sync + src/.env), forwards port 8000, and resolves paths
  via ${localWorkspaceFolderBasename} so uniquely named forks work.
- post-create.sh: runs from any cwd, checks Python 3.11+, installs uv with a
  fallback, persists uv on PATH, uses a volume-backed src/.venv (Docker Desktop
  bind mounts fail on venv installs).
- .gitattributes: force LF for this hack's and the shared /.devcontainer shell
  scripts so local Windows clones do not break post-create.sh / welcome.sh.
- lab-defaults.json: groups ["GHCPUsers"] so lab users get a GitHub account.
- Challenge 1: Azure portal sign-in, GitHub sign-in, fork, Codespace "New with
  options" + local Dev Containers path, verification, troubleshooting; with
  screenshots reused from the Fraud Intelligence hack.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…no GitHub credentials are emitted

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@qxsch
Marco Weber (qxsch) merged commit 6387c53 into microsoft:main Nov 9, 2026
2 checks passed
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