Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-255

Should config.jelly be optional like global.jelly?

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      I've noticed when working on plugins that global.jelly is never really needed.
      When you omit it, you just don't get any options on the system configuration
      page for whatever you are extending. However, the config.jelly is always needed.
      When its omitted, you'll get an error telling you the resource does not exist.

      There are times when you really don't need any job specific options and you just
      have to make a logically empty config.jelly to avoid that error page.

      I'm wondering if it makes more sense to simply emit an INFO message that says no
      options for whatever plugin component are rendered instead of creating an
      unavoidable error page? This would make it simpler to write plugin components
      that just don't have any job specific config (no need for that logically empty
      config.jelly), and it would make the global.jelly and config.jelly existence
      requirements work the same way.

      Repro steps to see the behavior I'm talking about:

      Checkout HelloWorld-Plugin,
      Remove global.jelly
      Rebuild,
      Reload Plugin,
      Visit System configuration page
      Observe no error

      Remove config.jelly
      Rebuild,
      Reload Plugin,
      Visit a Job configuration page
      Observe error

            Unassigned Unassigned
            crahen crahen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: