OCR-D / quiver-back-end

The back end of the OCR-D quality dashboard webapp.
MIT License
1 stars 2 forks source link

19 fix ci #20

Closed mweidling closed 2 years ago

mweidling commented 2 years ago

This PR implements cloning of all of ocrd_all's submodules which is necessary for the creation of repos.json.

It consists of the somewhat strange line

git submodule foreach --recursive 'git submodule update --init --remote' || exit 0

which causes the step to be always successful. This is necessary because git submodule update --init --recursive interferes with the private submodules in cor-asv-ann and git submodule update --init --remote cannot handle eynollah's default branch main (instead of master). The necessary info for the creation of repos.json is present, though.

Closes #19.

kba commented 2 years ago

and git submodule update --init --remote cannot handle eynollah's default branch main (instead of master).

That is strange, branch names should not be an issue for submodules, they are linked to a specific commit SHA not branch name - can you post a link to the failing CI for this? Because we do essentially the same git submodule update --init for most processors and git submodule update --init --recursive for some specific projects in ocrd_all and it works there.

mweidling commented 2 years ago

and git submodule update --init --remote cannot handle eynollah's default branch main (instead of master).

That is strange, branch names should not be an issue for submodules, they are linked to a specific commit SHA not branch name - can you post a link to the failing CI for this? Because we do essentially the same git submodule update --init for most processors and git submodule update --init --recursive for some specific projects in ocrd_all and it works there.

Mmh, I ran git submodule foreach 'git submodule update --init --remote' (without the hack with the exit code) only locally and received

Unable to find current origin/master revision in submodule path 'eynollah'
Stopping at 'submodules/ocrd_all'; script returned non-zero status.

Do you think it's worth trying it again in a runner?

kba commented 2 years ago

I guess this happens because the --remote part - what is the purpose of that?

mweidling commented 2 years ago

I guess this happens because the --remote part - what is the purpose of that?

You're right, it's because --remote assumes that master is the default branch. TBH i followed the instructions on https://git-scm.com/book/en/v2/Git-Tools-Submodules where they suggest using this flag, but while re-reading the docs I realized their case doesn't apply to ocrd_all.

However, removing the flag yields the old problem with cor-asv-ann:

Entering 'submodules/ocrd_all/cor-asv-ann'
fatal: remote error: upload-pack: not our ref 66c4711918d4fe87cc200744b614e1757874f8f2
fatal: The remote end hung up unexpectedly
Fetched in submodule path 'data-processing', but it did not contain 66c4711918d4fe87cc200744b614e1757874f8f2. Direct fetching of that commit failed.
Stopping at 'submodules/ocrd_all/cor-asv-ann'; script returned non-zero status.

That's why || exit 0 still makes sense, I guess.