This commit is contained in:
Anton Kharitonov 2017-08-31 14:26:43 +02:00
Родитель e6dfb82d6b
Коммит fb81351e49
6 изменённых файлов: 29 добавлений и 23 удалений

5
manifest.yml Normal file
Просмотреть файл

@ -0,0 +1,5 @@
applications:
- name: cla-assistant-staging
services:
- cla-staging-env
- my-logs

Просмотреть файл

@ -38,7 +38,7 @@
"karma-mocha": "^1.1.1", "karma-mocha": "^1.1.1",
"memory-cache": "^0.1.6", "memory-cache": "^0.1.6",
"merge": "^1.2.0", "merge": "^1.2.0",
"mongoose": "^4.5.2", "mongoose": "^4.11",
"node-sass-middleware": "^0.10.0", "node-sass-middleware": "^0.10.0",
"passport": "^0.3.2", "passport": "^0.3.2",
"passport-accesstoken": "^0.1.0", "passport-accesstoken": "^0.1.0",
@ -80,7 +80,7 @@
"supertest": "2.0.1" "supertest": "2.0.1"
}, },
"engines": { "engines": {
"node": "6.10.3" "node": "7.10"
}, },
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",

Просмотреть файл

@ -142,15 +142,13 @@ async.series([
var mongoose = require('mongoose'); var mongoose = require('mongoose');
mongoose.connect(config.server.mongodb.uri, { mongoose.connect(config.server.mongodb.uri, {
server: { useMongoClient: true,
socketOptions: { keepAlive: true
keepAlive: 1 }, (err, db) => {
} bootstrap('documents', callback);
}
}); });
global.models = {}; global.models = {};
bootstrap('documents', callback);
}, },
function (callback) { function (callback) {

Просмотреть файл

@ -11,7 +11,10 @@ var CLASchema = mongoose.Schema({
ownerId: String, ownerId: String,
repo: String, repo: String,
repoId: String, repoId: String,
org_cla: { type: Boolean, default: false }, org_cla: {
type: Boolean,
default: false
},
user: String, user: String,
userId: String, userId: String,
}); });
@ -30,7 +33,7 @@ var indexOptions = {
var CLA = mongoose.model('CLA', CLASchema); var CLA = mongoose.model('CLA', CLASchema);
CLA.collection.dropAllIndexes(function(err, results) { CLA.collection.dropAllIndexes(function (err, results) {
if (err) { if (err) {
logger.warn('CLA collection dropAllIndexes error: ', err); logger.warn('CLA collection dropAllIndexes error: ', err);
logger.warn('dropAllIndexes results: ', results); logger.warn('dropAllIndexes results: ', results);

Просмотреть файл

@ -70,9 +70,9 @@ var selection = function (args) {
return args.repoId ? { return args.repoId ? {
repoId: args.repoId repoId: args.repoId
} : { } : {
repo: args.repo, repo: args.repo,
owner: args.owner owner: args.owner
}; };
}; };
module.exports = { module.exports = {
@ -181,8 +181,8 @@ module.exports = {
id: committer.id || '' id: committer.id || ''
}; };
if (committers.length === 0 || committers.map(function (c) { if (committers.length === 0 || committers.map(function (c) {
return c.name; return c.name;
}).indexOf(user.name) < 0) { }).indexOf(user.name) < 0) {
committers.push(user); committers.push(user);
} }
}); });
@ -191,10 +191,10 @@ module.exports = {
if (res && res.message === 'Moved Permanently' && linkedRepo) { if (res && res.message === 'Moved Permanently' && linkedRepo) {
self.getGHRepo(args, function (err, res) { self.getGHRepo(args, function (err, res) {
if (res && res.id && compareRepoNameAndUpdate(linkedRepo, { if (res && res.id && compareRepoNameAndUpdate(linkedRepo, {
repo: res.name, repo: res.name,
owner: res.owner.login, owner: res.owner.login,
repoId: res.id repoId: res.id
})) { })) {
arg.arg.repo = res.name; arg.arg.repo = res.name;
arg.arg.owner = res.owner.login; arg.arg.owner = res.owner.login;