-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use the correct base repo for downloading PR sources #158
Comments
But |
Yeah, see: When I started working on #156, I created a PR to This PR is (mostly) the same as the one I ended with (in my own fork -- popzxc/hintman-target#1). But if I try to use the PR to forkPr1 <- makePr (PrNumber 39) (Sha "no-newline-at-file-end") ...it fails: Failures:
test/Test/Hint/NoNewlineAtFileEnd.hs:17:26:
1) Hintman hints, Comments are spawned for files without newline at file end, Spawns comment for README.md
predicate failed on: []
To rerun use: --match "/Hintman hints/Comments are spawned for files without newline at file end/Spawns comment for README.md/"
test/Test/Hint/NoNewlineAtFileEnd.hs:19:26:
2) Hintman hints, Comments are spawned for files without newline at file end, Spawns comment for BigExample.hs
predicate failed on: [] However, for a fork it works just fine: forkPr1 <- makePrFrom (Owner "popzxc") (PrNumber 1) (Sha "no-newline-at-file-end") Finished in 11.0149 seconds
27 examples, 0 failures My initial thought was that the reason for it is that createFileDownloadUrl uses an owner repo as a part of URL, in my case the sample generated URL for file will be: However, I just made a test PR from fork in Thus, I'm not sure why tests fail for kowainik/hintman-target#39 but pass for popzxc/hintman-target#1. I've just re-checked it (just in case), and the issue persists locally at the moment of writing of this comment. |
How to reproduce:
The tests should fail (while expected not to do so). |
I'm still not sure that we should use fork's owner, as at least one reason is that the fork owners don't have to install Hintman and we as the repo owners in which we installed Hintman want it to work on all PRs (even from forks) which is what is happening at the moment as far as I can see. As I see even from the linked PR that Hintman did its work there, so I wouldn't change this behaviour. What is for tests, it's even better to have them all for the repo PRs', instead of the fork ones (forks can be deleted etc., and we don't have much control on that). So if you'd like we could make you a collaborator in there, but only if you would like so, no pressure there 🙂 |
Regarding the behaviour: Regarding being the collaborator -- sure! I'm really excited about |
According to the discussion, it looks like the problem with forks only when implementing tests. As @vrom911 noticed, we don't have control over forks, and it's better to keep all tests as branches to |
Currently
hintman
attempts to download files from PR diff usingprInfoUwner
as a base repo, which doesn't work properly if the PR base is another repo (fork).PrInfo
should be extended with a field, e.g.prBaseRepo
, which will be used to create a URL for file downloading.For details, see the discussion at #156.
The text was updated successfully, but these errors were encountered: