Subrepositories crash Project home pages
In recent Heptapod versions, the programming languages and license analysis is done directly on the Mercurial repository, with HGitaly actually performing it in the CommitLanguages
and FindLicense
gRPC methods.
On repositories with subrepositories, these analysis methods fail with the gRPC INTERNAL
error code. At least in the case of FindLicense
, it gives an immediate crash (HTTP 500) on the Project home page.
The Mercurial log show our message: "Updating subrepos on the server side is not supported in this version of Heptapod and would be actually harmful. This may be reenabled in a subsequent version."
The reason is that these use temporary working directories, in which updating to the wished revision (typically the current head of the default
branch) wants to recurse into subrepositories and that is strictly prohibited in Heptapod for good reasons (see #310 (closed)). With the systematic use of temporary working directories, we would be in a better shape than we were at the time of this latter issue (not having to deal with changes in subrepos definitions), but the problem remains that subrepos definitions can not be interpreted on the server side (repositories layout is very different from what it is typically in a developer setup), and if they could, it would be an avenue for security compromission.
What we can do in the short run is either to fix the crash (worst case, at the expanse of correct analysis results) or find a way to prevent recursion in subrepositories on working directory update (hence with correct, non-recursive, results).