-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add PR branch validation #47
Conversation
This scenario cannot be recovered without raising a new PR from a different remote branch so I'd suggest not using the status API and instead using a label. Via @rgee0 in the issue description:
|
7b4b048
to
041fc76
Compare
@iyovcheva looks like the PR is breaking on CI. We should run a local docker build before pushing commits up to GitHub - it can reveal build/test errors ahead of time. |
9fc9436
to
965d216
Compare
@alexellis @rgee0 can you please review? |
965d216
to
60d85be
Compare
We don't have any assign reviewer capability. Feel free to raise an issue suggesting it |
pullRequestHandler.go
Outdated
body := `Thank you for your contribution. It appears that you are submitting changes directly from your master branch, | ||
we encourage you to raise a new pull request from a named branch i.e. git checkout -b my_feature. ` | ||
|
||
comment := &github.IssueComment{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/IssueComment/PullRequestComment
9760461
to
58443e2
Compare
Let's make the minor changes suggested today and then do some e2e testing:
Then trigger the function and check the behaviour. This will also be an opportunity for us to update the documentation on how to test / build / develop with Derek. |
58443e2
to
d82ff88
Compare
@iyovcheva I see you pushed some changes. Please could you respond to the comment? |
@iyovcheva please could you run through some end-to-end testing using the instructions above? I pinged 20 days ago and think this would be a useful feature for the project. While you are deploying Derek for testing it may make sense to take some cropped screenshots and update the testing instructions for future contributors such as @neolit123 cc @rgee0 |
@ivanayov end-to-end testing needed on this. I'll mark WIP until we have that done. Thanks, Alex |
hi, Alex. i spoke briefly with Ivana about this and i could be missing some detail. would a complete e2e for a bot that handles PRs mean that a certain repository has to be clobbered - i.e. the testing code would create a branch in a repository somewhere, make a change to a file and then submit a PR for this file. the testing code would then validate if the source and destination branches match a criteria. at least that's how a see a complete e2e test. would it make sense to attempt to handle that via unit tests only. if even possible? |
End to end testing means that your code is validated running in a live environment showing it does what it says it should. We don't want to discover bugs after releasing a new version of the code and deploying it to "production". Unit tests are also an important part of regression testing, but it's difficult to produce the correct conditions to show all the moving parts are working as expected. So for this change deploy Derek to your OpenFaaS instance, point your GitHub App at the endpoint and then add the app to your test repo. After that fire an event to trigger the behaviour. This should be quick to test. |
ah, so this is a one-shot manual e2e test to verify that this PR works. |
I tend to pull up a clean OF instance on Digital Ocean and deploy Derek to it. I put some Ansible together to provision a droplet and deploy OF - https://github.com/rgee0/openfaas-DO I do have a test repo that does get clobbered, but thats what its there for. Test the feature partitions: master to master, branch to master, branch to non-master, master to branch. Because this is relatively quick testing I'd also ensure the existing features still function. The github facility to view and re-send requests also comes in useful. |
just an idea to throw out there; probably considered already. how about you guys integrate Derek as a continuous deployment? proposal:
this is great for new contributors who don't have (e.g.) digital ocean accounts or enough knowledge to do the deployment them self. also speeds up the verification process of new features. potential problem here would be that if multiple PRs are submitted on top of each other the @rgee0 @alexellis @ivanayov |
@neolit123 This sounds like a good idea. @MrTinD Just tested his PR and has a test environment, so I asked him if he can help with the e2e testing of this as well. |
d82ff88
to
3146bcf
Compare
@MrTinD shared his test environment with me, so I can do e2e test the next days |
3146bcf
to
1126956
Compare
This checks if the branch a pull request is raised from is non-master. Validates, as well, if a pull request is raised against the default branch. If the validation is not successful, the pull request labels are applied: "review/target-branch" if the target branch is not the default and "review/source-branch" if the source branch is named "master". The source branch validation leaves a warning comment, suggesting to raise a new pull request from a named branch Signed-off-by: Ivana Yovcheva (VMware) <[email protected]>
1126956
to
560b53c
Compare
This PR is for the last item in the feature wish-list from the end of the README, right? Do you think this implementation is complete? |
Hi Simon, Why do you ask? I would say we should close the PR as the author is no longer active, and the PR is quite old now and out of sync. I would have to take a detailed look to understand if it's complete. Alex |
Thank you. And I asked at the same time as I started to try making a branch
that does the same, but taking into account renaming of files. Also, I saw
an opportunity to make the change simpler.
From the discussion so far, I'm guessing that this project is more or less
active, and I'll continue my path to contribute here while figuring out
what github bots can do.
… |
This checks if the branch a pull request is raised from is
non-master. Validates, as well, if a pull request is raised against
the default branch. If the validation is not successful, the pull
request labels are applied: "review/target-branch" if the target
branch is not the default and "review/source-branch"
if the source branch is named "master". The source branch validation
leaves a warning comment, suggesting to raise a new pull request from
a named branch
Signed-off-by: Ivana Yovcheva (VMware) [email protected]
Raised in issue #17