feat(plugins/base): add base_skip
This commit is contained in:
@@ -7,14 +7,14 @@
|
|||||||
export default async function({login, graphql, rest, data, q, queries, imports, callbacks}, conf) {
|
export default async function({login, graphql, rest, data, q, queries, imports, callbacks}, conf) {
|
||||||
//Load inputs
|
//Load inputs
|
||||||
console.debug(`metrics/compute/${login}/base > started`)
|
console.debug(`metrics/compute/${login}/base > started`)
|
||||||
let {indepth, hireable, "repositories.forks": _forks, "repositories.affiliations": _affiliations, "repositories.batch": _batch} = imports.metadata.plugins.base.inputs({data, q, account: "bypass"})
|
let {indepth, hireable, skip, "repositories.forks": _forks, "repositories.affiliations": _affiliations, "repositories.batch": _batch} = imports.metadata.plugins.base.inputs({data, q, account: "bypass"})
|
||||||
const repositories = conf.settings.repositories || 100
|
const repositories = conf.settings.repositories || 100
|
||||||
const forks = _forks ? "" : ", isFork: false"
|
const forks = _forks ? "" : ", isFork: false"
|
||||||
const affiliations = _affiliations?.length ? `, ownerAffiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]${conf.authenticated === login ? `, affiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]` : ""}` : ""
|
const affiliations = _affiliations?.length ? `, ownerAffiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]${conf.authenticated === login ? `, affiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]` : ""}` : ""
|
||||||
console.debug(`metrics/compute/${login}/base > affiliations constraints ${affiliations}`)
|
console.debug(`metrics/compute/${login}/base > affiliations constraints ${affiliations}`)
|
||||||
|
|
||||||
//Skip initial data gathering if not needed
|
//Skip initial data gathering if not needed
|
||||||
if (conf.settings.notoken) {
|
if ((conf.settings.notoken)||(skip)) {
|
||||||
await callbacks?.plugin?.(login, "base", true, data).catch(error => console.debug(`metrics/compute/${login}/plugins/callbacks > base > ${error}`))
|
await callbacks?.plugin?.(login, "base", true, data).catch(error => console.debug(`metrics/compute/${login}/plugins/callbacks > base > ${error}`))
|
||||||
return (postprocess.skip({login, data, imports}), {})
|
return (postprocess.skip({login, data, imports}), {})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,15 @@ inputs:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: no
|
default: no
|
||||||
|
|
||||||
|
base_skip:
|
||||||
|
description: |
|
||||||
|
Skip base content
|
||||||
|
|
||||||
|
> ⚠️ Any plugin that relies on base content data may break!
|
||||||
|
> Only use this option when using a plugin that can be configured with `token: NOT_NEEDED`
|
||||||
|
type: boolean
|
||||||
|
default: no
|
||||||
|
|
||||||
repositories:
|
repositories:
|
||||||
description: |
|
description: |
|
||||||
Fetched repositories
|
Fetched repositories
|
||||||
|
|||||||
Reference in New Issue
Block a user