jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
410 stars 160 forks source link

add precise job finder #273

Closed TomNewChao closed 1 year ago

TomNewChao commented 1 year ago

Why do I submit a PR fix issue272, The more detail information in https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/272.

What did my pr do? 1.set precise job finder enable in global config and set path expression. image

2.use the job finder factory in GenericWebHookRequestReceiver api 3.Parse the request body(use jsonPath) according to the path expression, obtain the path of the specific task, and then trigger 4.add the unit test code

### Submitter checklist
- [ ] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [ ] Ensure that the pull request title represents the desired changelog entry
- [ ] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
tomasbjerre commented 1 year ago

This is on my TODO list. Will have a look when I have time.

TomNewChao commented 1 year ago

This is on my TODO list. Will have a look when I have time.

Ok, Looking forward to my pr merged as soon as possible.

TomNewChao commented 1 year ago

@tomasbjerre I am very happy to receive your comments. The first and last comments have been modified. Regarding the second and third comments, I would like to feed back some different opinions. I don’t know if the community can accept them.

TomNewChao commented 1 year ago

My general comment on this is that it is too complicated.

As I see it a PR is really just a way of asking for free maintenance. There is nothing stopping you from adjusting the code to your needs and use that in you Jenkins. But for me to maintain it, it has to be as simple as possible. If a complex feature only helps a few users I would rather not merge it.

Thanks for your reply, I see, Let me use the easiest way to achieve it,I think I may be thinking a bit complicated.