Query TFS to show all releases and whether or not it is set for approval. V 2017.3 - sql

I need to run a query in sql that will show all the TFS releases from all projects and whether or not it is setup for pre relase approvals. I see in the defaultcollection db there is the Release.tbl_ReleaseDefinition table, it has a lot of data but not approval info. I do see the Release.tbl_DefinitionEnvironment and I see ApprovalOptions there, but that seems to be showing the approval info for every release created whereas I am needing info on release definitions only.

Just as Daniel pointed out, we highly not recommend you dig into TFS databased directly.
According to your description, you just need the approval info for all release definitions. Suggest you use Rest API to handle this.
For a single release, you could use below Rest API:
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions/{definitionId}?api-version=5.1
It will return both preDeployApprovals and postDeployApprovals, for example:
"preDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": false,
"isNotificationOn": false,
"approver": {
"displayName": "Chuck Reinhart",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/aeb95c63-4fac-4948-84ce-711b0a9dda97",
"_links": {
"avatar": {
"href": "https://dev.azure.com/fabrikam/_apis/GraphProfile/MemberAvatars/aad.YjYxMjE5ZWQtODEwYS03OTU3LWJjYzAtMjQ0YTI5ZDk0ZjFl"
}
},
"id": "aeb95c63-4fac-4948-84ce-711b0a9dda97",
"uniqueName": "fabfiber#outlook.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=aeb95c63-4fac-4948-84ce-711b0a9dda97",
"descriptor": "aad.YjYxMjE5ZWQtODEwYS03OTU3LWJjYzAtMjQ0YTI5ZDk0ZjFl"
},
"id": 118
}
],
More details please take a look at official doc here: Definitions - Get
For multiple release, you should use list: Definitions - List
Hope this helps.

Related

Azure FHIR search for resources with _include

I have a DiagnosticReport resouce that has an encounter and 3 observation resources references. I am trying to do a search query that would return a Bundle with the DiagnosticReport and all referenced resources so as to not have to do 4 other queries.
"encounter": {
"reference": "Encounter/8720d7d7-68cc-3575-8c79-9de39561324c"
},
"effectivePeriod": {
"start": "2020-07-01T08:16:00.000Z",
"end": "2020-07-01T08:16:00.000Z"
},
"issued": "2020-07-01T08:17:03+00:00",
"result": [
{
"reference": "Observation/89510c61-8a94-3c65-8832-3397d2a70bfd"
},
{
"reference": "Observation/3d837dbf-3d4c-3742-9b6e-2638d26d8c54"
},
{
"reference": "Observation/618ec246-2d98-3179-a0a2-a0094046f466"
}
]
I have tried
[Base]/DiagnosticReport/{id}?_include=DiagnosticReport:Encounter
[Base]/DiagnosticReport/{id}?_include=DiagnosticReport:Encounter/{id}
Is there a way to get the DiagnosticReport & Encoutner & Observation in one Bundle?
This is an SQL OSS FHIR Server, so according to Documentation _include is supported in the SQL Version of azure.
You need to use the search parameters when you specify the includes, so in your case:
https://fhir-server-url/DiagnosticReport?_id=1234&_include=DiagnosticReport:encounter&_include=DiagnosticReport:result
Will return the Encounter and the Observation resources in the bundle.
I'm using FHIR API Service also. I ran across this issue for Encounter and this worked for me.
https://lcavantage.azurehealthcareapis.com/Encounter?_id=f1c06cc6-be9c-e673-408e-e6e303d9924a&_include=Encounter:subject
I believe this works now because COSMOS DB has had a few updates this question was presented and handles relationships better!

RequireJS script error when requiring "ReleaseaManagement/Core/RestClient" on TFS 2015 and 2017

