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

API to read a single file from the repository

    Details

    • Similar Issues:
    • Sprint:
      frank, tethys, christmas

      Description

      Requirements

      • Read natively from any branch of a Git repository hosted on Github
      • Read from any branch of a Git repository
      • Must maintain compatibility with Jenkins 2.7.1 and above

      Desired user experience

      Notes
      Jesse Glick said there is beginnings of this in the scm-api but no implementations.

        Attachments

          Issue Links

            Activity

            jamesdumay James Dumay created issue -
            jamesdumay James Dumay made changes -
            Field Original Value New Value
            Labels blueocean
            Hide
            jglick Jesse Glick added a comment -

            dupe

            Show
            jglick Jesse Glick added a comment - dupe
            Hide
            jamesdumay James Dumay added a comment -

            Jesse Glick where's the duplicate? I can close this one out and point my other references to this one.

            Show
            jamesdumay James Dumay added a comment - Jesse Glick where's the duplicate? I can close this one out and point my other references to this one.
            Hide
            jglick Jesse Glick added a comment -

            Related to JENKINS-33273; Stephen Connolly is already building the API & implementation.

            Show
            jglick Jesse Glick added a comment - Related to JENKINS-33273 ; Stephen Connolly is already building the API & implementation.
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-33273 [ JENKINS-33273 ]
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-39355 [ JENKINS-39355 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            jamesdumay James Dumay made changes -
            Component/s bitbucket-plugin [ 18755 ]
            Component/s git-plugin [ 15543 ]
            Component/s github-plugin [ 15896 ]
            Component/s scm-api-plugin [ 18054 ]
            Hide
            jamesdumay James Dumay added a comment -

            Re-opening as this is a tracking ticket for whatever needs to be done to fit the requirements described in this issue.

            Show
            jamesdumay James Dumay added a comment - Re-opening as this is a tracking ticket for whatever needs to be done to fit the requirements described in this issue.
            jamesdumay James Dumay made changes -
            Resolution Duplicate [ 3 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            jamesdumay James Dumay made changes -
            Assignee James Dumay [ jamesdumay ] Stephen Connolly [ stephenconnolly ]
            jamesdumay James Dumay made changes -
            Sprint frank [ 156 ]
            jamesdumay James Dumay made changes -
            Rank Ranked lower
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-36291 [ 172300 ]
            jamesdumay James Dumay made changes -
            Sprint frank [ 156 ] frank, christmas [ 156, 176 ]
            jamesdumay James Dumay made changes -
            Sprint frank, christmas [ 156, 176 ] frank, tethys, christmas [ 156, 161, 176 ]
            Hide
            jglick Jesse Glick added a comment -

            The read part is there. IMO no write API should be offered; this is just a big can of worms.

            Show
            jglick Jesse Glick added a comment - The read part is there. IMO no write API should be offered; this is just a big can of worms.
            jamesdumay James Dumay made changes -
            Sprint frank, tethys, christmas [ 156, 161, 176 ] frank, tethys, christmas, pannonian [ 156, 161, 176, 211 ]
            jamesdumay James Dumay made changes -
            Assignee Stephen Connolly [ stephenconnolly ] James Dumay [ jamesdumay ]
            jamesdumay James Dumay made changes -
            Assignee James Dumay [ jamesdumay ]
            jamesdumay James Dumay made changes -
            Sprint frank, tethys, christmas, pannonian [ 156, 161, 176, 211 ] frank, tethys, christmas [ 156, 161, 176 ]
            jamesdumay James Dumay made changes -
            Sprint frank, tethys, christmas [ 156, 161, 176 ] frank, tethys, christmas, iapetus [ 156, 161, 176, 216 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Sprint frank, tethys, christmas, iapetus [ 156, 161, 176, 216 ] frank, tethys, christmas, post-release [ 156, 161, 176, 181 ]
            jamesdumay James Dumay made changes -
            Rank Ranked lower
            jamesdumay James Dumay made changes -
            Description For the [Blue Ocean Pipeline Editor|https://jenkins.io/blog/2016/09/19/blueocean-beta-declarative-pipeline-pipeline-editor/] we want to read the Jenkinsfile from the repository, let the user author it in the editor then commit it back to the repository.

            We need a new API and relevant implementations (Github and Bitbucket) that would allow Blue Ocean to read/write a file from the repository.

            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            *Scope*
            * Github

            *Out of scope*
            * Git and Bitbucket support

            *Notes*
            For the [Blue Ocean Pipeline Editor|https://jenkins.io/blog/2016/09/19/blueocean-beta-declarative-pipeline-pipeline-editor/] we want to read the Jenkinsfile from the repository, let the user author it in the editor then commit it back to the repository.

            We need a new API and relevant implementations (Github and Bitbucket) that would allow Blue Ocean to read/write a file from the repository.

            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Link This issue relates to JENKINS-41966 [ JENKINS-41966 ]
            hrmpw Patrick Wolf made changes -
            Assignee Stephen Connolly [ stephenconnolly ]
            Hide
            hrmpw Patrick Wolf added a comment -

            Stephen Connolly and Keith Zantow can the two of you confirm that API to read from a repository is done and meets expectations. Then we can close this and focus on the ticket for write API separately. JENKINS-42080

            Show
            hrmpw Patrick Wolf added a comment - Stephen Connolly and Keith Zantow can the two of you confirm that API to read from a repository is done and meets expectations. Then we can close this and focus on the ticket for write API separately. JENKINS-42080
            hrmpw Patrick Wolf made changes -
            Summary API to read/write a single file from/to the repository API to read a single file from the repository
            jamesdumay James Dumay made changes -
            Description *Scope*
            * Github

            *Out of scope*
            * Git and Bitbucket support

            *Notes*
            For the [Blue Ocean Pipeline Editor|https://jenkins.io/blog/2016/09/19/blueocean-beta-declarative-pipeline-pipeline-editor/] we want to read the Jenkinsfile from the repository, let the user author it in the editor then commit it back to the repository.

            We need a new API and relevant implementations (Github and Bitbucket) that would allow Blue Ocean to read/write a file from the repository.

            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            *Scope*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade

            *Notes*
            For the [Blue Ocean Pipeline Editor|https://jenkins.io/blog/2016/09/19/blueocean-beta-declarative-pipeline-pipeline-editor/] we want to read the Jenkinsfile from the repository, let the user author it in the editor then commit it back to the repository.

            We need a new API and relevant implementations (Github and Bitbucket) that would allow Blue Ocean to read/write a file from the repository.

            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            jamesdumay James Dumay made changes -
            Description *Scope*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade

            *Notes*
            For the [Blue Ocean Pipeline Editor|https://jenkins.io/blog/2016/09/19/blueocean-beta-declarative-pipeline-pipeline-editor/] we want to read the Jenkinsfile from the repository, let the user author it in the editor then commit it back to the repository.

            We need a new API and relevant implementations (Github and Bitbucket) that would allow Blue Ocean to read/write a file from the repository.

            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            *Scope*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.

            *Desired user experience*
            Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            jamesdumay James Dumay made changes -
            Link This issue is blocking JENKINS-36291 [ JENKINS-36291 ]
            jamesdumay James Dumay made changes -
            Link This issue relates to JENKINS-41966 [ JENKINS-41966 ]
            jamesdumay James Dumay made changes -
            Link This issue relates to JENKINS-41966 [ JENKINS-41966 ]
            jamesdumay James Dumay made changes -
            Description *Scope*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.

            *Desired user experience*
            Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            *Scope*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.

            *Desired user experience*
            * User experience is described in JENKINS-41966
            * Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            jamesdumay James Dumay made changes -
            Description *Scope*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.

            *Desired user experience*
            * User experience is described in JENKINS-41966
            * Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            *Requirements*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.

            *Desired user experience*
            * User experience is described in JENKINS-41966
            * Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            jamesdumay James Dumay made changes -
            Description *Requirements*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.

            *Desired user experience*
            * User experience is described in JENKINS-41966
            * Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            *Requirements*
            * Read natively from any branch of a Git repository hosted on Github
            * Read from any branch of a Git repository
            * Must maintain compatibility with Jenkins 2.7.1 and above

            *Desired user experience*
            * User experience is described in JENKINS-41966
            * Mockup: https://projects.invisionapp.com/share/Q2A110KM9#/screens/219088047

            *Notes*
            [~jglick] said there is beginnings of this in the scm-api but no implementations.
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-42080 [ JENKINS-42080 ]
            jamesdumay James Dumay made changes -
            Sprint frank, tethys, christmas, post-release [ 156, 161, 176, 181 ] frank, tethys, christmas [ 156, 161, 176 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            Hide
            michaelneale Michael Neale added a comment -

            Patrick Wolf currently it is missing returning the content sha to allow saving back to github - Vivek is looking if we can calculate this to make it unnecessary, otherwise we won't be able to use it for the purposes of load/save just yet.

            Show
            michaelneale Michael Neale added a comment - Patrick Wolf currently it is missing returning the content sha to allow saving back to github - Vivek is looking if we can calculate this to make it unnecessary, otherwise we won't be able to use it for the purposes of load/save just yet.
            Hide
            jglick Jesse Glick added a comment -

            Michael Neale that is tracked as JENKINS-42080.

            Show
            jglick Jesse Glick added a comment - Michael Neale that is tracked as JENKINS-42080 .
            Hide
            michaelneale Michael Neale added a comment -

            Jesse Glick I probably worded that poorly - the sha is required at some point or else you won't be able to save back any changes.
            In theory this can be calculated, but github don't specify the 11 secret herbs and spices for how it is calculated.

            All I found was this: http://stackoverflow.com/questions/39873507/how-to-calculate-sha-from-a-string-with-the-github-api-in-python

            which uses a string involving "blob" and length (wut? why?) - which implies they may change how it is calculated, and that is why they return it on content load.

            So it may be required on load (hopefully not though).

            Show
            michaelneale Michael Neale added a comment - Jesse Glick I probably worded that poorly - the sha is required at some point or else you won't be able to save back any changes. In theory this can be calculated, but github don't specify the 11 secret herbs and spices for how it is calculated. All I found was this: http://stackoverflow.com/questions/39873507/how-to-calculate-sha-from-a-string-with-the-github-api-in-python which uses a string involving "blob" and length (wut? why?) - which implies they may change how it is calculated, and that is why they return it on content load. So it may be required on load (hopefully not though).
            Hide
            vivek Vivek Pandey added a comment -

            I have opened to get GitHub API returned data (sha included), https://issues.jenkins-ci.org/browse/JENKINS-42270. We definitely need sha and other elements returned by GitHub should be pretty much pass thru, otherwise it defeats the purpose of consumers who are really interested in getting content data specific to GitHub.

            For now I am using 'git' way of computing sha, its a hack for now as who knows git changes it in future, better I get it from upstream library/github directly:

            DigestUtils.sha1Hex("blob " + data.length() + "\0" + data)
            
            Show
            vivek Vivek Pandey added a comment - I have opened to get GitHub API returned data (sha included), https://issues.jenkins-ci.org/browse/JENKINS-42270 . We definitely need sha and other elements returned by GitHub should be pretty much pass thru, otherwise it defeats the purpose of consumers who are really interested in getting content data specific to GitHub. For now I am using 'git' way of computing sha, its a hack for now as who knows git changes it in future, better I get it from upstream library/github directly: DigestUtils.sha1Hex( "blob " + data.length() + "\0" + data)
            Hide
            michaelneale Michael Neale added a comment - - edited

            Ah right - yes it is a git standard, of course. Of course sha1 is topical this week...

            In any case, this ticket can be closed, I consider it done (now have seen it working). There is a follow on for github specific fields/properties which isn't needed right now.

            Show
            michaelneale Michael Neale added a comment - - edited Ah right - yes it is a git standard, of course. Of course sha1 is topical this week... In any case, this ticket can be closed, I consider it done (now have seen it working). There is a follow on for github specific fields/properties which isn't needed right now.
            michaelneale Michael Neale made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            stephenconnolly Stephen Connolly made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                jamesdumay James Dumay
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: