Readthedocs.org: Shallow clone breaks build

Created on 23 Dec 2018  路  15Comments  路  Source: readthedocs/readthedocs.org

Details

Expected Result

The build, which utilizes the reno.sphinxext module, should work.

Actual Result

The build fails due to missing tags. These are presumably missing due to the shallow cloning of repos introduced in #4939.

Additional Information

The original issue that #4939 purported to resolve was #1888, Optional use of shallow clone for git repos (emphasis mine). While shallow clone might be useful at large, it should be possible to disable it for projects that rely on git history to build their docs.

Improvement design decision

Most helpful comment

@stephenfin done for git-pw, patchwork and infrared. Please, if you have any issue open a new one to continue the discussion there. Thanks!

I triggered a build manually in git-pw and it worked ;)

All 15 comments

I'm guessing this is because the reno package needs the git history https://docs.openstack.org/reno/.

I'm guessing this is because the reno package needs the git history docs.openstack.org/reno.

Indeed :disappointed:

@stsewd I think we should add a Feature flag for these cases to omit shallowing.

We have to options here, feature flag (this can only be added by the core team), or an option in the web interface (this can be handled by the user).

Yeah, I've been looking at this. I see both approaches were adopted for submodules, with bd364946aa providing the feature flag approach and the later bfa6bdb346 providing a config file based approach. I'd been adding a git.shallow_clone setting using the latter approach based on the idea that pretty much everyone using reno or similar tools would be affected. I'm not sure how the config file ties into the web interface though and I don't see submodule configuration there. Is this a third option?

We can't have this option in the config file because the config file is parsed after the clone step. And we don't have the submodules option on the web because we are moving all per-version settings to the config only, all per-project settings will be available on the web.

Oh, of course 馃う I guess web UI is the way to go so, though I'm not sure where to nestle that in.

feature flag (this can only be added by the core team), or an option in the web interface (this can be handled by the user).

Feature flag is the way to go. Admin option is overkill I'd say. I don't expect to have this problem too often.

See above. I've a pull request which should resolve this using the feature flag.

We can't have this option in the config file because the config file is parsed after the clone step

Weird idea: I think that in the future we could do a simple/plain first clone of the repo to get the config file and make more decisions after parsing the YAML file (like running another git command to get the full history of the repo). This way will help us to create a "more fully configuration YAML".

@humitos I was thinking that we can use the providers API to fetch only the yaml, I think Travis does that.

This is now deployed behind a feature flag, if anyone needs this functionality, just ask an admin.

This is now deployed behind a feature flag, if anyone needs this functionality, just ask an admin.

How does one do this? I'd like this enabled for git-pw.readthedocs.io and patchwork.readthedocs.io, and I've been told by colleagues that infrared.readthedocs.io is also broken.

@stephenfin done for git-pw, patchwork and infrared. Please, if you have any issue open a new one to continue the discussion there. Thanks!

I triggered a build manually in git-pw and it worked ;)

Feature flag is the way to go. Admin option is overkill I'd say. I don't expect to have this problem too often.

Is that the final decision? I think anyone who includes Git commit info in their docs using something like sphinx-git will hit this problem. Moreover, it's a time bomb. Builds will work fine for a while, then one day, once commits you are referencing have fallen out of the shallow clone, builds will start failing, complaining that commit hashes you're referring to can't be found.

I understand prioritizing other work - but this seems like it represents a lot of ongoing maintenance work for support, and also is confusing to users IMO.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

humitos picture humitos  路  4Comments

jaraco picture jaraco  路  4Comments

goerz picture goerz  路  4Comments

SylvainCorlay picture SylvainCorlay  路  3Comments

humitos picture humitos  路  3Comments