I'm creating an tfs hub Extension (2015/2017) and need to read the projects' release defs and create releases also. I know, I could make direkt Rest Calls instead of using the methods of the rest clients. But they seem more comfortable to me.
When I try to get the Restmanagement RestClient, I get:
Script error for: ReleaseManagement/Core/RestClient
http://requirejs.org/docs/errors.html#scripterror
In both TFS.2015.2 and TFS.2017
Doesn't the client yet exist on-premise?
You can refer to this article for how to use Rest API in extension to read a release definition: Writing a ReleaseManagement extension for cloning an existing release definition.
The code to read a release definition:
VSS.require(["VSS/Controls", "VSS/Service", "ReleaseManagement/Core/RestClient"],
var rmClient = VSS_Service.getCollectionClient(RM_WebApi.ReleaseHttpClient);
rmClient.getReleaseDefinition(vsoContext.project.id,sourceItemContext.definition.id);
And if you are using typescript, you need to include "ms.vss-releaseManagement-web.release-service-data-external" in the contribution like following:
"contributions": [
{
"id": "release-status",
"type": "ms.vss-web.hub",
"includes": [ "ms.vss-releaseManagement-web.release-service-data-external" ],
"description": "A hub to show release status",
"targets": [
"ms.vss-work-web.work-hub-group"
],
"properties": {
"name": "hello",
"order": 99,
"uri": "app.html"
}
}
]

Detecting Google Drive changes

I'm quite confused by how to operate the changes API.
At the moment, I'm just making get requests:
https://www.googleapis.com/drive/v3/changes?access_token=**my_token**&pageToken=68485 **Last few additions to the list
I get:
{
"kind": "drive#changeList",
"newStartPageToken": "68489",
"changes": [
{
"kind": "drive#change",
"type": "file",
"time": "2017-04-08T00:40:36.141Z",
"removed": false,
"fileId": "***ID",
"file": {
"kind": "drive#file",
"id": "***ID",
"name": "***NAME",
"mimeType": "application/vnd.google-apps.folder"
}
},
{
"kind": "drive#change",
"type": "file",
"time": "2017-04-08T00:41:00.171Z",
"removed": false,
"fileId": "***ID2",
"file": {
"kind": "drive#file",
"id": "***ID2",
"name": "***NAME2",
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
}
]
I'm not aware of making changes to the first item in the changes array.
After playing around, I realised that every time a folder is opened it's added to the changes, why? Is it because the meta-data is being changes, i.e. last-accessed?
Does the same thing happen when files are previewed/opened/downloaded?
I trashed the second item in the array, yet it shows nothing about this.
How exactly am I to tell what is being changed. I'm trying to retrieve events such as file updates, creations, deletions etc.
The official properties that Changes uses which are found in the Changes resource representations:
{
"kind": "drive#change",
"type": string,
"time": datetime,
"removed": boolean,
"fileId": string,
"file": files Resource,
"teamDriveId": string,
"teamDrive": teamdrives Resource
}
Now this might not make a complete answer but I'd like to share some points.
Is it because the meta-data is being changes, i.e. last-accessed?
Yes, it is. It's a bit strange but yes, even previewing the file counts as a change. If you've closely watched the Drive's Android App, you can see that just viewing a photo will populate it under the "Recents" tab.
In API v2, there was even a files.touch() method, just for updating the last accessed time of a file!
How exactly am I to tell what is being changed?
There is a property named changes[] returned by changes.list() which is a list containing the changes. You could use this to determine if the change was relevant to you (like updation, creation, deletion) or ignore if it was just a preview.
To add to this, instead of continuously checking for changes, a more efficient way to detect changes is by using the changes.watch() method to subscribe for updates to the changes, which I hope you are already aware of.
And about trashing. Trashing doesn't really "change" a file in Drive. A trashed file is treated just like an ordinary file with the exception of having "Trashed" flag, which makes it directly invisible. Note that shared files are still accessible by collaborators, even if it's trashed. However, change should fire if the file is permanently deleted.

Revoking default permission fails in new Office 365 Group

After a file is uploaded to an Office 365 Group’s OneDrive using the Graph API, we want to revoke the default permissions on the file. However, in groups which have only recently be created, this fails.
By default, a file's permissions are “GroupName Owners”, “GroupName Members” and “GroupName Visitors”. We want to remove these permissions and grant access to specific AD Security Groups.
After uploading a file we are seeing two different results when getting the default permissions (in preparation to delete them).
In one case, we get four permissions – the three listed above, plus a ‘special’ permission which has grantedTo with a user with id matching the group id. We have learned not to delete this permission, as we lose the ability to delete the other permissions.
Here, this ‘special’ permission is the first one listed:
{
"#odata.context": "https://graph.microsoft.com/V1.0/$metadata#drives('b%21Y25ow5oitkOvNToutf7LrYZ-y78P2jBEjoGLzb3oPqnw0a3YKFDwTobjTB4gYxKt')/root/permissions",
"value": [
{
"grantedTo": {
"user": {
"id": "273c2c33-8533-445d-ae65-4b63be296995",
"displayName": "SharePoint Tests"
}
},
"id": "Yzowby5jfGZlZGVyYXRlZGRpcmVjdG9yeWNsYWltcHJvdmlkZXJ8MjczYzJjMzMtODUzMy00NDVkLWFlNjUtNGI2M2JlMjk2OTk1X28",
"roles": [
"write"
]
},
{
"grantedTo": {
"user": {
"displayName": "SharePoint Tests Owners"
}
},
"id": "U2hhcmVQb2ludCBUZXN0cyBPd25lcnM",
"roles": [
"SP.Full Control",
"write"
]
},
{
"grantedTo": {
"user": {
"displayName": "SharePoint Tests Visitors"
}
},
"id": "U2hhcmVQb2ludCBUZXN0cyBWaXNpdG9ycw",
"roles": [
"read"
]
},
{
"grantedTo": {
"user": {
"displayName": "SharePoint Tests Members"
}
},
"id": "U2hhcmVQb2ludCBUZXN0cyBNZW1iZXJz",
"roles": [
"SP.Edit"
]
}
]
}
However, for a period after the group has been created, after uploading a file, we only get 3 permissions back – the special one mentioned above is missing. In this case, trying to delete the other permissions fail with an ‘unauthenticated’ error code. E.g.
DELETE https://graph.microsoft.com/V1.0/drives/b!zn7l0OHTmUa3lGABIbIGQIZ-y78P2jBEjoGLzb3oPqnw0a3YKFDwTobjTB4gYxKt/items/013LUA5IQEPURED3OSURAI27FBHDYLFQJP/permissions/U2FnZSAtIFBBUiBTZWN1cml0eSA0IE93bmVycw
We can still add permissions, just not revoke the default ones.
This condition seems to persist for all files created within a given Office 365 Unified Group until several minutes after it has been created.
Our only option at the moment looks to be to create a dummy file, and see if we get 3 or 4 permissions back (or just try deleting the default permissions). If we only get 3 try again after some time period. But this seems like a fragile hack, and adds significant time (several minutes) to our upload process.
Does anyone have any better suggestions, or an explanation of this behaviour?
Thanks
Peter, Groups files are stored in a SharePoint document library and hence permissions (owners & members) are inherited from the AzureAD and cannot be changed, see this documentation for more information: https://support.office.com/en-us/article/Learn-about-Office-365-groups-b565caa1-5c40-40ef-9915-60fdb2d97fa2?ui=en-US&rs=en-US&ad=US&fromAR=1
You can't break inheritance and please see these additional features we are rolling specific to the SharePoint document library: https://techcommunity.microsoft.com/t5/SharePoint/UPDATE-Create-Office-365-Groups-with-team-sites-from-SharePoint/m-p/48277

Xbmc Database Path

I am working with XBMC. I have installed XBMC in my system(Windows 7, 32 bit). Xbmc is working fine in my system. I have developed an application in order to control the Xbmc remotely from Ipad. In order to retrieve the music files or video files from Xbmc, I am unable to. By searching the forums of xbmc, I found that we can write an sql query to get them out. But, the thing is I am unable to make out where the database is located in my system. Someone help me out where I can find it.
Regards,
Sushma.
The database itself
By default the location of the database is that described on the wiki page XBMC databases
but the actual location can be changed by the user, or a different database technology can be used entirely.
The settings that would affect this are located in advancedsettings.xml.
But in general it is advised by the XBMC developers to never access the database directly.
JSONRPC
In order to help with interacting with the database XBMC has supported the JSONRPC queries, the one downside of these is that XBMC needs to be running at the time to respond to these queries. The major advantage is that it XBMC will find the database for you and expose access to it with a common interface.
JSONRPC support was first added to XBMC in "Darhma" (v10), became really useful in "Eden" (v11) and will support almost everything possible in "Frodo" (v12). Information about the use of JSONRPC can be found in the wiki.
An example
In this example I'm assuming that you are targeting "Eden", the current stable release of XBMC. Also I have formatted the following with new lines, these are not required and are not present in the response from XBMC.
Request
If you were to use JSONRPC the request you would need to send would look something like:
{
"jsonrpc": "2.0",
"method": "VideoLibrary.GetMovies",
"params": {
"properties": [
"title",
"year",
"file"
],
"limits": {
"start": 0,
"end": 2
}
},
"id": 1
}
Note: If you wanted different information about each movie you could use other properties listed here.
*Note: You probably want to omit the "limits" part to get all movies.*
Responce
The response to this would be something like:
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"limits": {
"end": 2,
"start": 0,
"total": 47
},
"movies": [
{
"label": "Label for movie",
"movieid": 1,
"title": "Title of movie",
"year": 2012
},
{
"label": "Label for another movie",
"movieid": 2,
"title": "Title of another movie",
"year": 2010
},
{
"label": "Label for a third movie",
"movieid": 3,
"title": "Title of a third movie",
"year": 2012
}
]
}
}
What to do now?
You have a choice at this point, you can either:
Add "file" to the list of properties, this will return the "file" property, the location of the video file.
Use JSONRPC to tell xbmc to play a movie.
Using this method is best when you don't want to play the file locally (on the iPad) but instead on XBMC.
Playing a movie on XBMC via JSONRPC
This is quite simple, use the "movieid" you received earlier in the following request:
{
"jsonrpc": "2.0",
"method": "Player.Open",
"params": {
"item": {
"movieid": 2
}
},
"id": 1
}
Lastly I would note that there are equivalent commands for TV episodes as shown for movies.