Skip to content
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

what is a "trusted" user as defined by this plugin #56

Open
jsharpe-ctm opened this issue Feb 16, 2023 · 16 comments
Open

what is a "trusted" user as defined by this plugin #56

jsharpe-ctm opened this issue Feb 16, 2023 · 16 comments

Comments

@jsharpe-ctm
Copy link

Describe your use-case which is not covered by existing documentation.

Is that a github thing? Does the plugin have some definition of "trusted"

Context: I just installed this, think I have it configured, but builds aren't running per my PR comment. I see a section about "untrusted" users and am not sure if my user is trusted or not (which would cause the builds to not be triggered).

https://plugins.jenkins.io/github-pr-comment-build/#plugin-content-untrusted-builds

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

@lprimak
Copy link
Contributor

lprimak commented Feb 16, 2023

"trusted" is any user that in the GitHub org or in a team that repository is in.

However, I don't believe that the issue is the one you are experiencing.
Make sure that the below checkbox is checked in the webhook settings.
There are some cases where the webhook is not set up properly automatically.

Screen Shot 2023-02-16 at 11 31 36 AM

@jsharpe-ctm
Copy link
Author

jsharpe-ctm commented Feb 16, 2023

Thanks for the reply. We don't use webhooks, we use a github app

In the app's config I have these things configured.
GitHub_Apps_-_JenkinsCTM
GitHub_Apps_-_JenkinsCTM
d9e268.jpg)
GitHub_Apps_-_JenkinsCTM

There is no "Issue comments" in the github app settings.

@jsharpe-ctm
Copy link
Author

FWIW, I don't have this enabled, but I don't think it makes sense for it to be enabled. We don't use "Issues" - we use "Pull Requests" as I'm sure you know those are very different things.

GitHub_Apps_-_JenkinsCTM

@lprimak
Copy link
Contributor

lprimak commented Feb 16, 2023

Ah, GitHub is really confusing here. Issue comments are mislabeled, and are both for issue and PR comments.
So if you have them disabled, your PR comments won't trigger.

@jsharpe-ctm
Copy link
Author

Okay. I added Issue comments, and reapproved the new permissions. Still no luck. No webhook comes in when I comment on the PR.

FWIW, I don't see Pull Request comments in this list of events. I see Pull Request Review Comments -- but that's not the same. We don't use Pull Request Reviews. We just comment directly on the PR.

@jsharpe-ctm
Copy link
Author

GitHub_Apps_-_JenkinsCTM

@lprimak
Copy link
Contributor

lprimak commented Feb 16, 2023

That should work. The only other thing I can think of if the webhook security is not set up correctly. You'll have to sue GH and Jenkins tools to debug this I guess

@jsharpe-ctm
Copy link
Author

Okay, so I commented on a PR:
remove_active_resource_by_jsharpe-ctm_·Pull_Request__2712·_calltracking_phonetrac

It webhooked:
GitHub_Apps_-_JenkinsCTM
GitHub_Apps_-_JenkinsCTM

But there's no evidence of it here, in jenkins:
my.jenkins.com/job/phonetrac/indexing/events

There's other webhook's there, like PR opened, PR updated -- and those trigger builds, but nothing about issue comments or PR comments/reviews.

So github it sending it, but jenkins is swallowing it up? Do they need to be specifically enabled somewhere in jenkins-land?

@lprimak
Copy link
Contributor

lprimak commented Feb 16, 2023

Sounds like security token config issue somewhere

@jsharpe-ctm
Copy link
Author

Hmm, not sure I follow. github sent the data and it 200'd. So jenkins has it I'd think?

What does a security token have to do with anything here?

@lprimak
Copy link
Contributor

lprimak commented Feb 16, 2023

Then it sounds like it should work. Running out of ideas here. Are you entering the proper regex in the plugin config?

@jsharpe-ctm
Copy link
Author

I copied/pasted, it's just rerun build -- but I don't think that matters? The webhook isn't showing up in the jenkins event log

@jsharpe-ctm
Copy link
Author

I added a new jenkins system log (/manage/log/debug/configure) looks like this:

Configure_log_recorder__Jenkins_

It shows that the webhook was received and I see my pull request comment (and the literal comment message)

Here's a snippet (huge blob of json)

Log__Jenkins_

It does not show any logs from com.adobe.jenkins.github_pr_comment_build.IssueCommentGHEventSubscriber - so, seems like this plugin is not properly detecting the webhook or it's not logging anything?

Shouldn't the plugin wake up and at least log something about a webhook?

Something like: "processing comment webhook ; didn't match anything"

@iwane-pl
Copy link

I've encountered a similar situation in our repository, which uses GitHub groups to give access. Once I enable untrusted users, I can trigger builds with comments. Once I disable it, no luck - plugin says that my user is untrusted (despite being granted a repository admin permissions by being in a proper group).

@jsharpe-ctm
Copy link
Author

I have Allow untrusted users to trigger the build checked.

I think the issue now is the plugin isn't detecting the webhook at all. It says nothing.

@lprimak
Copy link
Contributor

lprimak commented Feb 17, 2023

try .* in the comment regex field, so it catches any comment (just for testing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants