Skip to content

Feature Request: Per-Repository Dependency File Configuration #5

@AndreaV-Lsi

Description

@AndreaV-Lsi

Feature Request: Per-Repository Dependency File Configuration

Problem Statement

Currently, when recursive mode is enabled, LsiGitCheckout looks for dependency files in the root directory of each checked-out repository using the same filename as the script's input file. This approach has limitations:

  1. Fixed location: Dependency files must be in the repository root
  2. Fixed naming: All repositories must use the same dependency filename
  3. Organizational constraints: Cannot accommodate different repository structures or naming conventions

Proposed Solution

Add per-repository configuration options to customize dependency file location and naming:

New JSON Fields

{
  "Repository URL": "https://github.com/company/repo.git",
  "Base Path": "repos/repo",
  "Tag": "v1.0.0",
  "Dependency File Path": "config",           // NEW: Optional relative path
  "Dependency File Name": "custom-deps.json"  // NEW: Optional custom filename
}

Field Specifications

  • "Dependency File Path" (optional):

    • Relative path within the repository where the dependency file is located
    • If absent, defaults to repository root (current behavior)
    • Examples: "config", "build/scripts", "tools/dependencies"
  • "Dependency File Name" (optional):

    • Custom name for the dependency file in this repository
    • If absent, uses the script's input filename (current behavior)
    • Examples: "external-deps.json", "requirements.json", "project-deps.json"

Use Cases

1. Monorepo with Organized Structure

{
  "Repository URL": "https://github.com/company/monorepo.git",
  "Base Path": "repos/monorepo",
  "Tag": "v2.1.0",
  "Dependency File Path": "build/config",
  "Dependency File Name": "external-dependencies.json"
}
  • Looks for: repos/monorepo/build/config/external-dependencies.json

2. Legacy Project with Different Conventions

{
  "Repository URL": "https://github.com/company/legacy.git",
  "Base Path": "repos/legacy",
  "Tag": "v1.5.0",
  "Dependency File Path": "scripts",
  "Dependency File Name": "requirements.json"
}
  • Looks for: repos/legacy/scripts/requirements.json

3. Mixed Environment

Some repositories use default location, others use custom:

[
  {
    "Repository URL": "https://github.com/company/standard-repo.git",
    "Base Path": "repos/standard",
    "Tag": "v1.0.0"
    // Uses default: repos/standard/dependencies.json
  },
  {
    "Repository URL": "https://github.com/company/custom-repo.git",
    "Base Path": "repos/custom",
    "Tag": "v2.0.0",
    "Dependency File Path": "config",
    "Dependency File Name": "deps.json"
    // Uses custom: repos/custom/config/deps.json
  }
]

Benefits

  1. Flexibility: Accommodate different repository organizational structures
  2. Backward Compatibility: Existing configurations continue to work unchanged
  3. Mixed Environments: Support both standard and custom layouts in the same project
  4. Better Organization: Allow teams to organize dependency files according to their standards
  5. Legacy Support: Integrate repositories with existing dependency file naming conventions

Implementation Requirements

  • Add support for "Dependency File Path" field in JSON parsing
  • Add support for "Dependency File Name" field in JSON parsing
  • Modify recursive processing to use custom paths when specified
  • Add debug logging to show which dependency file path is being used
  • Update documentation with examples and field descriptions
  • Ensure backward compatibility with existing configurations
  • Add unit tests for new functionality

Acceptance Criteria

  • When "Dependency File Path" is specified, the script looks in that subdirectory
  • When "Dependency File Name" is specified, the script uses that filename
  • When neither field is specified, behavior is identical to current implementation
  • Both fields can be used independently or together
  • Clear debug logging indicates which dependency file path is being used
  • Documentation includes examples of all usage patterns
  • All existing configurations continue to work without modification

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions