Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node execution engine and build tooling #1139

Closed

Conversation

sandorfr
Copy link

@sandorfr sandorfr commented Jan 18, 2017

Addresses #909

@sandorfr
Copy link
Author

sandorfr commented Jan 18, 2017

There is still a few things to be done especially (geeklearningio/gl-vsts-tasks-build-scripts#1), but I'm creating the PR so progress can be monitored.

Copy link
Member

@pascalberger pascalberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandorfr Thank for this PR! Very much appreciated. I added some comments inline.

I think the biggest open issue is the integration in to the current build pipeline and the already mentioned required npm package for replacing the submodule.

Regarding the integration in the build pipeline: We currently use a Cake script for building the solution. This is the script which is triggered on AppVeyor. The VSTS/TFS task is also part of the Visual Studio Solution. If you rename files, this also needs to be reflected there. As part of the AfterBuild target of the GitVersionExe project we currently copy around the files for the VSTS/TFS task and call a PowerShell script for patching version and one for creating the VSIX. If we switch the build for the VSTS/TFS task to npm scripts this needs also to be cleaned up.

IMHO using npm for the build part of the VSTS/TFS task could make sense. But in this case the npm build script should be called from the Cake script, where also the version information is available.

Maybe other @GitTools/developers have another opinion about the build pipeline :) So maybe it would be good to have a quick discussion about it here.


if (!gitVersionPath) {
gitVersionPath = tl.which("GitVersion.exe");
gitVersionPath = path.join(currentDirectory, "GitVersion.exe");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense. I assume the second assignment should be the fallback in case which couldn't find the tool?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an if missing indeed.

"/nofetch"
]);


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove second blank line

if (result) {
tl.setResult(tl.TaskResult.Failed, "An error occured during GitVersion execution")
} else {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line

tl.setResult(tl.TaskResult.Failed, "An error occured during GitVersion execution")
} else {

// workaround gitversion to make sure variable are availabel in all vsts build contexts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Available

}
})();


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank lines

@@ -0,0 +1,99 @@
import tl = require('vsts-task-lib/task');
import path = require('path');
import fs = require('fs-extra');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not to be used

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fs-extra is actually not used, I'll remove the dep

@@ -0,0 +1,99 @@
import tl = require('vsts-task-lib/task');
import path = require('path');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not to be used

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl and path are used almost everywhere. ;)

"author": "",
"license": "ISC",
"dependencies": {
"fs-extra": "0.30.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not to be used

"dependencies": {
"fs-extra": "0.30.0",
"vsts-task-lib": "0.9.20",
"q" : "1.4.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not to be used

.gitmodules Outdated
@@ -0,0 +1,3 @@
[submodule "src/GitVersionTfsTask/BuildScripts"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already mentioned instead of a submodule this should be included by npm (see geeklearningio/gl-vsts-tasks-build-scripts#1).

The whole build pipeline needs generally a little bit more work. It needs to be integrated into the existing build pipeline.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll focus on fixing everything on the task itself. Once we have something working and satisfying and depending on your preference I will either publish our tooling on npm or drop our tooling from the PR. Meanwhile it allows me to publish private extension for testing purpose more easily.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've decided to go forward with the npm package. So I've updated this PR accordingly. I'll investigate the vsts beta feature.

@@ -0,0 +1,12 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer we use typescript 2 and @types rather than typings

"private": true,
"main": "index.js",
"author": "",
"license": "ISC",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use MIT to match GitVersion

Copy link
Contributor

@JakeGinnivan JakeGinnivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove binaries which have been checked in

}
},
{
"Name": "dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a requirement, I would prefer prerelease or something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can change it or remove it.

@@ -1,9 +1,8 @@
{
"manifestVersion": 1,
"id": "gitversion",
"id": "gl-gitversion",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revert it when it's ready, meanwhile it allows me to publish a prerelease version of it without any conflicts :)

"name": "GitVersion",
"publisher": "gittools",
"public": true,
"publisher": "geeklearningio",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one

"name": "GitVersion",
"publisher": "gittools",
"public": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove public?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our tooling allows you to build different version of the same extension. In order to do that we use the extension flags instead and they are configured in configuration.json.

}
],
"content": {
"details": {
"path": "overview.md"
}
},
"contributions": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have they moved more towards convention over configuration?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this just filled automatically by our tooling, if you decided to keep the tooling, they are no longer needed.

@@ -0,0 +1,16 @@
{
"name": "git-version",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the -, should be gitversion

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing it but it does not really matter as this file is just here to indicate the dependency to be bundled with the task.

{
"name": "git-version",
"version": "1.0.0",
"private": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why private?

Copy link
Author

@sandorfr sandorfr Feb 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not meant to be published to npm, It allows some of the usually fields required by package.json to be missing.

"license": "MIT",
"dependencies": {
"vsts-task-lib": "0.9.20",
"q" : "1.4.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not native promises?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vsts-task-lib depends on q. I guess this is related to the fact that some agents are running older versions of node which won't provide native Promises.

"./Tasks/*.ts",
"./Tests/*.ts",
"./typings/index.d.ts",
"./Commom/Node/*.d.ts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling, should be Common?

@sandorfr
Copy link
Author

Hi @JakeGinnivan @pascalberger, thanks for taking the time to review this. Just mentioning if it was not clear that this PR is more to show the work in progress, and comment on the core of it (gitversion.ts).

I know that our tooling might be confusing for you, but I need it to be able to use our continuous delivery pipeline which I use to actually build publish and test this extension. But when my work will be done, and the tasks will be 100% functional, I can make a new PR without any of our tooling. We think it's great but don't want to be pushy about it.

Meanwhile the real issue I'm facing is that the current portable version crashes on the Mac. The good news is this is probably a gitversion bug which has been fixed in libgit2/libgit2sharp#1409. The bad news is a version of gitversion including this fix hasn't been released yet :(

@JakeGinnivan
Copy link
Contributor

I would love to get this in for personal reasons :)

Would we be able to drop the initial cut without the shared tooling then switch over to the reusable tooling once it is ready?

@JakeGinnivan
Copy link
Contributor

Once we merge this into master I will release it soon after that and you will not need your own GitVersion pipeline

@JakeGinnivan
Copy link
Contributor

Would also allow us to release pre-release packages to VSTS and also close issues like #1150

@sandorfr
Copy link
Author

Ok, @JakeGinnivan I try to find some time to make the new minimal PR very soon.

libgit2sharp apparently released a pre-release with the fix: https://www.nuget.org/packages/LibGit2Sharp/0.24.0-pre20170124092542. If someone can see on your side if there is a way for you to update the lib so it really works on macosx, that would be awesome :)

@sandorfr sandorfr mentioned this pull request Mar 15, 2017
@sandorfr sandorfr closed this Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants