Skip to content

fix up with template#23

Merged
PabloZaiden merged 3 commits into
mainfrom
fix-template
Apr 23, 2026
Merged

fix up with template#23
PabloZaiden merged 3 commits into
mainfrom
fix-template

Conversation

@PabloZaiden
Copy link
Copy Markdown
Owner

This pull request improves support for template-backed workspaces, especially around the handling of generated configuration paths for templates. It introduces new helpers to distinguish between current and legacy template config paths, normalizes state when migrating or resolving workspace config, and adds comprehensive tests for these behaviors. Additionally, it updates and expands test coverage to ensure template-based workspaces function correctly, including new example fixtures.

Template config path handling:

  • Added getTemplateGeneratedConfigPath and getLegacyTemplateGeneratedConfigPath helpers to distinguish between current (.devcontainer.json) and legacy (template.devcontainer.json) generated config paths for template-backed workspaces. Also introduced resolveTemplateGeneratedConfigPath to normalize and resolve these paths as needed.
  • Updated resolveWorkspaceConfig and migrateWorkspaceState to use these helpers for consistent and correct path resolution, ensuring backward compatibility with legacy state files. [1] [2] [3] [4]

Testing and fixtures:

  • Added a new example workspace fixture (template-workspace) and corresponding sample file for template-based scenarios.
  • Expanded test coverage to include template-backed workspaces, including live and simulated tests to verify correct behavior when starting from a template, rebuilding, and handling legacy state. [1] [2] [3]
  • Refactored example fixture setup to automatically detect and use the correct source and generated config paths, removing the need for a withoutDevcontainer flag. [1] [2] [3]

Test updates and assertions:

  • Updated test assertions to expect the correct template name and image (e.g., "ubuntu" instead of "bun") in template-backed workspace scenarios. [1] [2] [3]

Test imports and minor fixes:

  • Updated imports in test files to include new helpers and ensure consistency. [1] [2]

Copilot AI review requested due to automatic review settings April 23, 2026 13:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves template-backed workspace support by standardizing where template-generated devcontainer configs are written, while preserving backward compatibility for legacy saved state/config paths. It also expands fixture coverage and adds tests validating the new/legacy path behavior.

Changes:

  • Added explicit helpers for current vs. legacy template generated config paths and normalized path handling during state migration and workspace config resolution.
  • Updated example-workspace test fixtures to automatically detect source config paths and added/expanded template-backed workspace tests (simulated + live).
  • Added a new examples/template-workspace fixture for template-only scenarios.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/core.ts Introduces new template generated-config path helpers and normalizes legacy paths during resolution/migration.
tests/core.test.ts Adds coverage ensuring legacy template generated-config paths from saved state are normalized correctly.
tests/examples.test.ts Updates simulated example tests/fixture setup to support template-backed workspaces without special flags.
tests/examples.live.test.ts Adds a live test that validates starting a template workspace without a repo devcontainer.
examples/template-workspace/sample-file.txt Adds a template-only example fixture file used by tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PabloZaiden PabloZaiden enabled auto-merge (squash) April 23, 2026 14:00
@PabloZaiden PabloZaiden merged commit 0f2c73f into main Apr 23, 2026
1 check 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