fetch activities from bitbucket that were taken yesterday via api 1.0 - bitbucket

I am monitoring lots of projects/repositories in Bitbucket server via API 1.0.
Retrieving projects, repos, pull requests and commits since last time I did is relatively easy: I have to save the IDs of the latest items (commits and pull requests) per repos I have already downloaded and add SINCE to the URL.
But I also want to monitor the actions taken to any pull request (reviewed, merged, commented, etc.) without teching their ids per repo and checking them in a loop.
Is there any way to monitor such activities somehow? Maybe fetching pull-requests that were updated since? Any help is very appreciated! Thank you in advance!

Related

In AzureDevOps Server (on prem) how do I get the timestamp when I last looked at a Pull Request?

I'm using the Microsoft.VisualStudio.Services.Client library (added via NuGet) to connect to my on-prem Azure Dev Ops server and query various bits of information regarding pull requests. I'd like to make a little notification application that can alert me if someone has replied to a comment I made on a pull request. The trick is that I only want to see the notification if I haven't already looked at it.
I know that the system knows when I last looked at the pull request because it decorates pull requests with new content (comments, new code, etc.) with a little dot and when I open a pull request, it tells me that there are new comments since I visited last and tells me how long ago I looked at it.
How do I get access to the date that I opened the pull request in the web via the client libraries or REST? In other words, how would my app know that I have or haven't looked at new comments via the web page?
I did not find such an api that can retrieve the timestamp the last time you looked at the PR.
There is lastUpdatedDate you can use to track the comments that were checked. So as a workaround you can save the lastUpdatedDate to a file in your code, and compare this value everytime when you call api. Then you will get the latest updated comments.
However, PR comments notification can also be configured from azure devops. You can go to your user profile on the top right corner and select notifications to enable the notification for A comment is left on a pull request.
For more information about Azure devops notification, you can check this document.

Pull request policies - Build expires after another pull request was completed. Way to automatically rerun expired builds for other PRs?

This is somewhat similar to Pull request policies - Build expired - How can I run the build again? but looks at the automation side.
Our context: We have pull requests which protect our master branch and each completed pull requests expires the builds of all other pull requests to ensure that the builds of all of the remaining pull requests have to be re-queued and build and test correctly.
Now we have times where we get pull request contention (I am looking at you, end-of-sprint!) in these times we have plenty of pull requests open. While we are working on minimizing the amount, it sometimes just happens.
Is there a plugin or some feature I am missing that actually can trigger all of those expired builds after a PR completes automatically? There is a way to automatically expire all other PR builds, so I would have thought that there is also a way to re-queue them automatically. I know this might trigger a build cascade but I would like to have my PRs always as up-to-date as possible.
Related REST API is not documented, however you can track it by tools such as Fiddler or press F12 in Chrome browser then select Network.
In the pull request page to manually queue the build as mentioned in your question.
For example with my azure devops service, I get below API
Post https://dev.azure.com/patricklu/_apis/Contribution/dataProviders/query/project/a72e1ef5-4921-49c5-9260-e72b7bff977d
Request Body:
{"contributionIds":["ms.vss-code-web.pull-request-detail-policy-data-provider"],"context":{"properties":{"repositoryId":"357893bf-9a1f-4ee4-95d3-c5ceda4f4abc","pullRequestId":12,"policyEvaluationIds":["bca44f9f-268f-4640-aa7e-af5253b3b11e"],"pageSource":{"contributionPaths":["VSS","VSS/Resources","q","knockout","mousetrap","mustache","react","react-dom","react-transition-group","jQueryUI","jquery","OfficeFabric","tslib","#uifabric","VSSUI","ContentRendering","ContentRendering/Resources","TFSUI","TFSUI/Resources","WidgetComponents","WidgetComponents/Resources","Charts","Charts/Resources","TFS","Notifications","Presentation/Scripts/marked","Presentation/Scripts/URI","Presentation/Scripts/punycode","Presentation/Scripts/IPv6","Presentation/Scripts/SecondLevelDomains","highcharts","highcharts/highcharts-more","highcharts/modules/accessibility","highcharts/modules/heatmap","highcharts/modules/funnel","Analytics"],"diagnostics":{"sessionId":"8277adc6-6810-4cf9-b984-10860e90c0b5","activityId":"8277adc6-6810-4cf9-b984-10860e90c0b5","bundlingEnabled":true,"cdnAvailable":true,"cdnEnabled":true,"webPlatformVersion":"M156","serviceVersion":"Dev17.M156.1 (build: AzureDevOps_M156_20190821.17)"},"navigation":{"topMostLevel":8,"area":"","currentController":"Apps","currentAction":"ContributedHub","currentParameters":"12","commandName":"Git.pullrequest","routeId":"ms.vss-code-web.pull-request-review-route","routeTemplates":["{project}/{team}/_git/{GitRepositoryName}/pullrequest/{parameters}","{project}/_git/{GitRepositoryName}/pullrequest/{parameters}","_git/{project}/pullrequest/{parameters}"],"routeValues":{"project":"GITAgile","parameters":"12","controller":"Apps","action":"ContributedHub","vctype":"git","viewname":"pull-request-review"}},"project":{"id":"a72e1ef5-4921-49c5-9260-e72b7bff977d","name":"GITAgile"},"selectedHubGroupId":"ms.vss-code-web.code-hub-group","selectedHubId":"ms.vss-code-web.pull-request-hub","url":"https://dev.azure.com/patricklu/_git/GITAgile/pullrequest/12?_a=overview"},"sourcePage":{"url":"https://dev.azure.com/patricklu/_git/GITAgile/pullrequest/12?_a=overview","routeId":"ms.vss-code-web.pull-request-review-route","routeValues":{"project":"GITAgile","parameters":"12","controller":"Apps","action":"ContributedHub","vctype":"git","viewname":"pull-request-review"}}}}}
As you can see there is some value such as repository ID and pull Request ID. Follow this, you should be able to user API to rerun some builds for a specific Pull Request.
You could use Azure DevOps Services service hooks or Rest API to track pull request completed or not, then use above API call to re-run the build. Hope this helps.

What is the intended pull request rejection workflow in TFS/Team Services?

my team and I are using Team Services with Visual Studio 2015. I understand the concept of a pull request, but the rejection and correction process is very blur.
MSDN falls short of covering this part on the main page regarding the topic: https://msdn.microsoft.com/en-us/library/vs/alm/code/git/pull-requests
Basically, when you reject a pull request, what's expected of the person that created it? Should he modify his branch and issue a new different request? or bring changes to his branch in a way that will make it appear under the current request? In the latter case, how?
Thanks
More detailed description is placed here: Conduct a Git pull request on Visual Studio Online
Make changes on the source branch
To act on the feedback, the requestor revises the code on their dev
machine and pushes the changes so that reviewers can see them.
So the requestor need to update his code and push the changes into source branch. The code in the pull request will be updated automatically after new change is pushed.

Is there an API to access the Import/Copy Components log files in D2L?

Using the (g)ui in desire2learn, if you have sufficient permissions you can look at the history of import/copy requests for a target org unit. Is there a programmatic way to access that history?
We copy lots of items using Valence and the only indications we get are if the job itself failed. Often a job will succeed, yet some part of the copy failed and we want know that.
A new experimental API route to retrieve the logs for an import job will be released on v10.4.10 of Brightspace in continuous release. The docs for it will be coming very soon, but the route won't be available to clients on platforms older than v10.4.10.

Get list of pull requests in Repository

I want to get all pull requests in repository but this seems impossible. I was able to find only pull requests comments (https://confluence.atlassian.com/display/BITBUCKET/pullrequests+Resource)
How could one use this resource if he cannot get request ids? Is there any way to get pull requests?
The new API is now out and list of pull requests works fine
https://bitbucket.org/!api/2.0/repositories/YOUR_NAME/REPO_NAME/pullrequests
It is officially impossible. But promised to be fixed soon.

Resources