github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/design/open/pull-request.md (about)

     1  # Pull-request Proposal
     2  
     3  Enable a way to submit changes to a branch by creating a request to merge changes.
     4  The pull-request captures the merge operation we request to apply.
     5  
     6  ### Goals
     7  
     8  - Capture request to merge a branch to a target branch
     9  - Mechanism to review, discuss and merge changes before applying to a branch
    10  - Automation using actions can verify / provide feedback on pull-request
    11  
    12  ### How it will work
    13  
    14  Introduce a new resource called pull-request at the repository level.
    15  The pull-request will hold owner (the user who created the PR), description, assignee, reviewers the source and target branches.
    16  Each reviewer can set approved/reject/clear response on the PR and add comments to the discussion. Comments associated to a PR will be rendered as a list ordered by time.
    17  New comments are appended to the end of the discussion and will include a time stamp, commenter and the text with the comment.
    18  PR will enable a merge operation when at least one reviewer approves or when no reviewers are assigned.
    19  PR will enable request to close PR at any time.
    20  A combination of source/target branch can only have one open PR at a time, previous pull-requests will be merged or closed. An open pull-request will include all the committed changes in the source branch automatically.
    21  Merging the PR will perform a merge request between the source/target branch. Merge failure will keep the PR open and a successful one will close the PR as merged.
    22  When a repository is deleted, all pull-requests will be deleted. When a source or destination branches are deleted - the associated pull-requests are closed.
    23  
    24  
    25  ##### Actions
    26  
    27  No change in current support with pre/post merge. These actions will be triggered when the PR is merged.
    28  A new event called 'pull-request' will be triggered when a pull-request and invoke all the associated actions related to the PR.
    29  Actions will be queued or at least run on the latest commit in the source branch.
    30  The event will be triggered on PR creation and every push of new commit to the source branch will trigger the event.
    31  The action will have access to source branch data for verification after verification there are no conflict between the source and the target branch.
    32  
    33  
    34  ### Mockup Screens
    35  
    36  #### Create Pull Request
    37  
    38  Create pull-request can be done through the 'Compare' or 'Pull requests' tabs.
    39  The following is a mock of the Compare tab, while clicking the 'Pull Request' button.
    40  The dialog will enable to enter the pull-request information, source/target branch and reviewers.
    41  Clicking 'Create' will switch to the pull-request view in the 'Pull requests' tab.
    42  
    43  ![Create Pull Request](diagrams/pull-request-dialog.png)
    44  
    45  #### Pull request list
    46  
    47  Pull request list shown by clicking the 'Pull requests' tab.
    48  The list can be filtered by 'All' for all pull-requests, 'My' created by me or 'Reviews' show the assigned pull-requests.
    49  Clicking a pull-request will render the full pull-request information
    50  This view will enable creating additional pull requests if needed.
    51  
    52  ![List Pull Requests](diagrams/pull-request-list.png)
    53  
    54  #### Pull request edit/view
    55  
    56  Pull request information view will enable editing of all the pull-request information, adding comments, close, close or merge the pull-request - depends on the pull-request status.
    57  
    58  ![Pull Request Edit](diagrams/pull-request-edit.png)
    59  
    60  
    61