Skip to content

Commit

Permalink
feat(2683): nodejs upgrade (#86)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node 18 upgrade && eslint upgrade
  • Loading branch information
klu909 authored Dec 15, 2022
1 parent 3acf7a2 commit d7a3280
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 38 deletions.
32 changes: 11 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,19 @@ class BitbucketScm extends Scm {
joi
.object()
.keys({
username: joi
.string()
.optional()
.default('sd-buildbot'),
email: joi
.string()
.optional()
.default('dev-null@screwdriver.cd'),
username: joi.string().optional().default('sd-buildbot'),
email: joi.string().optional().default('dev-null@screwdriver.cd'),
readOnly: joi
.object()
.keys({
enabled: joi.boolean().optional(),
username: joi.string().optional(),
accessToken: joi.string().optional(),
cloneType: joi
.string()
.valid('https', 'ssh')
.optional()
.default('https')
cloneType: joi.string().valid('https', 'ssh').optional().default('https')
})
.optional()
.default({}),
https: joi
.boolean()
.optional()
.default(false),
https: joi.boolean().optional().default(false),
oauthClientId: joi.string().required(),
oauthClientSecret: joi.string().required(),
fusebox: joi.object().default({})
Expand Down Expand Up @@ -336,10 +323,13 @@ class BitbucketScm extends Scm {
* @return {Promise} Resolves to scmUri
*/
async _parseUrl({ checkoutUrl, rootDir }) {
const { branch: branchFromCheckout, username, repo, hostname, rootDir: sourceDir } = getRepoInfo(
checkoutUrl,
rootDir
);
const {
branch: branchFromCheckout,
username,
repo,
hostname,
rootDir: sourceDir
} = getRepoInfo(checkoutUrl, rootDir);
// TODO: add logic to fetch default branch
// See https://jira.atlassian.com/browse/BCLOUD-20212
const branch = branchFromCheckout || DEFAULT_BRANCH;
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "screwdriver-scm-bitbucket",
"version": "4.0.0",
"version": "5.0.0",
"description": "This scm plugin extends the [scm-base-class](https://github.com/screwdriver-cd/scm-base), and provides methods to fetch and update data in Bitbucket.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -35,23 +35,23 @@
"debug": false
},
"devDependencies": {
"chai": "^4.3.6",
"eslint": "^7.32.0",
"eslint-config-screwdriver": "^5.0.1",
"mocha": "^8.4.0",
"chai": "^4.3.7",
"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.0.0",
"nyc": "^15.0.0",
"sinon": "^9.0.0"
"mockery": "^2.1.0",
"nyc": "^15.1.0",
"sinon": "^15.0.0"
},
"dependencies": {
"@hapi/hoek": "^9.2.1",
"circuit-fuses": "^4.1.2",
"joi": "^17.6.0",
"screwdriver-data-schema": "^21.22.2",
"screwdriver-logger": "^1.1.0",
"screwdriver-request": "^1.0.3",
"screwdriver-scm-base": "^7.4.0"
"@hapi/hoek": "^10.0.1",
"circuit-fuses": "^5.0.0",
"joi": "^17.7.0",
"screwdriver-data-schema": "^22.0.1",
"screwdriver-logger": "^2.0.0",
"screwdriver-request": "^2.0.1",
"screwdriver-scm-base": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion screwdriver.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
shared:
image: node:12
image: node:18

jobs:
main:
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const API_URL_V2 = 'https://api.bitbucket.org/2.0';

sinon.assert.expose(assert, { prefix: '' });

describe('index', function() {
describe('index', function () {
// Time not important. Only life important.
this.timeout(5000);

Expand Down

0 comments on commit d7a3280

Please sign in to comment.