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

A bug while saving the configuration form prevents fingerprinting as a promotion action

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • promoted-builds-plugin
    • None
    • Hudson 1.359, Promoted Builds Plugin 1.7, Ubuntu 10.4, Firefox and Opera.

      I am trying to fingerprint a file (date.txt) when a job gets promoted. I added a promotion action to do it and entered "date.txt" in the fingerprinting form that gets created into the promotion box.
      This file is different from the file I fingerprint as a post-build task (revision.txt)
      The problem is: only one setup of the fingerprinting form is saved when I submit my job configuration.
      In other words: if I reload the configuration, the file date.txt appears both in the promotion action fingerprinting form (which is right) and in the post-build fingerprinting form (which is wrong: it should be revision.txt).

      Here is my setup:
      I have 4 jobs:

      • MainTask
      • SubTask1
      • SubTask2
      • DailyRelease

      The first 3 jobs are fingerprinting a file with a revision number (revision.txt), and MainTask gets promoted if both SubTask1 and SubTask2 succeed (and if the fingerprint of their revisions matches).
      If MainTask gets promoted, it should fingerprint a file containing the date (date.txt).

      The last job runs once a day, and always fingerprints a file containing the date (date.txt). It gets promoted if MainTask is successful (and if the fingerprint of their dates matches).

      The purpose of this setup is to have a hierarchical promotion process that returns only one promoted release per day. It was the first idea I came with when I thought about how to achieve such a promotion process.
      I don't know if there are easier ways to do it, but I think the principle it good. It should work, but this bug is preventing it.

          [JENKINS-6642] A bug while saving the configuration form prevents fingerprinting as a promotion action

          Alan Harder added a comment -

          confirmed.. Fingerprinter does req.getParameter directly instead of using the JSON data which has the proper structured data when form elements are used more than once like this.. I'll change it.

          Alan Harder added a comment - confirmed.. Fingerprinter does req.getParameter directly instead of using the JSON data which has the proper structured data when form elements are used more than once like this.. I'll change it.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/tasks/Fingerprinter.java
          trunk/hudson/main/core/src/main/resources/hudson/tasks/Fingerprinter/config.jelly
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/31536
          Log:
          [FIXED JENKINS-6642] use JSON data instead of req.getParameter to avoid conflict when
          fingerprinting is used more than once in form (like with promoted builds plugin).

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/tasks/Fingerprinter.java trunk/hudson/main/core/src/main/resources/hudson/tasks/Fingerprinter/config.jelly trunk/www/changelog.html http://jenkins-ci.org/commit/31536 Log: [FIXED JENKINS-6642] use JSON data instead of req.getParameter to avoid conflict when fingerprinting is used more than once in form (like with promoted builds plugin).

          Alan Harder added a comment -

          fixed for 1.361. making this fix revealed another minor problem though.. the textbox and first checkbox will work properly now, but I discovered when looking at this that the other checkbox there ("keep build logs of dependencies") is actually a property of the Job, not the fingerprint settings.. so checking this checkbox in EITHER the promotion settings OR the main job setting will result in the checkbox being checking in both locations. suggestions on how to improve this are welcome
          if I could detect when it's the main job instance vs some other instance (like for promotions) I could hide the 2nd checkbox.. not sure how to do that offhand though, so it may be easier to move that checkbox to the "advanced settings" section or something.

          Alan Harder added a comment - fixed for 1.361. making this fix revealed another minor problem though.. the textbox and first checkbox will work properly now, but I discovered when looking at this that the other checkbox there ("keep build logs of dependencies") is actually a property of the Job, not the fingerprint settings.. so checking this checkbox in EITHER the promotion settings OR the main job setting will result in the checkbox being checking in both locations. suggestions on how to improve this are welcome if I could detect when it's the main job instance vs some other instance (like for promotions) I could hide the 2nd checkbox.. not sure how to do that offhand though, so it may be easier to move that checkbox to the "advanced settings" section or something.

            mindless Alan Harder
            fchateau fchateau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: