How to set/update test run owner in Azure Devops Rest API? - azure-devops

I am creating a test run in Azure Devops with Rest API. A sample POST request I make is like:
{
"name": "Test Run Name",
"automated": true,
"plan": {
"id": 11111111,
"name": null,
"url": null,
"state": null,
"iteration": null
},
"pointIds": [
222222222222
],
"build": {
"id": "2222233455",
"buildNumber": "buildNumberjlkajdlajsldj",
"uri": "vstfs:///Build/Build/2222222222",
"sourceBranch": "refs/pull/22222/merge",
"definition": {
"id": "2222"
}
},
"buildConfiguration": {
"id": 3333333,
"number": "buildNumberjlkajdlajsldj",
"uri": "vstfs:///Build/Build/222222222222"
},
"owner": {
"id": "44444444-2222-bbbb-aaaa-1111111111",
"descriptor": "aad.AAAAAAAAAAAAAAAAAAAAAAAAAA"
}
}
But here owner information is ignored and owner is assigned as authorized user of the requester. The requested account have necessary permissions.
Do I make something wrong or owner information cannot be assigned to another user?

Related

configure pwa in saleor

I need help to configure and allow PWA in my saleor project
I have used this configuration from the manifest.webmanifest
{
"id": "example.app.wonderful",
"version": "1.0.0",
"name": "My Wonderful App",
"about": "My Wonderful App is a wonderful App for Saleor.",
"permissions": ["MANAGE_USERS", "MANAGE_STAFF"],
"appUrl": "http://localhost:3001/app",
"configurationUrl": "htpp://localhost:3001/configuration",
"tokenTargetUrl": "http://localhost:3001/register",
"dataPrivacy": "Lorem ipsum",
"dataPrivacyUrl": "http://localhost:3001/app-data-privacy",
"homepageUrl": "http://localhost:3001/homepage",
"supportUrl": "http://localhost:3001/support",
"extensions": [
{
"label": "Create with Sample app",
"mount": "PRODUCT_OVERVIEW_CREATE",
"target": "POPUP",
"permissions": ["MANAGE_PRODUCTS"],
"url": "https://example.com/extension/"
},
{
"label": "Create with App and redirect",
"mount": "PRODUCT_OVERVIEW_CREATE",
"target": "APP_PAGE",
"permissions": ["MANAGE_PRODUCTS"],
"url": "/extension/redirect"
}
],
"webhooks": [
{
"name": "Order created",
"events": ["ORDER_CREATED"],
"query": "subscription { event { ... on OrderCreated { order { id }}}}",
"targetUrl": "https://example.com/api/webhooks/order-created",
"isActive": false
},
{
"name": "Multiple order's events",
"events": ["ORDER_CREATED", "ORDER_FULLY_PAID"],
"query": "subscription { event { ... on OrderCreated { order { id }} ... on OrderFullyPaid { order { id }}}}",
"targetUrl": "https://example.com/api/webhooks/order-event",
"isActive": true
}
]
}
and it gives me the following error
Unhandled Runtime Error
Error: The provided `href` (/[channel]/[locale]/account/orders) value is missing query values (channel, locale) to be interpolated properly. Read more: https://nextjs.org/docs/messages/href-interpolation-failed
Call Stack
_callee$
node_modules/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/shared/lib/router/router.js (752:26)
tryCatch
node_modules/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/compiled/regenerator-runtime/runtime.js (45:15)
Generator.invoke [as _invoke]
node_modules/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/compiled/regenerator-runtime/runtime.js (274:0)
prototype.<computed> [as next]
node_modules/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/compiled/regenerator-runtime/runtime.js (97:0)
asyncGeneratorStep
webpack-internal:///./node_modules/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/shared/lib/router/router.js (13:28)
_next
webpack-internal:///./node_modules/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/shared/lib/router/router.js (31:17)
I'm new to saleor and I don't know how to work with him. I would like to know how to allow the installation of PWAs
Thanks in advance

Unable to retrieve the changeCounts properties for a git Pull Request in AzureDevOps using the REST api

I am trying to find (roughly) the number of lines of code that has been changed in a Pull Request using the Azure DevOps REST Api. The documentation suggests that it is possible but I have been unable to get it to work.
The api's return a GitCommitRef[] as a response and inside the GitCommitRef there is a changeCounts property, but this mostly appears to be missing from most responses.
Things I have tried\observed:
1. List of commits for a pull request
I can get a list of the commits for a pull request, but this does not include the changeCounts
Request
https://{{coreServer}}/{{organization}}/{{project}}/_apis/git/repositories/{{repositoryId}}/pullRequests/{{pullRequestId}}/commits?api-version=6.0
Response
{
"count": 3,
"value": [
{
"commitId": "0b415...669fda",
"author": {
"name": "name",
"email": "name#email.com",
"date": "2021-11-02T03:34:23Z"
},
"committer": {
"name": "name",
"email": "name#email.com",
"date": "2021-11-02T03:34:23Z"
},
"comment": "checkin commit",
"url": "https://dev.azure.com/{{organization}}/{{project}}/_apis/git/repositories/5f32ff...2a97ac1/commits/0b415...669fda"
},
2. Getting a list of commits for a repository does return the changeCounts
So I thought, okay I will just retrieve each commit and get the counts that way, but I cannot get it to honour the searchCriteria, so if I ask for a specific commit I still get all the commits on the repo
https://{{coreServer}}/{{organization}}/{{project}}/_apis/git/repositories/{{repositoryId}}/commits?searchCriteria.compareVersion.version=67...4b4&searchCriteria.compareVersion.versionType=commit&api-version=6.0
Response
{
"count": 100,
"value": [
{
"commitId": "71...a93a",
"author": {
"name": "name",
"email": "name#email.com",
"date": "2021-11-07T23:59:52Z"
},
"committer": {
"name": "name",
"email": "name#email.com",
"date": "2021-11-07T23:59:52Z"
},
"comment": "Merged PR 11087: did some work",
"commentTruncated": true,
"changeCounts": {
"Add": 0,
"Edit": 1,
"Delete": 0
},
3. Specifying the commit id does not return the changeCounts either
If I specify the commit id when retrieving a commit that, only returns the commit but not the changeCounts
https://{{coreServer}}/{{organization}}/{{project}}/_apis/git/repositories/{{repositoryId}}/commits?searchCriteria.ids=0b...fda&api-version=6.0
Response
{
"count": 1,
"value": [
{
"commitId": "0b...da",
"author": {
"name": "name",
"email": "name#email.com",
"date": "2021-11-02T03:34:23Z"
},
"committer": {
"name": "name",
"email": "name#email.com",
"date": "2021-11-02T03:34:23Z"
},
"comment": "did some work",
"url": "https://dev.azure.com/{{organization}}/{{project}}/_apis/git/repositories/5f...ac1/commits/0b...da"
}
]
}
Anyone have an idea why the api's do not seem to be working for me?

How to delete user by email id using azure SCIM api in databricks?

I need to know if there is a way to delete a user from databricks using email only using SCIM api? As of now I can see it can only delete user by ID which means I need to first retrive the ID of the user and then use it to delete.
I am using this api from powershell to delete users by email.
https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/scim/scim-users
If you look into the documentation for Get Users command of SCIM Users REST API, you can see that you can specify the filtering condition for it. For example, to find specific user, you can filter on the userName attribute, like this:
GET /api/2.0/preview/scim/v2/Users?filter=userName+eq+example#databricks.com HTTP/1.1
Host: <databricks-instance>
Accept: application/scim+json
Authorization: Bearer dapi48…a6138b
it will return a list of items in the Resources section, from which you can extract user ID that you can use for delete operation:
{
"totalResults": 1,
"startIndex": 1,
"itemsPerPage": 1,
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"Resources": [
{
"id": "8679504224234906",
"userName": "example#databricks.com",
"emails": [
{
"type": "work",
"value": "example#databricks.com",
"primary": true
}
],
"entitlements": [
{
"value": "allow-cluster-create"
},
{
"value": "databricks-sql-access"
},
{
"value": "workspace-access"
}
],
"displayName": "User 1",
"name": {
"familyName": "User",
"givenName": "1"
},
"externalId": "12413",
"active": true,
"groups": [
{
"display": "123",
"type": "direct",
"value": "13223",
"$ref": "Groups/13223"
}
]
}
]
}

No token in request - Account Linking with new Actions SDK

I am building an action with the new Actions Builder and everything is going pretty smoothly. I just setup account linking and can successfully link my account, however, once I do link my account there is no token included in the subsequent requests for me to use, even though the account linking status is in the request as "LINKED". Can anyone shed any light on why I am not seeing a token?
For reference, here is a version of one of my requests.
{
"requestJson": {
"handler": {
"name": "main"
},
"intent": {
"name": "actions.intent.MAIN",
"params": {},
"query": "Talk to my new app"
},
"scene": {
"name": "actions.scene.START_CONVERSATION",
"slotFillingStatus": "UNSPECIFIED",
"slots": {},
"next": {
"name": "ListPrompt"
}
},
"session": {
"id": "ABwppHE7M6NS8KdyjljEptrtZZ5GkE3qDdaiwjYbL9ehrA-t_c-ZsCrZ_WhN0ZTG5lXXXXXXhU6Im5vgeSwow",
"params": {},
"typeOverrides": [],
"languageCode": ""
},
"user": {
"locale": "en-US",
"params": {},
"accountLinkingStatus": "LINKED",
"verificationStatus": "VERIFIED",
"packageEntitlements": [],
"lastSeenTime": "2020-07-13T12:02:42Z"
},
"home": {
"params": {}
},
"device": {
"capabilities": [
"SPEECH",
"RICH_RESPONSE",
"LONG_FORM_AUDIO"
]
}
}
}
The Google docs for the Account Linking with the new Actions Builder have now been updated with additional information. The token is now provided within the headers of the incoming request. Details of how to find and decode this can be found at https://developers.google.com/assistant/identity/google-sign-in#handle_data_access_requests

Validate the azure-devops PAT

I have created an PAT from azure devops. Now i have create a react app to handle all the api logics. I have a login screen now user need to enter the DEVOPS_TOKEN, ORGANISATION_NAME. How can i validate the user token at login. I couldn't find any api for validate the user.
Any suggestions would be helpful.
After a bit of investigation i found out a way to validate the user. There is an api that is available in Azure Devops: https://dev.azure.com/{ORGANISATION_NAME}/_apis/connectionData.
Need to pass the encoded token in header parameter that results the user authorization.
{
"authenticatedUser": {
"id": "123-13-131231231-123-123-123-123",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;123-13-131231231-123-123-123-123\\user#domain.com",
"subjectDescriptor": "aad.Masdasdpadspoadsjpaodsjapodj",
"providerDisplayName": "User Name",
"isActive": true,
"properties": {
"Account": {
"$type": "System.String",
"$value": "user#domain.com"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
"authorizedUser": {
"id": "123-13-131231231-123-123-123-123",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;123-13-131231231-123-123-123-123\\user#domain.com",
"subjectDescriptor": "aad.Masdasdpadspoadsjpaodsjapodj",
"providerDisplayName": "User Name",
"isActive": true,
"properties": {
"Account": {
"$type": "System.String",
"$value": "user#domain.com"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
"instanceId": "123-13-131231231-123-123-123-123",
"deploymentId": "123-13-131231231-123-123-123-123",
"deploymentType": "hosted",
"locationServiceData": {
"serviceOwner": "123-13-131231231-123-123-123-123",
"defaultAccessMappingMoniker": "PublicAccessMapping",
"lastChangeId": 12313123,
"lastChangeId64": 123123123
}
}