Skip to content

Commit 2b3e8dd

Browse files
authored
Merge branch 'main-enterprise' into refactor/settings-consolidation
2 parents 9a51242 + 9cc2f12 commit 2b3e8dd

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

lib/plugins/branches.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = class Branches extends ErrorStash {
3333
let p = Object.assign(this.repo, { branch: branch.name })
3434
if (branch.name === 'default') {
3535
p = Object.assign(this.repo, { branch: currentRepo.data.default_branch })
36-
this.log(`Deleting default branch protection for branch ${currentRepo.data.default_branch}`)
36+
this.log.debug(`Deleting default branch protection for branch ${currentRepo.data.default_branch}`)
3737
}
3838
// Hack to handle closures and keep params from changing
3939
const params = Object.assign({}, p)
@@ -50,7 +50,7 @@ module.exports = class Branches extends ErrorStash {
5050
let p = Object.assign(this.repo, { branch: branch.name })
5151
if (branch.name === 'default') {
5252
p = Object.assign(this.repo, { branch: currentRepo.data.default_branch })
53-
// this.log(`Setting default branch protection for branch ${currentRepo.data.default_branch}`)
53+
// this.log.debug(`Setting default branch protection for branch ${currentRepo.data.default_branch}`)
5454
}
5555
// Hack to handle closures and keep params from changing
5656
const params = Object.assign({}, p)
@@ -80,7 +80,7 @@ module.exports = class Branches extends ErrorStash {
8080
return Promise.resolve(resArray)
8181
}
8282
this.log.debug(`Adding branch protection ${JSON.stringify(params)}`)
83-
return this.github.repos.updateBranchProtection(params).then(res => this.log(`Branch protection applied successfully ${JSON.stringify(res.url)}`)).catch(e => { this.logError(`Error applying branch protection ${JSON.stringify(e)}`); return [] })
83+
return this.github.repos.updateBranchProtection(params).then(res => this.log.debug(`Branch protection applied successfully ${JSON.stringify(res.url)}`)).catch(e => { this.logError(`Error applying branch protection ${JSON.stringify(e)}`); return [] })
8484
}).catch((e) => {
8585
if (e.status === 404) {
8686
Object.assign(params, Overrides.removeOverrides(overrides, branch.protection, {}), { headers: previewHeaders })
@@ -89,7 +89,7 @@ module.exports = class Branches extends ErrorStash {
8989
return Promise.resolve(resArray)
9090
}
9191
this.log.debug(`Adding branch protection ${JSON.stringify(params)}`)
92-
return this.github.repos.updateBranchProtection(params).then(res => this.log(`Branch protection applied successfully ${JSON.stringify(res.url)}`)).catch(e => { this.logError(`Error applying branch protection ${JSON.stringify(e)}`); return [] })
92+
return this.github.repos.updateBranchProtection(params).then(res => this.log.debug(`Branch protection applied successfully ${JSON.stringify(res.url)}`)).catch(e => { this.logError(`Error applying branch protection ${JSON.stringify(e)}`); return [] })
9393
} else {
9494
this.logError(e)
9595
if (this.nop) {

lib/plugins/rulesets.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = class Rulesets extends Diffable {
3434
org: this.repo.owner,
3535
headers: version
3636
})
37-
this.log(listOptions)
37+
this.log.debug(listOptions)
3838
return this.github.paginate(listOptions)
3939
.then(res => {
4040
const rulesets = res.map(ruleset => {
@@ -63,7 +63,7 @@ module.exports = class Rulesets extends Diffable {
6363
repo: this.repo.repo,
6464
headers: version
6565
})
66-
this.log(listOptions)
66+
this.log.debug(listOptions)
6767
return this.github.paginate(listOptions)
6868
.then(res => {
6969
const rulesets = res
@@ -111,7 +111,7 @@ module.exports = class Rulesets extends Diffable {
111111
Overrides.removeOverrides(overrides, parms, existing)
112112
this.log.debug(`Updating Ruleset with the following values ${JSON.stringify(parms, null, 2)}`)
113113
return this.github.request('PUT /orgs/{org}/rulesets/{id}', parms).then(res => {
114-
this.log(`Ruleset updated successfully ${JSON.stringify(res.url)}`)
114+
this.log.debug(`Ruleset updated successfully ${JSON.stringify(res.url)}`)
115115
return res
116116
}).catch(e => {
117117
return this.handleError(e)
@@ -125,7 +125,7 @@ module.exports = class Rulesets extends Diffable {
125125
Overrides.removeOverrides(overrides, parms, existing)
126126
this.log.debug(`Updating Ruleset with the following values ${JSON.stringify(parms, null, 2)}`)
127127
return this.github.request('PUT /repos/{owner}/{repo}/rulesets/{id}', parms).then(res => {
128-
this.log(`Ruleset updated successfully ${JSON.stringify(res.url)}`)
128+
this.log.debug(`Ruleset updated successfully ${JSON.stringify(res.url)}`)
129129
return res
130130
}).catch(e => {
131131
return this.handleError(e)
@@ -143,7 +143,7 @@ module.exports = class Rulesets extends Diffable {
143143
Overrides.removeOverrides(overrides, attrs, {})
144144
this.log.debug(`Creating Rulesets with the following values ${JSON.stringify(attrs, null, 2)}`)
145145
return this.github.request('POST /orgs/{org}/rulesets', this.wrapAttrs(attrs)).then(res => {
146-
this.log(`Ruleset created successfully ${JSON.stringify(res.url)}`)
146+
this.log.debug(`Ruleset created successfully ${JSON.stringify(res.url)}`)
147147
return res
148148
}).catch(e => {
149149
return this.handleError(e)
@@ -157,7 +157,7 @@ module.exports = class Rulesets extends Diffable {
157157
Overrides.removeOverrides(overrides, attrs, {})
158158
this.log.debug(`Creating Rulesets with the following values ${JSON.stringify(attrs, null, 2)}`)
159159
return this.github.request('POST /repos/{owner}/{repo}/rulesets', this.wrapAttrs(attrs)).then(res => {
160-
this.log(`Ruleset created successfully ${JSON.stringify(res.url)}`)
160+
this.log.debug(`Ruleset created successfully ${JSON.stringify(res.url)}`)
161161
return res
162162
}).catch(e => {
163163
return this.handleError(e)
@@ -175,7 +175,7 @@ module.exports = class Rulesets extends Diffable {
175175
}
176176
this.log.debug(`Deleting Ruleset with the following values ${JSON.stringify(parms, null, 2)}`)
177177
return this.github.request('DELETE /orgs/{org}/rulesets/{id}', parms).then(res => {
178-
this.log(`Ruleset deleted successfully ${JSON.stringify(res.url)}`)
178+
this.log.debug(`Ruleset deleted successfully ${JSON.stringify(res.url)}`)
179179
return res
180180
}).catch(e => {
181181
return this.handleError(e)
@@ -188,7 +188,7 @@ module.exports = class Rulesets extends Diffable {
188188
}
189189
this.log.debug(`Deleting Ruleset with the following values ${JSON.stringify(parms, null, 2)}`)
190190
return this.github.request('DELETE /repos/{owner}/{repo}/rulesets/{id}', parms).then(res => {
191-
this.log(`Ruleset deleted successfully ${JSON.stringify(res.url)}`)
191+
this.log.debug(`Ruleset deleted successfully ${JSON.stringify(res.url)}`)
192192
return res
193193
}).catch(e => {
194194
if (e.status === 404) {

lib/plugins/validator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = class Validator {
2020
}
2121
}).then(res => {
2222
if (this.repo.repo.search(this.regex) >= 0) {
23-
this.log(`Repo ${this.repo.repo} Passed Validation for pattern ${this.pattern}`)
23+
this.log.debug(`Repo ${this.repo.repo} Passed Validation for pattern ${this.pattern}`)
2424
if (this.nop) {
2525
return Promise.resolve([
2626
new NopCommand(this.constructor.name, this.repo, null, `Passed Validation for pattern ${this.pattern}`)
@@ -38,7 +38,7 @@ module.exports = class Validator {
3838
})
3939
}
4040
} else {
41-
this.log(`Repo ${this.repo.repo} Failed Validation for pattern ${this.pattern}`)
41+
this.log.debug(`Repo ${this.repo.repo} Failed Validation for pattern ${this.pattern}`)
4242
if (this.nop) {
4343
return Promise.resolve([
4444
new NopCommand(this.constructor.name, this.repo, null, `Failed Validation for pattern ${this.pattern}`, 'ERROR')
@@ -59,7 +59,7 @@ module.exports = class Validator {
5959
})
6060
.catch(() => {})
6161
} catch (error) {
62-
this.log(`Error in Validation checking ${error}`)
62+
this.log.debug(`Error in Validation checking ${error}`)
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)