From d0768395756c0a16bf550d73c89da1e74b58e016 Mon Sep 17 00:00:00 2001 From: Simon Lecoq <22963968+lowlighter@users.noreply.github.com> Date: Thu, 19 Aug 2021 23:20:20 +0200 Subject: [PATCH] Pass `config_repositories` as setting to avoid conflicts with `plugin_repositories` (#490) --- source/app/action/index.mjs | 5 +++-- source/plugins/base/index.mjs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs index 17ae09d5ae0..00c02d3aa2f 100644 --- a/source/app/action/index.mjs +++ b/source/app/action/index.mjs @@ -251,8 +251,9 @@ async function wait(seconds) { //Base content info.break() - const {base:parts, ...base} = metadata.plugins.base.inputs.action({core}) - info.group({metadata, name:"base", inputs:base}) + const {base:parts, repositories:_repositories, ...base} = metadata.plugins.base.inputs.action({core}) + conf.settings.repositories = _repositories + info.group({metadata, name:"base", inputs:{repositories:conf.settings.repositories, ...base}}) info("Base sections", parts) base.base = false for (const part of conf.settings.plugins.base.parts) diff --git a/source/plugins/base/index.mjs b/source/plugins/base/index.mjs index 6d09256eeef..703791b6124 100644 --- a/source/plugins/base/index.mjs +++ b/source/plugins/base/index.mjs @@ -7,7 +7,8 @@ export default async function({login, graphql, rest, data, q, queries, imports}, conf) { //Load inputs console.debug(`metrics/compute/${login}/base > started`) - let {repositories, "repositories.forks":_forks, "repositories.affiliations":_affiliations, "repositories.batch":_batch} = imports.metadata.plugins.base.inputs({data, q, account:"bypass"}, {repositories:conf.settings.repositories ?? 100}) + let {"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}`)