In the ever-evolving landscape of software development, efficiency and accuracy are paramount. Manual tasks, while sometimes necessary, can hinder progress and introduce the risk of human error. In this blog post, you’ll learn how to automate a crucial step in the user story deployment process, saving time and ensuring consistency.
The Challenge: Manual Pull Request Approval Updates
Traditionally, marking pull request steps as completed has been a manual process. This involves identifying the relevant step, checking the approval status, and manually updating the record. While this approach ensures thoroughness, it can be time-consuming and prone to human error.
The Solution: Automated Pull Request Approval Updates
To address these challenges, an automated mechanism has been implemented to eliminate the need for manual intervention. This automation seamlessly checks the approval status of pull requests and updates the corresponding step accordingly. With this automation in place, the pull request step consistently reflects the actual approval status.
The Pull Request Workflow – A Step-by-Step Guide
The pull request workflow encompasses several key steps:
1. Developer’s Actions
A developer creates three user stories and commits changes to each of them.
2. Pull Request Initiation
On these three user stories, the developer raises pull requests, adding a reviewer to review and approve the changes.
3. Pull Request Management
Once a developer creates a pull request for a specific user story, it is reflected in that user story in Copado under the “Test > Pull Requests” section.
Reviewers receive notifications regarding the pull requests and proceed by clicking on the “Add your review” button.
The reviewer then reviews the changes, clicks “Review Changes” , and may choose to either approve, comment, or request changes after reviewing.
4. Pull Request Status
When a reviewer approves the changes, it is reflected in the “User Story > Pull Request > Related > Pull Request Review” section . The reviewer either approve or comment or requests changes on a pull request, but only the “Approved” action will get reflected on the pull request review in Copado.
5. Approval of pull requests
Let’s consider a scenario where out of the 3 user stories, 2 user stories have their pull requests approved against the destination. However, for one user story, the reviewer requested changes to be made. The pull request, on which the reviewer requested changes, will appear as follows.
6. Manual Promotion
Then a release engineer creates a manual promotion and marks these three user stories as “Ready to Promote.”
All three user stories marked as “Ready to Promote” become visible under the ” User Stories” section in the manual promotion created by the release engineer. These user stories can be selected and added to the promotion by clicking “Add Selected User Stories.”
7. Ready to Promote Section
The promoted section will appear as shown in figure below.
8. Deployment Record
After selecting the desired user stories to be added to the promotion, click on the ‘’Create Deployment’’ button. This will generate a deployment record once you click ‘’Submit’’ .
9. Quality Gate and Deployment Status
If any of the user story’s pull requests under that promotion are not approved (i.e., contain comments or requested changes), the pull request quality gate step will be automatically set as incomplete.
Consequently, the deployment status will be marked as “Cancelled,” and the promotion status will be set to “Rejected” .
10. Deployment Retry
If there is any cancellation of the deployment, the user must re-initiate the deployment from the promotion, ensuring that the pull requests for each user story under that promotion needs to get approval.
Efficient pull request management and automation are vital for smooth user story deployments. Understanding the pull request workflow, using automation, and managing multiple stories in manual promotions streamline deployments, enhance efficiency, and maintain codebase consistency.