How To Manage A Pull Request In AWS CodeCommit Using AWS CLI

How To Manage A Pull Request In AWS CodeCommit Using AWS CLI

How To Manage A Pull Request In AWS CodeCommit Using AWS CLI

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed how to manage an AWS CodeCommit repository using AWS CLI.

https://cloudaffaire.com/how-to-manage-an-aws-codecommit-repository-using-aws-cli/

In this blog post, we will discuss how to manage a pull request in AWS CodeCommit using AWS CLI.

What Is A Pull Request In AWS CodeCommit:

A pull request is a primary way you and other repository users can review, comment on, and merge code changes from one branch to another. You can create a copy of the source code in some branch (sometimes refers to fork) to your personal branch, do the required changes and then create a pull request to the source branch to merge your changes in your branch into the source branch.

How To Manage A Pull Request In AWS CodeCommit Using AWS CLI:

Requirements:

AWS CLI v2 installed and configured.

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

Git installed and configured.

https://www.atlassian.com/git/tutorials/install-git

Two IAM users having programmatic access and AWSCodeCommitFullAccess policy attached.

Step 1: Create some demo directories and configure AWS CLI profiles for the two IAM users.

Step 2: Create a repository with one file using the ‘user1’ profile.

This will serve as our source code which in the next step user2 will fork and create a pull request.

Step 3: Create a branch from the master using the ‘user2’ profile.

Step 4: Create a pull request as ‘user2’ profile.

Step 5: Create a pull request approval rule for the ‘user1’ profile as an approver.

Step 6: Add a comment to the pull request.

Step 7: Approve the pull request by the ‘user1’ profile.

Step 8: Get pull request approval status as ‘user2’ profile.

Step 9: Create a pull merge request.

Step 10: Cleanup.

Hope you have enjoyed this blog post. To get more details on AWS CodeCommit, please refer below AWS documentation

https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html

https://docs.aws.amazon.com/cli/latest/reference/codecommit/index.html

CodeCommit is a Git-based version control system and you need to have a basic understanding of Git in order to work with CodeCommit. You can follow the below link to get a basic understanding of Git.

https://cloudaffaire.com/category/devops/git/

 

Leave a Reply

Close Menu