openagile / commitstream.web Goto Github PK
View Code? Open in Web Editor NEWCommitStream Web Server
License: BSD 3-Clause "New" or "Revised" License
CommitStream Web Server
License: BSD 3-Clause "New" or "Revised" License
When a user queries for commits on an asset that does not yet have an associated stream, the api should respond with an empty result but not crash.
Example crash: http://v1commitstream.azurewebsites.net/api/query?workitem=S-888888
testing....
Test
We are researching the tfvc.checkin
payload to determine whether we can write a translator on our CommitStream service to get enough information to render several links to the TFS UI for users to follow from a panel in our own application.
git.push
supportThe following can be viewed on one of our public testing instances at VersionOne Development api-examples instance. You will need to use admin / admin for credentials.
Here’s a break down of what we currently produce for the git.push
event:
There are three important links that we are able to extract out of the git.push payload.
We do not currently link the author name to anything.
git.push
payloads for these URLsOur code is here: https://github.com/openAgile/CommitStream.Web/blob/S-60961_TFS_OnPremise/src/app/api/translators/es6/vsoGitTranslator.js#L66-L93
getProperties(event) {
const commit = event.commit;
const branch = event.branch;
const html_url = event.html_url;
const props = {
repo: '',
branchHref: '',
repoHref: ''
};
const urlComponents = html_url.match(/http.?:\/\/..*?_git\/(.*?)\/commit/);
const serverUrlMatch = html_url.match(/(http.?:)\/\/(.*?_git)\//);
if (urlComponents !== null && serverUrlMatch !== null) {
const repoName = urlComponents[2];
const repoOwner = urlComponents[1];
const protocol = serverUrlMatch[1];
const serverUrl = protocol + '//' + serverUrlMatch[2];
props.repo = `${repoOwner}/${decodeURIComponent(repoName)}`;
props.repoHref = serverUrl + '/' + repoName;
props.branchHref = props.repoHref + '/#version=GB' + encodeURIComponent(branch);
} else {
// TODO: use proper error here
throw 'Could not parse VsoGitCommitReceived event props correctly.';
}
return props;
}
tfs.checkin
payload and public documentation differencesWe are confused by the documentation on the web site and what we are actually seeing from VSTS in our cloud instances.
tfvc.checkin
payload format for resourceVersion 1.0
is not being sent from VSTSFrom this document: https://www.visualstudio.com/en-us/docs/marketplace/integrate/service-hooks/events
We see that the resourceVersion = 1.0
payload should be like this, noting that we have the resourceContainers.project.id = be9b3917-87e6-42a4-a549-2bc06a7a878f
{
"id": "f9b4c23e-88dd-4516-b04d-849787304e32",
"eventType": "tfvc.checkin",
"publisherId": "tfs",
"scope": "all",
"message": {
"text": "Normal Paulk checked in changeset 18: Dropping in new Java sample",
"html": "Normal Paulk checked in changeset <a href=\"https://fabrikam-fiber-inc.visualstudio.com/web/cs.aspx?pcguid=d81542e4-cdfa-4333-b082-1ae2d6c3ad16&cs=18\">18</a>: Dropping in new Java sample",
"markdown": "Normal Paulk checked in changeset [18](https://fabrikam-fiber-inc.visualstudio.com/web/cs.aspx?pcguid=d81542e4-cdfa-4333-b082-1ae2d6c3ad16&cs=18): Dropping in new Java sample"
},
"detailedMessage": {
"text": "Normal Paulk checked in changeset 18: Dropping in new Java sample",
"html": "Normal Paulk checked in changeset <a href=\"https://fabrikam-fiber-inc.visualstudio.com/web/cs.aspx?pcguid=d81542e4-cdfa-4333-b082-1ae2d6c3ad16&cs=18\">18</a>: Dropping in new Java sample",
"markdown": "Normal Paulk checked in changeset [18](https://fabrikam-fiber-inc.visualstudio.com/web/cs.aspx?pcguid=d81542e4-cdfa-4333-b082-1ae2d6c3ad16&cs=18): Dropping in new Java sample"
},
"resource": {
"changesetId": 18,
"url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/tfvc/changesets/18",
"author": {
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"displayName": "Normal Paulk",
"uniqueName": "[email protected]"
},
"checkedInBy": {
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"displayName": "Normal Paulk",
"uniqueName": "[email protected]"
},
"createdDate": "2014-05-12T22:41:16Z",
"comment": "Dropping in new Java sample"
},
"resourceVersion": "1.0",
"resourceContainers": {
"collection": {
"id": "c12d0eb8-e382-443b-9f9c-c52cba5014c2"
},
"account": {
"id": "f844ec47-a9db-4511-8281-8b63f4eaf94e"
},
"project": {
"id": "be9b3917-87e6-42a4-a549-2bc06a7a878f"
}
},
"createdDate": "2016-09-19T13:03:26.2056408Z"
}
tfvc.checkin
payload for resourceVersion 1.0
However, when we set issue actual hook payloads from our repo, we don’t see this, instead we see this:
{
"subscriptionId": "20019a9b-3534-4705-a755-198d23de2ed7",
"notificationId": 6,
"id": "b72be65b-614d-4652-9ca9-11d2942a5c91",
"eventType": "tfvc.checkin",
"publisherId": "tfs",
"scope": "all",
"message": {
"text": "Josh Gough checked in changeset 17: Updated README.md S-12345",
"html": "Josh Gough checked in changeset <a href=\"https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=17\">17</a>: Updated README.md S-12345",
"markdown": "Josh Gough checked in changeset [17](https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=17): Updated README.md S-12345"
},
"detailedMessage": {
"text": "Josh Gough checked in changeset 17: Updated README.md S-12345",
"html": "Josh Gough checked in changeset <a href=\"https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=17\">17</a>: Updated README.md S-12345",
"markdown": "Josh Gough checked in changeset [17](https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=17): Updated README.md S-12345"
},
"resource": {
"hasMoreChanges": true,
"teamProjectIds": [
"b70385b4-ae0f-4afd-b166-6aff62bfd0b0"
],
"changesetId": 17,
"url": "https://v1platformtest.visualstudio.com/_apis/tfvc/changesets/17",
"author": {
"id": "0b88cae0-021f-4fa0-b723-d670c74ae474",
"displayName": "Josh Gough",
"uniqueName": "[email protected]",
"url": "https://app.vssps.visualstudio.com/A95780de7-c7d8-4742-a6e7-12e311437415/_apis/Identities/0b88cae0-021f-4fa0-b723-d670c74ae474",
"imageUrl": "https://v1platformtest.visualstudio.com/_api/_common/identityImage?id=0b88cae0-021f-4fa0-b723-d670c74ae474"
},
"checkedInBy": {
"id": "0b88cae0-021f-4fa0-b723-d670c74ae474",
"displayName": "Josh Gough",
"uniqueName": "[email protected]",
"url": "https://app.vssps.visualstudio.com/A95780de7-c7d8-4742-a6e7-12e311437415/_apis/Identities/0b88cae0-021f-4fa0-b723-d670c74ae474",
"imageUrl": "https://v1platformtest.visualstudio.com/_api/_common/identityImage?id=0b88cae0-021f-4fa0-b723-d670c74ae474"
},
"createdDate": "2017-01-20T16:28:45Z",
"comment": "Updated README.md S-12345"
},
"resourceVersion": "1.0",
"resourceContainers": {
"collection": {
"id": "6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67",
"baseUrl": "https://v1platformtest.visualstudio.com/"
},
"account": {
"id": "95780de7-c7d8-4742-a6e7-12e311437415",
"baseUrl": "https://v1platformtest.visualstudio.com/"
}
},
"createdDate": "2017-01-20T16:28:47.755774Z"
}
resourceVersion 1.0-preview.1
does not match eitherWe also tried to change to the resourceVersion 1.0-preview.1 and that also is different:
{
"subscriptionId": "20019a9b-3534-4705-a755-198d23de2ed7",
"notificationId": 8,
"id": "9281bf99-f899-4de5-81ee-6ee990259d90",
"eventType": "tfvc.checkin",
"publisherId": "tfs",
"scope": "all",
"message": {
"text": "Josh Gough checked in changeset 19: Updated README.md S-12345",
"html": "Josh Gough checked in changeset <a href=\"https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=19\">19</a>: Updated README.md S-12345",
"markdown": "Josh Gough checked in changeset [19](https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=19): Updated README.md S-12345"
},
"detailedMessage": {
"text": "Josh Gough checked in changeset 19: Updated README.md S-12345",
"html": "Josh Gough checked in changeset <a href=\"https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=19\">19</a>: Updated README.md S-12345",
"markdown": "Josh Gough checked in changeset [19](https://v1platformtest.visualstudio.com/web/cs.aspx?pcguid=6b1d2d92-0bb2-4ff1-b1e0-5b79fd2abd67&cs=19): Updated README.md S-12345"
},
"resource": {
"hasMoreChanges": true,
"teamProjectIds": [
"b70385b4-ae0f-4afd-b166-6aff62bfd0b0"
],
"changesetId": 19,
"url": "https://v1platformtest.visualstudio.com/_apis/tfvc/changesets/19",
"author": {
"id": "0b88cae0-021f-4fa0-b723-d670c74ae474",
"displayName": "Josh Gough",
"uniqueName": "[email protected]",
"url": "https://app.vssps.visualstudio.com/A95780de7-c7d8-4742-a6e7-12e311437415/_apis/Identities/0b88cae0-021f-4fa0-b723-d670c74ae474",
"imageUrl": "https://v1platformtest.visualstudio.com/_api/_common/identityImage?id=0b88cae0-021f-4fa0-b723-d670c74ae474"
},
"checkedInBy": {
"id": "0b88cae0-021f-4fa0-b723-d670c74ae474",
"displayName": "Josh Gough",
"uniqueName": "[email protected]",
"url": "https://app.vssps.visualstudio.com/A95780de7-c7d8-4742-a6e7-12e311437415/_apis/Identities/0b88cae0-021f-4fa0-b723-d670c74ae474",
"imageUrl": "https://v1platformtest.visualstudio.com/_api/_common/identityImage?id=0b88cae0-021f-4fa0-b723-d670c74ae474"
},
"createdDate": "2017-01-20T16:35:01Z",
"comment": "Updated README.md S-12345"
},
"resourceVersion": "1.0-preview.1",
"createdDate": "2017-01-20T16:35:03.4905568Z"
}
tfvc.checkin
payloads for resourceVersion 1.0
that we receive from VSTSFrom the currently sent 1.0
, we are able to produce a few URL through implicit knowledge that we discovered by hacking around on the address bar in our browser.
We would prefer to get these URLs in the payload itself, similar to what we do in our own API by production HAL resources that have a special _links: {}
object that provides links to relevant resources. You can see an example in our test case here.
But, if we can know that this 1.0
, or what is documented on the web site, will be the actual, stable payload for some time to come, we will feel better about coding this knowledge into our translator.
Looks like one of the hotfixes did not get applied into the code.
We have this in production:
var getWorkitems = function(message) {
var re = new RegExp("[A-Z,a-z]{1,2}-[0-9]+", "g");
var matches = message.match(re);
return matches;
}
var callback = function(state, ev) {
if (ev && ev.eventType && ev.eventType[0] != '$' && ev.metadata && ev.metadata.instanceId
&& ev.data && ev.data.commit && ev.data.commit.message) {
var workItems = getWorkitems(ev.data.commit.message);
var withOutDuplicates = workItems.filter(function (i, p) {
return workItems.indexOf(i) == p;
});
withOutDuplicates.forEach(function(workItem) {
workItem = workItem.toUpperCase();
linkTo('versionOne_CommitsWithWorkitems-' + ev.metadata.instanceId + '_' + workItem, ev);
});
}
};
fromCategory('versionOne_CommitsWithWorkitemMention')
.whenAny(callback);
But, it's different in the code. Need to review and resolve.
Hi,
I am trying to run commitstream locally. When I hit 127.0.0.1:6565 it asks for an api key. When I specify the api key i gave commitstream in the form 127.0.0.1:6565/?apikey= it does not work giving me same error.
Which api key is it looking for?
Because Azure uses http behind it's websites facade process, even though we make an initial request at https://, the Node process is internally running on HTTP, so this code returns http:// instead of https://:
app.get('/app', function(req, res) {
res.setHeader('content-type', 'application/javascript');
var protocol = req.protocol;
var host = req.get('host');
res.render('app', {
apiUrl: protocol + '://' + host + '/api/query?workitem=',
templateUrl: protocol + '://' + host + '/assetDetailCommits.html'
});
});
As an API user, I must be able to remove an inbox from a digest.
Acceptance Criteria:
Route
DELETE /api/:instanceId/inboxes/:inboxId?apiKey=:apiKey
Header
X-HTTP-Method-Override:delete
Inputs
Output
https://github.com/expressjs/method-override
http://docs.geteventstore.com/http-api/3.0.1/deleting-a-stream//
http://stackoverflow.com/questions/2342579/http-status-code-for-update-and-delete
GET requests to the deleted inbox must return 410 (gone) AT-35167
Historical commit data for the inbox will remain AT-35169
POST requests to the deleted inbox must return 410 (gone) AT-35168
User must be able to receive an error message when the inbox fails to be removed from the instance AT-35166
User must be able to receive confirmation when the inbox is successfully removed AT-35165
User must be able to specify the instanceId and inboxId from which the inbox in question is to be removed AT-35164
In settingsController, just use res.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.