-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Node 18 upgrade && eslint upgrade
- Loading branch information
Showing
4 changed files
with
42 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,36 +142,21 @@ class GitlabScm extends Scm { | |
config, | ||
Joi.object() | ||
.keys({ | ||
gitlabProtocol: Joi.string() | ||
.optional() | ||
.default('https'), | ||
gitlabHost: Joi.string() | ||
.optional() | ||
.default('gitlab.com'), | ||
username: Joi.string() | ||
.optional() | ||
.default('sd-buildbot'), | ||
email: Joi.string() | ||
.optional() | ||
.default('[email protected]'), | ||
commentUserToken: Joi.string() | ||
.optional() | ||
.description('Token for PR comments'), | ||
gitlabProtocol: Joi.string().optional().default('https'), | ||
gitlabHost: Joi.string().optional().default('gitlab.com'), | ||
username: Joi.string().optional().default('sd-buildbot'), | ||
email: Joi.string().optional().default('[email protected]'), | ||
commentUserToken: Joi.string().optional().description('Token for PR comments'), | ||
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({}) | ||
|
@@ -342,10 +327,13 @@ class GitlabScm extends Scm { | |
* @return {Promise} Resolves to an ID of 'serviceName:repoId:branchName:rootDir' | ||
*/ | ||
async _parseUrl({ checkoutUrl, rootDir, token }) { | ||
const { hostname, owner, reponame, branch, rootDir: sourceDir } = getRepoInfoByCheckoutUrl( | ||
checkoutUrl, | ||
rootDir | ||
); | ||
const { | ||
hostname, | ||
owner, | ||
reponame, | ||
branch, | ||
rootDir: sourceDir | ||
} = getRepoInfoByCheckoutUrl(checkoutUrl, rootDir); | ||
const myHost = this.config.gitlabHost || 'gitlab.com'; | ||
|
||
if (hostname !== myHost) { | ||
|
@@ -433,9 +421,7 @@ class GitlabScm extends Scm { | |
|
||
return { | ||
action: 'push', | ||
branch: Hoek.reach(webhookPayload, 'ref') | ||
.split('/') | ||
.slice(-1)[0], | ||
branch: Hoek.reach(webhookPayload, 'ref').split('/').slice(-1)[0], | ||
checkoutUrl, | ||
sha: Hoek.reach(webhookPayload, 'checkout_sha'), | ||
type: 'repo', | ||
|
@@ -567,10 +553,12 @@ class GitlabScm extends Scm { | |
// Git clone | ||
command.push(`echo Cloning external config repo ${parentCheckoutUrl}`); | ||
command.push( | ||
`${'if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; ' + | ||
`${ | ||
'if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; ' + | ||
'then $SD_GIT_WRAPPER ' + | ||
`"git clone --recursive --quiet --progress --branch ${parentBranch} ` + | ||
'$CONFIG_URL $SD_CONFIG_DIR"; '}${shallowCloneCmd}` + | ||
'$CONFIG_URL $SD_CONFIG_DIR"; ' | ||
}${shallowCloneCmd}` + | ||
`--recursive --quiet --progress --branch ${parentBranch} ` + | ||
'$CONFIG_URL $SD_CONFIG_DIR"; fi' | ||
); | ||
|
@@ -582,10 +570,12 @@ class GitlabScm extends Scm { | |
// Git clone | ||
command.push(`echo 'Cloning ${checkoutUrl}, on branch ${branch}'`); | ||
command.push( | ||
`${'if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; ' + | ||
`${ | ||
'if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; ' + | ||
'then $SD_GIT_WRAPPER ' + | ||
`"git clone --recursive --quiet --progress --branch '${branch}' ` + | ||
'$SCM_URL $SD_CHECKOUT_DIR_FINAL"; '}${shallowCloneCmd}` + | ||
'$SCM_URL $SD_CHECKOUT_DIR_FINAL"; ' | ||
}${shallowCloneCmd}` + | ||
`--recursive --quiet --progress --branch '${branch}' ` + | ||
'$SCM_URL $SD_CHECKOUT_DIR_FINAL"; fi' | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "screwdriver-scm-gitlab", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "GitLab implementation for the scm-base class", | ||
"main": "index.js", | ||
"scripts": { | ||
|
@@ -31,25 +31,25 @@ | |
"Tiffany Kyi <[email protected]>" | ||
], | ||
"devDependencies": { | ||
"chai": "^4.3.6", | ||
"eslint": "^7.31.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", | ||
"nock": "^13.2.4", | ||
"nyc": "^15.0.0", | ||
"sinon": "^9.0.0" | ||
"mockery": "^2.1.0", | ||
"nock": "^13.2.9", | ||
"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.24.0", | ||
"screwdriver-logger": "^1.1.0", | ||
"screwdriver-request": "^1.0.2", | ||
"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" | ||
}, | ||
"release": { | ||
"branches": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
shared: | ||
image: node:12 | ||
image: node:18 | ||
|
||
jobs: | ||
main: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters