Skip to content

Add repository-level project and workspace manifest discovery - #56

Open
abhinavgautam01 wants to merge 1 commit into
git-pkgs:mainfrom
abhinavgautam01:feature/project-workspace-discovery-55
Open

Add repository-level project and workspace manifest discovery#56
abhinavgautam01 wants to merge 1 commit into
git-pkgs:mainfrom
abhinavgautam01:feature/project-workspace-discovery-55

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

Closes #55

Summary

  • Add a rooted RepositoryReader API for repository-level manifest discovery.
  • Add an FSReader adapter supporting recursive glob patterns over fs.FS.
  • Discover registered manifests and lockfiles at the repository root.
  • Discover GitHub Actions workflows under .github/workflows.
  • Discover workspace members declared by:
    • Cargo workspaces, including exclusions
    • Go workspaces through go.work
    • npm and Yarn workspace configurations
    • pnpm workspace patterns and exclusions
  • Retain the selecting workspace configuration in DiscoveredManifest.ParentPath.
  • Return normalized, deterministic discovery results while rejecting paths outside the repository root.
  • Keep the existing single-file Parse API unchanged.

Implementation

Go workspace files are parsed using golang.org/x/mod/modfile. Recursive workspace patterns are resolved using doublestar, allowing the same discovery API to work over operating-system directories and historical Git-tree readers.

Malformed workspace configurations and reader failures are returned with contextual errors instead of silently producing incomplete results.

Testing

Added regression coverage for:

  • Root manifests, lockfiles, and path-based GitHub Actions workflows
  • Cargo members and exclusions
  • Quoted and unquoted go.work entries
  • npm array and Yarn object workspace formats
  • Recursive pnpm patterns and exclusions
  • Workspace parent provenance
  • Repository path traversal rejection
  • Invalid workspace configuration and reader errors

Verification

  • go build ./...
  • go mod tidy -diff
  • go test ./... -count=1
  • go test -race ./... -count=1
  • golangci-lint run ./...

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.

Add project and workspace manifest discovery

1 participant