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

list top level items in the controller #209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KevinRealAlcalde
Copy link
Contributor

No description provided.

Copy link
Member

@duemir duemir left a comment

Choose a reason for hiding this comment

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

It looks like it is skipping Multibranch Pipelines and Organization folders
Why is this needed?

@KevinRealAlcalde
Copy link
Contributor Author

The objective of this script is to avoid counting how many Jobs you have in a big cluster. Multibranch and Organization folders are counted but only as 1 regardless the amount of repos/branches inside, because as said, the objective is to retrieve the amount of jobs in the cluster

@Dohbedoh
Copy link
Contributor

Dohbedoh commented Sep 1, 2022

I am bit confused too here. By top level items, do you mean TopLevelItem objects ? Or items at the Jenkins root ?

Seems to me that we could simply use jenkins.model.Jenkins.instance.allItems(hudson.model.TopLevelItem.class) and avoid the recursion ?

@KevinRealAlcalde
Copy link
Contributor Author

The script does not retrieve only Items at the Jenkins root. iterating jenkins.model.Jenkins.instance.allItems(hudson.model.TopLevelItem.class) is quite similar to the output of this script but not exactly the same. The difference is this script does not count separately the different branches in a Job while TopLevelItem does it. Also, the TopLevelItem counts Folders as something to be counted, while this script does not.

@duemir
Copy link
Member

duemir commented Dec 19, 2022

I still don't see the point and am confused by the script's output.
CloudBees CI Lexicon | Item, not very clearly, define an item as "A folder, Pipeline, or Project in the Jenkins environment." This includes all the things skipped in this script, yet the script claims it prints the "total" number of items.

Who is going to use this script and why? What is the story behind it?

@PierreBtz PierreBtz removed their request for review September 14, 2023 14:30
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

Successfully merging this pull request may close these issues.

3 participants