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

Add functionality to sitemonitor plugin

    XMLWordPrintable

Details

    Description

      I've made changes to the sitemonitor plugin to add support for verifying that a given string exists in the target URL, and the ability to specify basic cookies for a target URL as well. I didn't want to commit the changes without running 'em by you first, so they're attached to this issue in a diff file.

      Attachments

        Activity

          cliffano cliffano added a comment -

          Patch looks ok. I was planning to use apache commons httpclient, so thanks for including it in the patch. The string check also works fine.

          The only problem I found during testing was:

          • created a new job
          • configured, added one URL for SiteMonitor
          • saved the job
          • ran the job
          • found 2 additional sites with empty URLs in the Site Monitor report page
          • found additional results for those 2 additional sites in the console output
            java.lang.IllegalArgumentException: host parameter is null - host parameter is null
            URL: , response code: null, status: EXCEPTION
            java.lang.IllegalArgumentException: host parameter is null - host parameter is null
            URL: , response code: null, status: EXCEPTION
          • went back to the job configuration page and found 2 additional sites with empty URL

          I also tested this by creating a new job, configure and add a URL to monitor, save configuration, then returned to configuration page, it already had 2 extra sites with empty URLs.

          I found this problem on both freestyle and Maven jobs, by running directly using mvn hpi:run, and also by installing the hpi file on my Hudson instance.

          Any idea what could possibly add those 2 extra sites?

          cliffano cliffano added a comment - Patch looks ok. I was planning to use apache commons httpclient, so thanks for including it in the patch. The string check also works fine. The only problem I found during testing was: created a new job configured, added one URL for SiteMonitor saved the job ran the job found 2 additional sites with empty URLs in the Site Monitor report page found additional results for those 2 additional sites in the console output java.lang.IllegalArgumentException: host parameter is null - host parameter is null URL: , response code: null, status: EXCEPTION java.lang.IllegalArgumentException: host parameter is null - host parameter is null URL: , response code: null, status: EXCEPTION went back to the job configuration page and found 2 additional sites with empty URL I also tested this by creating a new job, configure and add a URL to monitor, save configuration, then returned to configuration page, it already had 2 extra sites with empty URLs. I found this problem on both freestyle and Maven jobs, by running directly using mvn hpi:run, and also by installing the hpi file on my Hudson instance. Any idea what could possibly add those 2 extra sites?

          I know what was causing the 2 extra sites. It's the way the code handles the json. I didn't see this issue because it wasn't previously assigned to the component. I've created a fork in git that adds some regex behavior. But, I didn't add the cookie behavior, which would actually be really great. See

          https://github.com/jacobrobertson/sitemonitor-plugin

          jacob_robertson Jacob Robertson added a comment - I know what was causing the 2 extra sites. It's the way the code handles the json. I didn't see this issue because it wasn't previously assigned to the component. I've created a fork in git that adds some regex behavior. But, I didn't add the cookie behavior, which would actually be really great. See https://github.com/jacobrobertson/sitemonitor-plugin
          jacob_robertson Jacob Robertson added a comment - See https://github.com/jenkinsci/sitemonitor-plugin/pull/1

          People

            cliffano cliffano
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: