mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 17:23:27 -05:00
* Added endpoint for fetching all notebook jobs * Refractored NotebookJobInfo to AgentNotebookInfo to make it more consistent with the rest of the codebase * Added Notebook History endpoint in contracts. * Added Create, Update, Delete notebook endpoints. Also added separate fetch template, materialized notebook endpoints. This will make the Notebook Request and Notebook History responses lighter. * AgentNotebookInfo is now derived from AgentJobInfo * added fetch noteook history endpoint * Added fetching materialized notebook endpoint * Added code for cleaning up the directory * Added create notebook api * Added Update and delete notebook job * Fixed notebook history API * Added last run info to the script and template folder * Added execute database feature for notebook Jobs * SQL commands are now using sqlparameters to prevent any injection attacks * Changed rundate and runtime to string to preserve leading zeros * integration test for agentnotebooks api * Made some changes mentioned in PR * Refactored the code, removed enpoint logic from the notebook handler and wrote test cases * changes select statements, fixed a bug in the test job cleanup and fixed other stuff mentioned in the PR. * added notebook_error column in notebook history select statement * Added get template notebook endpoint
108 lines
2.6 KiB
JavaScript
108 lines
2.6 KiB
JavaScript
var gulp = require('gulp');
|
||
var del = require('del');
|
||
var request = require('request');
|
||
var fs = require('fs');
|
||
var gutil = require('gulp-util');
|
||
var through = require('through2');
|
||
var cproc = require('child_process');
|
||
var os = require('os');
|
||
|
||
function nugetRestoreArgs(nupkg, options) {
|
||
var args = new Array();
|
||
if (os.platform() != 'win32') {
|
||
args.push('./nuget.exe');
|
||
}
|
||
args.push('restore');
|
||
args.push(nupkg);
|
||
|
||
var withValues = [
|
||
'source',
|
||
'configFile',
|
||
'packagesDirectory',
|
||
'solutionDirectory',
|
||
'msBuildVersion'
|
||
];
|
||
|
||
var withoutValues = [
|
||
'noCache',
|
||
'requireConsent',
|
||
'disableParallelProcessing'
|
||
];
|
||
|
||
withValues.forEach(function(prop) {
|
||
var value = options[prop];
|
||
if(value) {
|
||
args.push('-' + prop);
|
||
args.push(value);
|
||
}
|
||
});
|
||
|
||
withoutValues.forEach(function(prop) {
|
||
var value = options[prop];
|
||
if(value) {
|
||
args.push('-' + prop);
|
||
}
|
||
});
|
||
|
||
args.push('-noninteractive');
|
||
|
||
return args;
|
||
};
|
||
|
||
function nugetRestore(options) {
|
||
options = options || {};
|
||
options.nuget = options.nuget || './nuget.exe';
|
||
if (os.platform() != 'win32') {
|
||
options.nuget = 'mono';
|
||
}
|
||
|
||
return through.obj(function(file, encoding, done) {
|
||
var args = nugetRestoreArgs(file.path, options);
|
||
cproc.execFile(options.nuget, args, function(err, stdout) {
|
||
if (err) {
|
||
throw new gutil.PluginError('gulp-nuget', err);
|
||
}
|
||
|
||
gutil.log(stdout.trim());
|
||
done(null, file);
|
||
});
|
||
});
|
||
};
|
||
|
||
gulp.task('ext:nuget-download', function(done) {
|
||
if(fs.existsSync('nuget.exe')) {
|
||
return done();
|
||
}
|
||
|
||
request.get('http://nuget.org/nuget.exe')
|
||
.pipe(fs.createWriteStream('nuget.exe'))
|
||
.on('close', done);
|
||
});
|
||
|
||
gulp.task('ext:nuget-restore', function() {
|
||
|
||
var options = {
|
||
configFile: './nuget.config',
|
||
packagesDirectory: './packages'
|
||
};
|
||
|
||
return gulp.src('./packages.config')
|
||
.pipe(nugetRestore(options));
|
||
});
|
||
|
||
|
||
gulp.task('ext:code-coverage', function(done) {
|
||
cproc.execFile('cmd.exe', [ '/c', 'codecoverage.bat' ], {maxBuffer: 1024 * 1000}, function(err, stdout) {
|
||
if (err) {
|
||
throw new gutil.PluginError('ext:code-coverage', err);
|
||
}
|
||
|
||
gutil.log(stdout.trim());
|
||
});
|
||
return done();
|
||
});
|
||
|
||
gulp.task('test', gulp.series('ext:nuget-download', 'ext:nuget-restore', 'ext:code-coverage'));
|
||
|
||
gulp.task('default', gulp.series('test'));
|