•  
     
    story #11477 have a dedicated reference for pullrequests
Summary
Empty
have a dedicated reference for pullrequests

I can manage branch deletion, continuous integration, etc

Functional overview

As it's mainly an internal refactoring, there are very few functional changes. However the following things will change:

  • Continuous integration can be more reliably associated with the PR (as the verification of the PR will be defined in the target repository, not in the source as of today)
  • It will be possible to browse PR associated to a deleted source branch (not possible today)
  • Better performances for merge

Technical changes

At pullrequest creation, a new reference will be created in the target repository. The namespace will be refs/tlpr/ and the PR will be numbered starting at 1:

  • First pullrequest will create refs/tlpr/1/head
  • Second will create refs/tlpr/2/head
  • etc

A new commit in the source branch will automatically update the reference (not create a new PR). Hence the target namepace will be "rewindable" that is to say that refs/pr/1/head history can be rewritten if source repository was rewritten.

The intermediate repository for merge will no longer be used.

Todo

  • forgeupgrade bucket to assign a PR id per repository starting 1 for each PR / repo.
  • a new PR will create a new reference in refs/tlpr namespace
  • a push in source branch of a PR (as long as the PR is open) generates a push --force in corresponding refs/tlpr/X/head
  • a merge of PR is merge of refs/tlpr/X/head in the target branch
    • As result refs/tlpr/X/head is no longer updated
  • at repository fork (in project or across projects) doesn't clone refs/tlpr namespace
  • pullrequests backend (REST) updates
    • diff generation
    • merge
  • pullrequests UI updates
    • Add info in the UI "how to fetch PR locally?"
  • pullrequests Continuous Integration updates
    • CI now targets the pr itself (must be configured in target repo)
    • Snippet to be deployed on jenkins is updated
  • git/gitolite backend updates
    • refs/tlpr namespace is Readonly
  • all existing PR are converted to refs/tlpr/X/head
    • there is an async job (root_daily to do it in background)
    • when someone access a given PR there is a conversion step first before they can go to the PR
  • xml import/export
    • nothing is done but code should be able to manage that a given pr cannot be created because the ref already exists
Empty
Status
Empty
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#11477
Manuel Vacelet (vaceletm)
2018-06-21 16:33
2018-05-14 15:48
11792

References
Referencing story #11477

Git commit

tuleap/tuleap/stable

Pull Requests references namespace is read-only for users 848ed9811d
Clean Pull Request reference namespace when a Git repo is imported or forked 024f9a6fda
Creation of a pull request can create a Git reference in the destination repository 831fe96367
Update of a pull request updates the Git reference in the destination repository fd600f5622
Reserve a Git reference for all existing pull requests 8543e30115
Create Git references for all pull requests needing it during the daily job ced3922565
Create Git pull reference in the repository when the PR is accessed 2f43752ed1
Ensure the namespace in the Git repo is available before updating "reserved" references 02192cb268
Git operations done to display a PR are now done in the destination repository 70c6ab9297
Remove debugging function from forgeupgrade bucket dca5ca4e3e
Associate build status to a commit instead of a pull request b6340eb441
Remove unused code to do a fast forward merge or a pull request ea7e6c01a3
Pull request merges take advantage of the local references 07f27fe431
Do send notifications when a "technical" Git reference is updated 63f57594a7
Add information in the PR REST route to be able fetch instruction in the UI f42d18b6d4
Do not update the last push date or cross references when updating a "technical" Git reference 215c3d6657
Explain how to fetch the PR locally in the UI 97bcf72974
add $ for git repository checkout 9150d568a2
Always use the most recent recent status between deprecated build status and commit status 76c078e862
Bulk conversion of PR can be stopped if a specific file is found 2d8ad5802d
Add a warning in the PR view when the build status has been set with a deprecated REST route 16306653e3
Do not mark build status as unknown when build status has only been set on the PR 713440e1c6
request #11672: Do not try to reserve a Git reference when a PR is updated a878343216
Do not send notification when a technical Git reference is updated b7783e7bb9

Follow-ups

User avatar
Manon Midy (mmidy)2018-06-21 16:33
  • I want to
    -have a dedicated references for pullrequests 
    +have a dedicated reference for pullrequests 
  • Category set to
User avatar
Thomas Gerbet (tgerbet)2018-06-06 13:47
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • So that
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes