Is there a way to add a custom action to Azure DevOps Pull Requests? - azure-devops

I'm trying to solve this flow:
Developer opens a PR.
Build validation finds some static code rules are being broken.
Developer has the option to ask for a manual review, this is some kind of action that can be performed from the PR (a button click, link, etc.) that will automatically open a DevOps work item.
I can solve the opening of an automatic WI, but is there any way to add a custom button on PRs? Maybe using extensions?
I saw the service hooks, but these are triggered automatically, I need something that will be triggered manually directly from the PR.
Thanks!

Related

DevOps shortcut to latest build of a pipeline

Is there a standard url that always shows the latest running build of a particular pipeline?
In this one build Id is needed.
https://dev.azure.com/myOrg/MyPrj/_build/results?buildId=**1029**&view=results
So Always I am forced to go builds list and pick the one on top. Two clicking and two page loads. Would be nice if I can always reach here on one click.
The answer is Yes.
You can go the latest running build of a particular pipeline by clicking below url:
https://dev.azure.com/{org}/{proj}/_build/latest?definitionId={definitionId}
The DefinitionID is id of the pipeline. Yon can get it on the address bar when you click the pipeline.
Update:
Above url is not documented. I just tested it on my pipeline and found it was working.
If it was working in your case, You can click this url https://dev.azure.com/{org}/{proj}/_build?definitionId={definitionId} to go to the pipeline history page. But you will have to manual pick the one on top in this way.
You can also submit a use voice for this standard url to microsoft development team. Hope they add this to azure devops pipeline.

Azure DevOps: Don't set Task status as Closed when Pull request is merged

I'm using Azure DevOps for both planning and coding,
Now when PR with attached issue (task)is merged, task is set to "Closed" automatically (I use project template based on Agile)
Is there a way to change it, e.g. I'd like my custom status "Ready for deploy" to be set instead of "Closed"?
This is currently controlled by the PR Compeltion Settings:
Unfortunately, the (feature) you're looking for is not presently supported, you can't handle the work item state when you check "Complete linked work item after merging"
Here is a related UserVoice in Microsoft Developer Community site: Customize Work Item State after PR is closed.
You can vote up and add your comment there. This User Voice is already Under Review.
As workaround you could try to use Service Hook to get the PR event and change the work item state to what you want.

Azure DevOps Build Pipeline with repository in GitHub

UPDATE: I think this question was based on a fundamental misunderstanding. When creating the build pipeline definition, I would pick the saved service connection ("GitHub-iQmetrixService" in the screenshot), and then later Azure DevOps would continue to prompt for access to my personal account. This made me think that the build pipeline was linked to my personal account somehow, such that if my account is ever in the future gone or otherwise unable to access the repository, the build pipeline would stop working.
As far as I now understand, this is not the case. The build pipeline definition itself is in fact associated with the service connection, and the reason that Azure DevOps prompts for my personal login is because the integrated YAML editor is going to want to make commits back to the repo, and those commits need to happen "as me". When co-workers go to the pipeline editor, they too are prompted for their personal login.
I'm still a little bit nervous about this understanding, because I can't see anything in the UI that shows what service connection Azure DevOps is using primarily to process the build pipeline, nor can I see any way to change it should that ever be necessary.
When creating a new Build Pipeline, if I tell Azure DevOps that my repository is in GitHub, I am immediately redirected to GitHub to authorize access to my personal GitHub account (to which I have an ambient login). If I instead pick "Other Git", then the next step in the flow lets me say that the source is GitHub, at which point the screen says:
This authorization, set up by someone else in my organization, works just fine, and I can view all of the organization's repositories and set up a new pipeline. But then, if I close the window and try to re-open the pipeline editor, I am immediately redirected once again to the GitHub page to authorize access to my personal account. Editing the pipeline created based on the "GitHub-iQmetrixService" connection does not use the connection and instead wants to establish a new connection based on whatever individual accounts I have access to.
How can I edit the pipeline without creating a connection to the repository that is linked to my own personal account?
As work around, you can take advantage of the browser sessions and cookies.
Configure the browser to let it retain and keep the session. And do not clear the session and cookie data once you close the browser.
For me, I am using Edge. So, I go Settings -> Privacy and Security -> Choose what to clear, then disable the option
After configure this, I do not need input my account, password and Verification code again while I close the windows, re-open and re-edit the pipeline,
If you want to make some configuration changes on this pipeline, please go right corner-> three dots, and choose the Triggers.
After located to the Triggers page, please change to YAML tab.
Then you can do the modified on this pipeline
To provide some clarity, it appears what's going on here is that for YAML build definitions, Azure DevOps doesn't actually go to the build pipeline definition editor when you select "Edit". The YAML text editor it takes you to is in place of the build pipeline definition editor. But, the definition editor can still be reached. #Merlin Liang - MSFT's answer provides (after the horizontal rule) the steps to take to do this. I didn't understand why those steps, though. I created the following graphic to explain specifically the aspect that wasn't clear in my head:

Is there a way to customize Github checks with CircleCI?

I am currently working on the CI of project and I deploy a preview for each github branch that pass all integration tests.
My CI workflow is executed by CircleCI and I can see the progression on github with Github checks. It works pretty nice but description does not reflect what really happens.
For instance I can see this on github :
My problem is I would like to custom message and details actions link. My last job deploys a preview and I would like to be able to put the link somewhere. The best case should be able to open my preview when I click on details button.
Is there any way to do this ?
I send a mail to CircleCI support and I got this anwser :
Hello,
It is not possible at this time to customize this text. Clicking the
details link will bring you to the job on CircleCI. We are currently
working on a utility that will allow you to post comments to the PR
from within a job that may be close to what you are looking for. This
will exist in an Orb (https://circleci.com/orbs/registry/) but I could
not say exactly how long until this is released, though we are
actively working on it.
You may wish to post to our public facing ideas portal:
https://ideas.circleci.com/ideas as a new idea post. This will let our
community vote for this request. Please let us know if we can assist
any further.
So, unfortunately it is not possible yet. Maybe in the future.

In VSTS, can I specify the new state of a linked work item when a pull request is approved?

Once the PR is approved I want to automatically advance the state of the linked work item, but I don't want it to be marked as "complete". Instead I'd like the work item state to be "ready for testing" (still in progress).
For now, work item state can only be changed as complete when merging a PR.
And there has an user voice Customize Work Item State after PR is closed which suggests this feature, you can vote and follow up.
The work around for now is changing the linked work item(s) through CI build (after completing the PR). Detail work flow as follow:
Add a CI build to trigger automatically after the target branch has new commit(s). And add a PowerShell task to update the linked work items state by REST API.
When PR is completed, CI build will be triggered automcally. And the linked work items state will be updated.
You can try to use
Add a rule to a work item type
https://learn.microsoft.com/en-us/azure/devops/organizations/settings/work/custom-rules?view=azure-devops
Create service hook and cosume it later using azure function or logic app https://learn.microsoft.com/en-us/azure/devops/service-hooks/overview?view=azure-devops