##// END OF EJS Templates
api: comment_pull_request, added commit_id parameter to validate status changed on particular commit....
api: comment_pull_request, added commit_id parameter to validate status changed on particular commit. - when using the API and creating a comment with status change it's now possible to pass in commit_id, this will allow validation if status change of pull_request is allowed based on the given commit_id. This solves the case when long running test sends approval of pull request which was already updated several times. The commit_id will now validate for which state the approval was made, and prevent accidental aproval of outdated pull requests.

File last commit:

r1:854a839a default
r1269:26e59d48 default
Show More
api-examples.rst
66 lines | 1.8 KiB | text/x-rst | RstLexer

API Example Usage

Use the following example uses of the |RCE| API to carry out work on your instances, or |repo| maintanence on the server. For the complete API documentation, see the :ref:`api` section.

Stripping Commits

The strip command is useful for removing commits on the server, allowing you to push changes without using force. To strip commits on the server, use the following steps:

  1. Install |RCT|, as explained in the :ref:`install-tools` section.
  2. Configure the :file:`~/.rhoderc` file with the API connection details, as explained in the :ref:`config-rhoderc` section.
  3. Check the |RCE| changelog and see from which revision onwards you wish to strip commits. This will also strip all descendants.
../images/pre-strip.png
  1. Enter your |RCT| virtual environment, using the following example:
$ . venv/bin/activate
(venv)$
  1. Use the API to strip a commit, or number of commits from a |repo|. In this example I am stripping the top two commits from ad1e0523a4ab onwards.

Note

Repositories in |repo| groups require the |repo| group to be passed as part of the repoid.

# Run the Strip API call
$ rhodecode-api --instance-name=instance-id strip \
    repoid:repo-group/repo-name revision:ad1e0523a4ab branch:stable

# Check the JSON-RPC verification
{
  "error": null,
  "id": 5960,
  "result": {
    "msg": "Stripped commit ad1e0523a4ab from
        repo `repo-group/repo-name`",
    "repository": "repo-group/repo-name"
  }
}
  1. Once the commits are stripped, you can verify that they are stripped on the web interface.
../images/post-strip.png