Skip to content

feat(service): one image per devcontainer.json, listed in POST /build's images - #60

Merged
alexanderilyin merged 1 commit into
mainfrom
feat/multi-config-builds
Oct 7, 2026
Merged

alexanderilyin merged 1 commit into
mainfrom
feat/multi-config-builds

Conversation

@alexanderilyin

Copy link
Copy Markdown
Member

Service side of plan 004 (Phase B, step 1). Recorded in ADR-0015.

What changes

  • Discovery (service/src/config-discovery.ts):
    • The root config is main. .devcontainer/devcontainer.json wins over .devcontainer.json.
    • Each .devcontainer/<folder>/devcontainer.json is its own item. Its id is the folder name lower-cased, with anything outside [a-z0-9-] turned into - and leading and trailing - trimmed.
    • Order: main first, then the folders by id. Symlinked folders and files are skipped.
    • Id collisions and empty ids are a 400 that names the folders.
  • Build (build.ts): one clone, then buildInstance() for each item, one after another.
    • Sub-folder items pass --config. main keeps exactly today's argv.
    • The config label and the remote-user probe use each item's own config.
    • Each item has its own span, log (imageBuildLogId) and timeout.
    • If an item fails, the request fails, and when there are several items the error names the images already pushed.
  • API, additive (1.x stays compatible):
    • The response adds images: [{id, configPath, image, registry, name, tag, imageBuildLogId?}]. The existing top-level fields describe images[0].
    • New optional request fields: instances (a filter; an unknown id is a 400 listing the valid ids) and dryRun (clone, discover and name only, with no build or push).
  • Naming: main keeps its name. Other items get <name>-<id>, including when image.name is set explicitly. The same tag and registry apply to every item.
  • Fallback image: used only when no config exists at any location. Without a fallback image, that case is now a 400 instead of the CLI's 500.
  • Metrics: a successful dry run counts as status="dry_run".

GET /devcontainer and GET/DELETE /image are unchanged and still take one image.

Tests

  • npm run build && npm run test:unit pass: 76 tests.
  • New unit tests cover:
    • discovery: root only, the precedence between the two root locations, folders only, root plus folders, nesting and symlinks, id sanitizing, collisions and empty ids;
    • the instances filter;
    • image naming;
    • the --config argv;
    • the request and response schema.
  • devcontainer_config_discovery.feature is rewritten, with new test-git-server seed repos (extraConfigPaths). The BDD suite was not run, because it needs the cluster. cucumber-js --dry-run matches every step.

Next

The provider's images/instances/dry run in ModifyPlan, then the module and the template (plan 004 steps 2-5).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05d03237-288f-4182-998c-d2529d35380c
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…'s images

Discover every devcontainer.json in the clone - the root config as
`main`, each .devcontainer/<folder>/devcontainer.json as an item whose id
is the sanitized folder name - and build them one after another, passing
--config for sub-folder configs. Each item's config label and remote-user
probe use its own config and image.

Additive to the 1.x API (ADR-0015): the response keeps
image/registry/name/tag/imageBuildLogId, now describing images[0], and
adds images[]. New optional request fields: instances (filter; unknown id
is a 400 listing valid ids) and dryRun (clone, discover and name only).
Folder items are named <name>-<id>; tags apply to all items. Id
collisions and empty ids are 400s. fallbackImage applies only when no
config exists anywhere; without one that case is now a 400 instead of
the CLI's 500.

Extends devcontainer_config_discovery.feature and test-git-server seed
repos (extraConfigPaths) for multi-config repos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexanderilyin
alexanderilyin force-pushed the feat/multi-config-builds branch from 12191c2 to ad82da2 Compare October 7, 2026 14:20
@alexanderilyin
alexanderilyin merged commit a4ddb21 into main Oct 7, 2026
9 checks passed
@alexanderilyin
alexanderilyin deleted the feat/multi-config-builds branch October 7, 2026 14:23
alexanderilyin added a commit that referenced this pull request Oct 7, 2026
revert: one image per devcontainer.json (#60) - feature abandoned
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.

1 participant