Skip to content

Commit

Permalink
feat(2683): nodejs upgrade (#62)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node 18 upgrade && eslint upgrade
  • Loading branch information
klu909 committed Dec 15, 2022
1 parent 8858a82 commit 86c78ad
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
53 changes: 28 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
{
"name": "screwdriver-queue-service",
"version": "2.0.0",
"version": "3.0.0",
"description": "Screwdriver Queue Service API",
"main": "app.js",
"directories": {
"lib": "lib"
},
"dependencies": {
"@hapi/boom": "^9.1.1",
"@hapi/boom": "^10.0.0",
"@hapi/good": "^9.0.1",
"@hapi/good-console": "^9.0.1",
"@hapi/good-squeeze": "^6.0.0",
"@hapi/hapi": "^20.2.1",
"@hapi/hoek": "^9.1.1",
"amqp-connection-manager": "^3.8.1",
"amqplib": "^0.8.0",
"@hapi/hapi": "^21.1.0",
"@hapi/hoek": "^10.0.1",
"amqp-connection-manager": "^4.1.9",
"amqplib": "^0.10.3",
"blipp": "^4.0.2",
"circuit-fuses": "^4.0.5",
"config": "^1.31.0",
"circuit-fuses": "^5.0.0",
"config": "^3.3.6",
"cron-parser": "^4.2.1",
"hapi-auth-jwt2": "^10.2.0",
"ioredis": "^5.2.3",
"joi": "^17.5.0",
"js-yaml": "^3.14.1",
"joi": "^17.7.0",
"js-yaml": "^4.1.0",
"jsonwebtoken": "^8.5.1",
"node-resque": "^9.2.0",
"redlock": "^4.2.0",
"screwdriver-aws-producer-service": "^1.3.0",
"screwdriver-data-schema": "^21.23.0",
"screwdriver-executor-docker": "^5.0.2",
"screwdriver-executor-jenkins": "^5.0.1",
"screwdriver-executor-k8s": "^14.16.0",
"screwdriver-aws-producer-service": "^2.0.0",
"screwdriver-data-schema": "^22.0.1",
"screwdriver-executor-docker": "^6.0.0",
"screwdriver-executor-jenkins": "^6.0.0",
"screwdriver-executor-k8s": "^15.0.0",
"screwdriver-executor-k8s-vm": "^4.3.2",
"screwdriver-executor-router": "^2.1.2",
"screwdriver-logger": "^1.0.2",
"screwdriver-request": "^1.0.2",
"screwdriver-executor-router": "^3.0.0",
"screwdriver-logger": "^2.0.0",
"screwdriver-request": "^2.0.1",
"string-hash": "^1.1.3",
"uuid": "^8.0.0"
"uuid": "^9.0.0"
},
"devDependencies": {
"chai": "^4.3.4",
"chai": "^4.3.7",
"chai-jwt": "^2.0.0",
"coveralls": "^3.0.9",
"cucumber": "^6.0.5",
"eslint": "^6.8.0",
"eslint-config-screwdriver": "^5.0.6",
"mocha": "^8.3.2",
"eslint": "^8.28.0",
"eslint-config-screwdriver": "^7.0.0",
"mocha": "^10.1.0",
"mocha-multi-reporters": "^1.5.1",
"mocha-sonarqube-reporter": "^1.0.2",
"mockery": "^2.1.0",
"nyc": "^15.1.0",
"sinon": "^9.2.4",
"sinon": "^15.0.0",
"snyk": "^1.814.0",
"util": "^0.12.2"
"util": "^0.12.5"
},
"scripts": {
"start": "node ./bin/server",
Expand Down Expand Up @@ -80,6 +80,9 @@
"Pritam Paul <pritamstyz4ever@gmail.com>",
"Tiffany Kyi <tiffanykyi@gmail.com>"
],
"engines": {
"node": ">=18.0.0"
},
"bugs": {
"url": "https://github.com/screwdriver-cd/screwdriver/issues"
},
Expand Down
7 changes: 3 additions & 4 deletions plugins/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

const joi = require('joi');
const jwt = require('jsonwebtoken');
const uuid = require('uuid');

const { v4: uuidv4 } = require('uuid');
const DEFAULT_TIMEOUT = 60; // 1h in minutes
const ALGORITHM = 'RS256';

const validate = async function() {
const validate = async function () {
// The _decoded token signature is validated by jwt.veriry so we can return true
return { isValid: true };
};
Expand Down Expand Up @@ -81,7 +80,7 @@ const authPlugin = {
jwt.sign(profile, pluginOptions.jwtPrivateKey, {
algorithm: ALGORITHM,
expiresIn: buildTimeout * 60, // must be in second
jwtid: uuid.v4()
jwtid: uuidv4()
})
);
}
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/queue/scheduler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ describe('scheduler test', () => {
job: testJob,
apiUri: 'http://localhost'
};
multiWorker = function(config, jobs) {
multiWorker = function (config, jobs) {
this.start = () => {};
this.end = sinon.stub().resolves();
this.config = config;
this.jobs = jobs;
};
scheduler = function() {
scheduler = function () {
this.start = sinon.stub().resolves();
this.connect = sinon.stub().resolves();
this.end = sinon.stub().resolves();
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/worker/lib/jobs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('Jobs Unit Test', () => {
get: sinon.stub().returns()
};

mockExecutorRouter = function() {
mockExecutorRouter = function () {
return mockExecutor;
};

Expand Down
1 change: 1 addition & 0 deletions test/plugins/worker/worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ describe('Schedule test', () => {
status: 'FAILURE',
statusMessage: 'failure'
};
// eslint-disable-next-line no-promise-executor-return
const sleep = async ms => new Promise(resolve => setTimeout(resolve, ms));
const failure = 'failure';

Expand Down

0 comments on commit 86c78ad

Please sign in to comment.