woodpecker-ci / woodpecker-ci/plugin-git

[Feature] Support `submodule_override` for nested submodules

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
25
Forks
40
Avg merge
22h 23m
Merged PRs (30d)
6

Description

Would be suuper cool to support nested submodule path overrides

clone:
  git:
    image: woodpeckerci/plugin-git
    settings:
      recursive: true
      submodule_override:
        first_submodule_path: <url for first_submodule_path>
        # The following does not apply when git recurses into first_submodule_path
        first_submodule_path/other_dir/nested_submodule: <url for nested_submodule>

I am trying to override the github url of my submodules to a local git server

Example output:

+ git submodule update --init --recursive
Cloning into '/woodpecker/src/{woodpecker_url}/{main_repo_path}'...
Submodule path '{first_submodule}': checked out 'f5a8687e04965c597e534f9afe2935aedd1a4753' 
Cloning into '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule'...
fatal: could not read Username for 'https://github.com': No such device or address
fatal: clone of '{{nested_module_url}}' into submodule path '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule' failed
Failed to clone 'other_dir/nested_submodule'. Retry scheduled 
Cloning into '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule'...
fatal: could not read Username for 'https://github.com': No such device or address
fatal: clone of '{{nested_module_url}}' into submodule path '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule' failed
Failed to clone 'other_dir/nested_submodule' a second time, aborting
fatal: Failed to recurse into submodule path '{first_submodule}'
exit status 1 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the plugin handles clone.git.settings.recursive and submodule_override, then reproduce the nested-submodule example from the issue. Done means a nested path such as first_submodule_path/other_dir/nested_submodule uses its configured local URL during recursive cloning instead of the original GitHub URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
ci-cd, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.