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

Use structured fact for Jenkins plugin list #1050

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

Conversation

zipkid
Copy link
Member

@zipkid zipkid commented Sep 1, 2022

Pull Request (PR) description
This PR changes the jenkins_plugins fact from a simple string value to a structured fact to avoid the error about a fact value being too long.

This Pull Request (PR) fixes the following issues
Fixes #1048

Maybe this gives too much information as the Hash contains much more than the name and version number that was in the 'old' fact.

It could easily be reduced to only some keys.

  "jenkins_plugins": {
    "blueocean-dashboard": {
      "manifest_version": "1.0",
      "archiver_version": "Plexus Archiver",
      "created_by": "Apache Maven",
      "built_by": "olamy",
      "build_jdk": "11.0.13",
      "extension_name": "blueocean-dashboard",
      "specification_title": "The Jenkins Plugins Parent POM Project",
      "implementation_title": "blueocean-dashboard",
      "implementation_version": "1.25.2",
      "group_id": "io.jenkins.blueocean",
      "short_name": "blueocean-dashboard",
      "long_name": "Dashboard for Blue Ocean",
      "url": "https://github.com/jenkinsci/blueocean-plugin/blob/master/blueoce",
      "minimum_java_version": "1.8",
      "plugin_version": "1.25.2",
      "hudson_version": "2.277.4",
      "jenkins_version": "2.277.4",
      "plugin_dependencies": "blueocean-web:1.25.2",
      "plugin_developers": "Thorsten Iberian Sumurai:scherler:,Cliff Meyers:cli",
      "support_dynamic_loading": "true",
      "plugin_license_name": "MIT License",
      "plugin_license_url": "https://opensource.org/licenses/MIT",
      "plugin_scmurl": "https://github.com/jenkinsci/blueocean-plugin/blueocean"
    },
    "blueocean-autofavorite": {
      "manifest_version": "1.0",
      "archiver_version": "Plexus Archiver",
      "created_by": "Apache Maven",
      "built_by": "gmogan",
      "build_jdk": "1.8.0_192",
      "extension_name": "blueocean-autofavorite",
      "specification_title": "Automatically favorites multibranch pipeline jobs",
      "implementation_title": "blueocean-autofavorite",
      "implementation_version": "1.2.4",
      "group_id": "org.jenkins-ci.plugins",
      "short_name": "blueocean-autofavorite",
      "long_name": "Autofavorite for Blue Ocean",
      "url": "https://wiki.jenkins-ci.org/display/JENKINS/Blue+Ocean+Autofavori",
      "minimum_java_version": "1.8",
      "plugin_version": "1.2.4",
      "hudson_version": "2.121.1",
      "jenkins_version": "2.121.1",
      "plugin_dependencies": "workflow-job:2.32,branch-api:2.0.11,git-client:2.",
      "plugin_developers": "James Dumay:jdumay:jdumay@cloudbees.com"
    },
    "blueocean": {
      "manifest_version": "1.0",
      "archiver_version": "Plexus Archiver",
      "created_by": "Apache Maven",
...
...

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

This part also needs to be modified:

$installed_plugins = fact('jenkins_plugins') ? {
undef => [],
default => strip(split($facts['jenkins_plugins'], ',')),
}

@@ -10,7 +10,6 @@
Facter.add(:jenkins_plugins) do
Copy link
Member

Choose a reason for hiding this comment

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

For compatibility I toyed with the idea to create a structured jenkins fact where plugins is a key, but I had issues testing it properly and then had a lack of time. I also thought it would be good to reduce the number of entries.

Facter.add(:jenkins, type: :aggregate) do
  confine kernel: 'Linux'

  chunk :plugins do
    plugins = Puppet::Jenkins::Plugins.available
    plugins.transform_values { |plugin| plugin.slice(:plugin_version) }
  end
end

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.

Fact 'jenkins_plugins' can exceed value length limit: 4096
2 participants