Skip to content

feat(cmd): add features info/resolve-deps/generate-docs commands - #219

Merged
skevetter merged 4 commits into
mainfrom
feat/features-commands
May 4, 2026
Merged

feat(cmd): add features info/resolve-deps/generate-docs commands#219
skevetter merged 4 commits into
mainfrom
feat/features-commands

Conversation

@skevetter

@skevetterskevetter commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add new features command group with 3 subcommands
  • features info <feature-id> — fetch and display OCI feature metadata
  • features resolve-dependencies — resolve feature install order from devcontainer.json
  • features generate-docs — generate markdown docs from feature source
  • E2E tests for registry queries, unit tests for logic

Summary by CodeRabbit

Release Notes

  • New Features
    • Added features command with three subcommands: info, generate-docs, and resolve-dependencies
    • Generate feature documentation in Markdown or JSON format from feature metadata
    • View published feature information with optional registry tag listing
    • Resolve feature installation order and dependencies with text or JSON output

Add new `features` command group with three subcommands:
- `features info <feature-id>` fetches and displays OCI metadata
- `features resolve-dependencies` resolves feature install order
- `features generate-docs` generates markdown docs from feature src/
Exports PullFeatureToTemp and ResolveFeatureOrder from the feature
package to support the new commands.
@netlify

netlifyBot commented May 4, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

NameLink
🔨 Latest commit987cd54
🔍 Latest deploy loghttps://app.netlify.com/projects/devsydev/deploys/69f91b2229b8cb00072b9687

@coderabbitai

coderabbitaiBot commented May 4, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb228325-2884-4694-91fb-fa259b4483cd

📥 Commits

Reviewing files that changed from the base of the PR and between 80e7b08 and 987cd54.

📒 Files selected for processing (13)
  • cmd/features/generatedocs.go
  • cmd/features/generatedocs_test.go
  • cmd/features/info.go
  • cmd/features/info_test.go
  • cmd/features/output.go
  • cmd/features/resolvedeps.go
  • cmd/features/resolvedeps_test.go
  • cmd/features/root.go
  • cmd/root.go
  • e2e/e2e_suite_test.go
  • e2e/tests/features/features.go
  • pkg/devcontainer/feature/extend.go
  • pkg/devcontainer/feature/features.go

📝 Walkthrough

Walkthrough

Introduces a new features CLI command group with three subcommands (info, resolve-dependencies, generate-docs) for managing feature metadata. The info command fetches OCI metadata for published features; resolve-dependencies computes installation order from configurations; and generate-docs scans projects and generates markdown documentation and indices. Includes CLI command implementations, backend helper functions, and comprehensive unit and E2E tests.

Changes

Features Command Suite

Layer / File(s)Summary
Core Output Formatting
cmd/features/output.go
Defines supported formats ("text", "json"), validates output format selection, and provides JSON marshaling with io.Writer support.
Command Implementations
cmd/features/info.go, cmd/features/resolvedeps.go, cmd/features/generatedocs.go
InfoCmd fetches and displays OCI-backed feature metadata with optional tag/dependency listings; ResolveDepsCmd resolves feature installation order from devcontainer configs; GenerateDocsCmd scans feature projects and generates Markdown documentation with metadata tables and index files.
Command Root & CLI Registration
cmd/features/root.go, cmd/root.go
NewFeaturesCmd assembles the three subcommands; root integration adds the features command to the main CLI tree.
Backend Feature Utilities
pkg/devcontainer/feature/extend.go, pkg/devcontainer/feature/features.go
ResolveFeatureOrder exposes feature topological sorting; PullFeatureToTemp pulls OCI features and extracts them to cache with annotation persistence.
Unit Tests
cmd/features/info_test.go, cmd/features/resolvedeps_test.go, cmd/features/generatedocs_test.go
Flag defaults, argument validation, error handling for invalid formats/references, feature scanning, and markdown/JSON output generation are verified.
E2E Tests & Harness
e2e/e2e_suite_test.go, e2e/tests/features/features.go
Registers feature test suite; E2E tests verify command outputs (install order, markdown generation, metadata display) against temporary projects and in-memory registry with OCI layer building helpers.

Sequence Diagram

sequenceDiagram
participant Client as Client
participant CLI as info Command
participant Registry as OCI Registry
participant Temp as Temp Folder
participant Parser as Config Parser
participant Display as Display
Client->>CLI: features info <reference>
CLI->>CLI: Validate output format
CLI->>Registry: Parse feature reference
CLI->>Registry: Pull OCI feature image
Registry->>Temp: Extract feature to cache
Temp->>Parser: Load devcontainer-feature.json
Parser->>Parser: Parse config & annotations
alt show-tags enabled
CLI->>Registry: List available tags
Registry-->>CLI: Tag list
end
alt show-dependencies enabled
Parser->>Parser: Extract dependencies
end
Parser->>Parser: Extract options metadata
alt output == json
CLI->>Display: Marshal as pretty JSON
else output == text
CLI->>Display: Format as text table
Display->>Display: Print metadata fields
Display->>Display: Print optional sections
end
Display-->>Client: Output to stdout
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • devsy-org/devsy#74: Modifies feature cache/temp path resolution in pkg/devcontainer/feature/features.go, related to the path resolution used by PullFeatureToTemp.
  • devsy-org/devsy#210: Alters feature ordering behavior in pkg/devcontainer/feature/extend.go, directly related to ResolveFeatureOrder implementation.
  • devsy-org/devsy#213: Changes fetchFeatures signature in pkg/devcontainer/feature/extend.go to accept secret options, affecting the function called by ResolveFeatureOrder.

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 and usage tips.

@skevetterskevetter changed the title feat(cmd): add features info/resolve-deps/generate-docs commands (DEVSY-042)feat(cmd): add features info/resolve-deps/generate-docs commandsMay 4, 2026
- Populate Options field in buildResolvedList from FeatureSet.Options
- Add output format validation to info and resolve-dependencies commands
- Add unit tests for info subcommand (flag parsing, error handling)
- Add E2E tests for resolve-dependencies and generate-docs subcommands
- Add --output text|json flag to generate-docs command with JSON output path
- Create local feature directories in E2E resolve-deps tests so ./local-features
references resolve correctly
- Replace live ghcr.io network call in TestResolveDepsCmd_WithOptions with local
feature path for offline test execution
- Show options and annotations in features info default output (not gated by
--verbose)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@skevetter