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) {
|
||||
//Load inputs
|
||||
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 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(", ")}]` : ""}` : ""
|
||||
console.debug(`metrics/compute/${login}/base > affiliations constraints ${affiliations}`)
|
||||
|
||||
//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}`))
|
||||
return (postprocess.skip({login, data, imports}), {})
|
||||
}
|
||||
|
||||
@@ -56,6 +56,15 @@ inputs:
|
||||
type: boolean
|
||||
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:
|
||||
description: |
|
||||
Fetched repositories
|
||||
|
||||
Reference in New Issue
Block a user