Notes For the Blue Ocean 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.
Jesse Glick said there is beginnings of this in the scm-api but no implementations.
*Scope* * Primary ** Write natively to any branch of a Git repository hosted on Github ** Github Enterprise
* Secondary ** Bitbucket Server ** Bitbucket Cloud
*Out Write to any branch of scope* a Git repository * Git Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and others support above.
*NotesDesired user experience* For the [Blue Ocean Pipeline Editor|Mockup:https://jenkinsprojects.ioinvisionapp.com/blogshare/2016Q2A110KM9#/09screens/19/blueocean-beta-declarative-pipeline-pipeline-editor/], 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 write a file from the repository.219088047
*Scope* * Write natively to any branch of a Git repository hosted on Github * Write to any branch of a Git repository * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.
* Write natively to any branch of a Git repository hosted on Github * Write to any branch of a Git repository * Must not require a Jenkins core upgrade. Must maintain compatibility with Jenkins 2.7.1 and above.
Jesse Glick said there is beginnings of this in the scm-api
No, there has never been any proposed API to write files. Sounds like a battle which should not be picked—just provide a downloadable file and ask people to commit it when ready.
This was cloned from JENKINS-39703Jesse Glick and the comment is from you referring to the Read API. I split this off to track the write API separately.
As noted in JENKINS-39703, SCMFile may need to add some methods to define some new abstract type SCMFileContent which has contentAsBytes etc. but also a replace method—since GitHub does not let you overwrite a file without specifying what you are overwriting (presumably to avoid data loss with non-fast-forward merges).