Hello, colleagues! I'm trying to fetch list of completed reviews with REST API - it's simple sure, but I need to extract:
With 2nd i can use "users-v1" API endpoint, but not all users have emails there. But with 1st I have big problem - I can not find way to extract Git branch name! Is there any way to find Git branch name? As I understand, Crucible has this info - files were submitted, review was completed, branch is known... But how to get it from REST API of Crucible? (I use Crucible + FishEye service).
I tryed different API calls, found in documentation field "ahcnorName" - it looks like branch name, but when I try to call repositories' related endpoints with existing repositories, I get error that repository not found...
Can somebody show an example of call/point out REST call - how to get Git branch name related to completed review?
Are you using branch reviews to run the reviews? If so, you can try using undocumented REST API to retrieve the list of all the branches tracked in particular review. Issue a GET request to http://<CRUCIBLE_URL>/rest/branchreview/latest/trackedbranch/<REVIEW_KEY> to get document like:
[ { "id": "<HASH>", "repositoryName": "repositoryName", "repositoryDisplayName": "repository display name", "repositoryType": "git", "reviewedBranch": "some-feature-branch", "baseBranch": "master", "autoUpdate": false, "lastChangesetId": "<HASH>" } ]
If you are not using branch reviews but are adding content to review differently (e.g. by picking up individual changesets, files, etc.) I'm afraid it might be a challenge to identify what branch those changes come from. git doesn't really track the branch changeset was created on.
Hope that helps,
Hello, Piotr. It seems I also found this:
https://HOST/rest-service-fe/commit-graph-v1/slice/REPO-NAME?size=1&id=GIT-HASH
Both params I know from:
https://HOST/rest-service/reviews-v1/REVIEW-PERMA-ID/details. But with this way I have another questions:
--
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
re 1. repositoryName is returned for each individual reviewItem (file on the review), so yes, it's always scalar value, as single file is coming from at most 1 repository. repositoryName might be missing for uploaded files or patches though, so I wouldn't assume it's always there.
re 2. fromRevision and toRevision indicate versions presented on revision slider, top of the review file. Depending of what you want to achieve you might be interested in one of those fields or both
re 3. again, this depends what data you are after. Remember git doesn't store information what branch particular commit was made on, this is dynamic and relation between particular changeset and branches may change over the time, where more branches are created or merged and their ancestry start to contain particular changeset.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.