AWS CodeCommit is no longer available to new customers. Existing customers of
AWS CodeCommit can continue to use the service as normal.
Learn more"
Override approval rules on a pull request
In the normal course of development, you want users to meet the conditions of approval rules before you merge pull requests. However, there might be times when you need to expedite merging a pull request. For example, you might want to put a bug fix into production, but no one in the approval pool is available to approve the pull request. In cases like these, you can choose to override the approval rules on a pull request. You can override all approval rules for a pull request, including those created specifically for the pull request and generated from an approval rule template. You cannot selectively override a specific approval rule, just all rules. After you have set aside the approval rule requirements by overriding the rules, you can merge the pull request to its destination branch.
When you override approval rules on a pull request, information about the user who overrode the rules is recorded in the activity for the pull request. This way you can go back into the history of a pull request and review who overrode the rules. You can also choose to revoke the override if the pull request is still open. After the pull request has been merged, you can no longer revoke the override.
Override approval rules (console)
You can override the requirements of approval rules on a pull request in the console, as part of reviewing a pull request. If you change your mind, you can revoke your override, and the approval rule requirements are reapplied. You can only override approval rules or revoke an override if the pull request is still open. If it is merged or closed, you cannot change its override state.
Open the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home
. -
In Repositories, choose the name of the repository.
-
In the navigation pane, choose Pull requests. Choose the pull request where you want to override approval rule requirements, or revoke an override.
-
On the Approvals tab, choose Override approval rules. The requirements are set aside, and the button text changes to Revoke override. To reapply the approval rule requirements, choose Revoke override.
Override approval rules (AWS CLI)
You can use the AWS CLI to override approval rule requirements. You can also use it to view the override status for a pull request.
To override approval rule requirements on a pull request
-
At a terminal or command line, run the override-pull-request-approval-rules command, specifying:
-
The system-generated ID of the pull request.
-
The latest revision ID of the pull request. To view this information, use get-pull-request.
-
The status you want for the override,
OVERRIDE
orREVOKE
. TheREVOKE
status removes theOVERRIDE
status but is not saved.
For example, to override approval rules on a pull request with an ID of
34
and a revision ID of927df8d8EXAMPLE
:aws codecommit override-pull-request-approval-rules --pull-request-id
34
--revision-id927df8d8dEXAMPLE
--override-status OVERRIDE -
-
If successful, this command returns nothing.
-
To revoke the override on a pull request with an ID of
34
and a revision ID of927df8d8EXAMPLE
:aws codecommit override-pull-request-approval-rules --pull-request-id
34
--revision-id927df8d8dEXAMPLE
--override-status REVOKE
To get information about the override status of a pull request
-
At a terminal or command line, run the get-pull-request-override-state command, specifying:
-
The system-generated ID of the pull request.
-
The latest revision ID of the pull request. To view this information, use get-pull-request.
For example, to view the override state for a pull request with an ID of
34
and a revision ID of927df8d8EXAMPLE
:aws codecommit get-pull-request-override-state --pull-request-id
34
--revision-id927df8d8dEXAMPLE
-
-
If successful, this command produces output similar to the following:
{ "overridden": true, "overrider": "arn:aws:iam::123456789012:user/Mary_Major" }