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

Add support for an inclusive job list in Jenkins plugin #8287

Merged
merged 4 commits into from
Dec 23, 2020
Merged

Add support for an inclusive job list in Jenkins plugin #8287

merged 4 commits into from
Dec 23, 2020

Conversation

JS1010111
Copy link
Contributor

@JS1010111 JS1010111 commented Oct 19, 2020

No description provided.

@JS1010111 JS1010111 changed the title Add support for an inclusive job list Add support for an inclusive job list in Jenkins plugin Nov 19, 2020
@sjwang90 sjwang90 added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Nov 24, 2020
@sjwang90 sjwang90 added this to the Planned milestone Dec 9, 2020
## Jobs to exclude from gathering
## Jobs to include or exclude from gathering
## When using both lists, job_exclude has priority.
# job_include = [ "jobA", "jobB/subjobA/subjobB", "jobC*"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should be an empty list with the meaning of "include all" as I guess that was the behavior before.

## Jobs to exclude from gathering
## Jobs to include or exclude from gathering
## When using both lists, job_exclude has priority.
# job_include = [ "jobA", "jobB/subjobA/subjobB", "jobC*"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in README.

Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only comment is that the README (and sampleConfig) should show the actual default for the option. In this case the default is an empty list... Code looks good otherwise.

@srebhan srebhan self-assigned this Dec 15, 2020
@JS1010111
Copy link
Contributor Author

JS1010111 commented Dec 15, 2020

Thanks for the review @srebhan !

Actually the default behavior is not changed here. This PR should not break or change in any way the current configs in use.

The default was no excluded list defined (it's commented in config), which let all jobs to be collected.

With this PR If you pass an empty job_include list no jobs will be collected because there's nothing to match.

To get all jobs I see 3 options:

  • No lists defined (default behavior, not changed)
  • A job_exclude list like: []
  • A job_include list like: [*]

Please let me know if you think we should improve the README or if it's ok. Thanks!

@srebhan
Copy link
Contributor

srebhan commented Dec 16, 2020

Hey @JS1010111, I think there is a misunderstanding. This is not about code change but only about change in the config documentation (README.md and sampleConfig). As far as I understand your code, if the user does not specify an job_include or job_exclude, both JobInclude and JobExclude variables are empty string lists. In turn the filters j.jobFilterInclude and j.jobFilterExclude will be nil leading to no filtering. Perfect this code keeps the previous behavior, there is absolutely no dissent!
My comment targeted the entry in README.md and sampleConfig. Here the convention says that the commented variable shall contain the default value. In your code, the default value is an empty list! So please change
# job_include = [ "jobA", "jobB/subjobA/subjobB", "jobC*"] to # job_include = [ ] to match the code! You can do the same for the exclude option. Just add a comment that an empty include list means to include all. The same is done for multiple other plugins which all define an empty include list as "use all".

Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Dec 16, 2020
@sspaink sspaink merged commit ed72aac into influxdata:master Dec 23, 2020
ssoroka pushed a commit that referenced this pull request Jan 27, 2021
* Add support for an inclusive job list

* Update jenkins plugin tests

* Update jenkins plugin docs

* Update jenkins plugin docs

(cherry picked from commit ed72aac)
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
)

* Add support for an inclusive job list

* Update jenkins plugin tests

* Update jenkins plugin docs

* Update jenkins plugin docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants