Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git repositories using submodules do not work #88

Open
andreabedini opened this issue Oct 17, 2023 · 0 comments · May be fixed by #89
Open

Git repositories using submodules do not work #88

andreabedini opened this issue Oct 17, 2023 · 0 comments · May be fixed by #89

Comments

@andreabedini
Copy link
Member

andreabedini commented Oct 17, 2023

input-output-hk/hydra is in this unfortunate situation.

We fetch a tarball for the repo using GitHub API. Like

❯ curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://github.com/input-output-hk/hydra/tarball/9f1027e0fdff6765f5233f19c4639fdaa3558bfa -o tmp.tgz

but that tarball does not contain the git submodules. It does include .gitmodules

❯ cat .gitmodules
[submodule "testnet/cardano-configurations"]
        path = hydra-cluster/config/cardano-configurations
        url = https://github.com/input-output-hk/cardano-configurations.git
[submodule "hydra-node/json-schemas/cardanonical"]
        path = hydra-node/json-schemas/cardanonical
        url = https://github.com/CardanoSolutions/cardanonical

but AFAIU the information about what commit they are supposed to be checkout out at is stored in the repository's .git folder, and therefore not part of the tarball.

It seems possible to obtain that information with a single api query

❯ curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/input-output-hk/hydra/contents/hydra-cluster/config/cardano-configurations\?ref=9f1027e0fdff6765f5233f19c4639fdaa3558bfa
{
  "name": "cardano-configurations",
  "path": "hydra-cluster/config/cardano-configurations",
  "sha": "f414e7b59a0f100d340b7368bc474e023c26c9f5",
  "size": 0,
  "url": "https://api.github.com/repos/input-output-hk/hydra/contents/hydra-cluster/config/cardano-configurations?ref=9f1027e0fdff6765f5233f19c4639fdaa3558bfa",
  "html_url": "https://github.com/input-output-hk/cardano-configurations/tree/f414e7b59a0f100d340b7368bc474e023c26c9f5",
  "git_url": "https://api.github.com/repos/input-output-hk/cardano-configurations/git/trees/f414e7b59a0f100d340b7368bc474e023c26c9f5",
  "download_url": null,
  "type": "submodule",
  "submodule_git_url": "https://github.com/input-output-hk/cardano-configurations.git",
  "_links": {
    "self": "https://api.github.com/repos/input-output-hk/hydra/contents/hydra-cluster/config/cardano-configurations?ref=9f1027e0fdff6765f5233f19c4639fdaa3558bfa",
    "git": "https://api.github.com/repos/input-output-hk/cardano-configurations/git/trees/f414e7b59a0f100d340b7368bc474e023c26c9f5",
    "html": "https://github.com/input-output-hk/cardano-configurations/tree/f414e7b59a0f100d340b7368bc474e023c26c9f5"
  }
}

but #80 is also an alternative.

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 a pull request may close this issue.

1 participant