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

"affectedPaths" returns relative path and not absolute path

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.375.4

      When using REST APIs to check "affectedpaths", we get relative path from repositiry and NOT the complete path.
      Sample command:

      https://jenkins.<company>.com/job/<jobname>/<buildnumber>/api/json?pretty=true&tree=result,changeSets[items[comment,affectedPaths,affectedfiles,msg,url,commitId,url,timestamp,authorEmail]

      This shows:

      "affectedPaths" : [
      "dir1/dir2/file1",
      "dir3/dir4/file2",
      ]

      While the expected output is:

      "affectedPaths" : [
      "https://gerrit.<company>.com/c/parentdir/dir1/dir2/file1",
      "https://gerrit.<company>.com/c/parentdir/dir3/dir4/file2",
      ]

          [JENKINS-72539] "affectedPaths" returns relative path and not absolute path

          Mark Waite added a comment -

          The affectedPaths value is intentionally a path that is relative to the root of the source code repository. This will not be changed.

          You'll need to append your own parent information if you want to use the values of affectedPaths in a different way. That is not a task that is suited to the git plugin.

          Mark Waite added a comment - The affectedPaths value is intentionally a path that is relative to the root of the source code repository. This will not be changed. You'll need to append your own parent information if you want to use the values of affectedPaths in a different way. That is not a task that is suited to the git plugin.

            Unassigned Unassigned
            vrukesh Vrukesh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: