GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Tests don't readily pass in forks · Issue #1690 · gitpython-developers/GitPython Closed Labels DescriptionGetting tests to pass in forks requires steps that are not documented, and that might preferably not be required. This is due to the tests' dependence on the presence of particular version tags, but I believe it can be fixed without (or before) changing how the tests work. By default, a fork is created with only the default branch--here, main--of the upstream repository, and none of its tags. The GitHub interface for forking has a checkbox that, if unchecked, copies all branches and tags, but it is checked by default. It is also possible to add the upstream when cloning, or afterwards, or even to fetch the tags from a remote that is not configured, by passing a URL to Two pull requests that were mainly about other things also attempted to improve this, but made limited impact on it. The recent addition of
#1654 (72e48aa) also adds instructions for cloning a fork with
That is true, but without further steps, none of the CI test jobs will pass in most forks. Possible solutionsExpand the documentation (flawed)Although people who are working on the code in a fork should typically add their fork's upstream remote, either by cloning with The documentation could be made more detailed, to show the use of
Have the init script try to add an upstream remote (flawed)
To elaborate on the safety issue: It would be intuitive to think that adding a repository's immediate upstream fork, even if the user is not fully aware it is being done, would be a safe operation. However, it actually has security implications, even under the assumption that the user both trusts this original repository and trusted the (possibly different) fork-network member when they made the fork. This is due to a combination of two factors:
Have the init script add specific version tags itself (flawed)
As I see it, the problem is the same with all those ways: The upstream tags may be (and, it turns out, are) annotated tags. But the script would be creating lightweight tags, or, much worse, annotated tags not equivalent to the originals. I think this could be confusing even if a repository with real original annotated tags is never later added as a remote, because it would feel like whatever same-named version tags are present downstream should be equivalent to the upstream tags, and people might assume that. But since users of a fork should add the upstream remote in most cases, users who have not done this may later do so, and then the situation would become even more confusing. Have the init script fetch original tags without adding a remote (less flawed?)In view of the downsides of the above approaches but also of the current situation, I think This should only be a backup strategy, and because it is unusual--especially because it might mislead a user into thinking their fork or some other remote listed in Furthermore, it would be undesirable to fetch version tags into a clone of a fork that publishes its own packages or otherwise has its own version tags, because it could cause confusion, and because the GitPython version tags might end up getting pushed to the fork's own remote by accident. Therefore, anything that looks like a version tag should, if present, prevent this backup strategy from being tried. GitPython only uses version tags that start with a digit, and only such tags should be fetched from the hard-coded remote. But forks that publish their own releases might use the other common convention where version tags begin with Although this is not perfect, I plan to open a PR for this very soon. It seems to me that it is reasonable to do this, to improve the situation until... Don't use own repo, or at least not its tags, in tests (ideal future solution)This is, of course, ultimately the solution to the whole category of limitations of which this issue is a part (#914). If this were done in full, then the ActivityMetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |