On Mon 19 Mar 2018 at 00:50, Steven F <stevengfos...@gmail.com> wrote:

> I locally modified GHBS to make the constructors for PullRequestSCMHead
> and PullRequestSCMRevision public which has seemingly solved the problem.
>

What did I do in Gitea plugin?

If I made the constructor public there, then that’s what we should probably
be doing in GitHub/ Bitbucket

(Gitea is my “no hacks or legacy migration complexity reference
implementation”)

So to be clear:

1. You have a filter trait that restricts PRs based on the presence/absence
of a number of labels. With that, scanning should work. PR commit updates
should work (ie if the PR meets the label criteria and someone updates the
commit)
2. You want to have an event listener for PR labelled and unlabelled
events. This event listener will return heads with a revision when the PR
starts matching the label criteria and heads with a null revision when they
stop. All other PR events can continue to be processed as before

Ideally you’d allow things like:

* only discover PRs labelled with “needs-check”
* ignore PRs labelled with “work-in-progress”

And a final question, would a BranchBuildStrategy work better (ie discover
all PRs but only build one with the matching label criteria) - more asking
to see what your use case is

(I think it would be really cool if you get this enabled as an extension
plugin By The Way, and kudos to you)

So:

* if gitea has public constructors for PR head and revision, please file a
PR against GitHub to make constructors public. Mention that this PR is “an
enabling change for extension plugin”
* check that your extension plugin is only filling the event gap (ie
labelled and unlabelled events) otherwise it will conflict with the other
events

Really cool feature. Glad the docs helped you. Please file PRs for any docs
improvements you can think of.


It is also correctly scoping the source request to the PR involved in the
> event. I don't know enough about GHBS to know if exposing these
> constructors would cause issues though. It seems like the package-private
> decision was made here
> <https://github.com/jenkinsci/github-branch-source-plugin/commit/996cd93f9146329c34791b6db4a3e42e6e32c4a8#diff-27ddccdb50cf2a720dcbf7561d45c9edR45>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/c8805fee-82e4-4fbd-861b-586cfae41c58%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/c8805fee-82e4-4fbd-861b-586cfae41c58%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from my phone

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMwQBCyvpxkc7KBb-LJRU%2BdTCyeO1GMvNS-POkRNiP0OnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to