To work with pull requests in SourceCraft, including for approvals, you do not need to switch to an IDE on your local computer: you can do all the steps in the SourceCraft interface. You can navigate and search through the project code and edit the code.
Once a pull request is created, each push of changes to a remote repository branch creates a new iteration. This iteration includes all commits made before the git push command was executed.
To create a new iteration:
In the same branch the pull request was created from, make new changes to the repository files.
Add the modified files to the git index, commit, and push the changes to the remote repository:
On the Home tab, under Your craftspace, navigate to Repositories.
Select a repository.
Under Code on the repository page, go to Pull requests.
Select a pull request.
Leave a comment:
General
On a specific row
Enter your comment in the Activity section on the Overview tab.
On the Files changed tab, click next to the row you want to comment on.
Tip
You can comment or suggest changes for an entire block of code in one go. Do it by holding down the mouse pointer to the left of the row number you want to start with and releasing it opposite the row you want to end with.
You can leave comments and code suggestions for any rows of the modified file. You are not limited to just the modified area.
In the window that opens, enter your comment.
Optionally, select Change request to request the pull request's edits.
Click Comment.
You can also save your comment as a draft to modify it later instead of publishing it right away. To do this, click Draft.
Suggesting your code
You can suggest a code snippet the pull request author can apply directly from the comment:
On the Home tab, under Your craftspace, navigate to Repositories.
Select a repository.
Under Code on the repository page, go to Pull requests.
Select a pull request.
In the Files changed tab, click next to the line you want to suggest your code for.
Tip
You can comment or suggest changes for an entire block of code in one go. Do it by holding down the mouse pointer to the left of the row number you want to start with and releasing it opposite the row you want to end with.
You can leave comments and code suggestions for any rows of the modified file. You are not limited to just the modified area.
In the window that opens, click Code suggestion.
Enter the code you want to suggest.
Warning
A code suggestion differs from a regular comment by having the suggestion markup:
```suggestion
Suggested modifications
```
Do not delete or modify this markup.
Optionally, select Change request to request the pull request's edits.
Click Comment.
You can also save your code suggestion as a draft to work on it later instead of publishing it right away. To do this, click Draft.
To accept the suggested code:
In the top-right corner of the section showing the suggested code, click Accept.
Enter your comment to the commit and click Commit changes.
On the Home tab, under Your craftspace, navigate to Repositories.
Select a repository.
Under Code on the repository page, go to Pull requests.
Select a pull request.
In the top-right corner, click next to Merge.
Select the method of merging with the target branch:
Create a merge commit: Separate merge commit is created in the target branch, which saves the revision history of both branches. This gives you a clear idea of when and how the merge had taken place, while keeping the full development history unchanged.
Squash and merge: Before merging with the target branch, commits from the branch with changes are combined into a single commit. This helps maintain a cleaner and simpler revision history by reducing a series of small commits to a single one.
Rebase and merge: Commits from the branch with changes are joined to the main branch without creating a special merge commit. This moves commits from the branch with changes to the end of the target branch, preserving a linear revision history.
In the top-right corner, click with the merge method you selected.