@@ -20955,14 +20955,14 @@ const getRepos = async () => {
2095520955 const repositoryType = core.getInput('repository_type') || 'all'
2095620956 const repositoryFilter = core.getInput('repository_filter') || '.*'
2095720957 const repositoryBatchSize = parseInt(core.getInput('repository_batch_size') || '10')
20958+ const pushMissing = core.getBooleanInput('push_missing')
2095820959 const owner = core.getInput('github_owner')
2095920960 const catalogFile = core.getInput('catalog_file') || 'catalog-info.yaml'
2096020961 const repositoryFilterRegex = new RegExp(repositoryFilter)
2096120962 const octokit = new Octokit({ auth: GITHUB_TOKEN })
2096220963
20963- const parseServiceDefinition = async (repo, path, pushMissing ) => {
20964+ const parseServiceDefinition = async (repo, path) => {
2096420965 const repoData = []
20965- core.debug(`Processing ${path} in ${repo.name} ...`)
2096620966 try {
2096720967 const { data } = await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
2096820968 owner: repo.full_name.split('/')[0],
@@ -20981,14 +20981,16 @@ const getRepos = async () => {
2098120981 repoData.push(serviceDefinition)
2098220982 }
2098320983 }
20984+ core.debug(`🌟 Processed ${path} in ${repo.name} ...`)
2098420985 } catch (ex) {
2098520986 if (pushMissing) {
2098620987 repoData.push({
2098720988 status: `${catalogFile} missing`,
2098820989 _repo: repo
2098920990 })
20991+ core.debug(`- Loaded basic service data for ${repo.name} as no ${path} found`)
2099020992 } else {
20991- core.warning(` Unable to find ${path} in ${repo.name}, not processing`)
20993+ core.debug(`✋ Unable to find ${path} in ${repo.name}, not processing as 'push_missing' is false `)
2099220994 }
2099320995 }
2099420996 return repoData
@@ -20999,14 +21001,13 @@ const getRepos = async () => {
2099921001 const targets = serviceDefinition.spec?.targets
2100021002 if (targets && targets.length > 0) {
2100121003 for (const target of targets) {
21002- const pushMissing = false
21003- const targetDefinition = await parseServiceDefinition(repo, target, pushMissing)
21004+ const targetDefinition = await parseServiceDefinition(repo, target)
2100421005 targetDefinition.fromLocation = true
2100521006 repoData.push(...targetDefinition)
2100621007 monoRepoCount++
2100721008 }
2100821009 } else {
21009- core.warning(`Location file in ${repo._repo.name} at ${path} specified without valid spec.targets, will be skipped`)
21010+ core.warning(`✋ Location file in ${repo._repo.name} at ${path} specified without valid spec.targets, will be skipped`)
2101021011 }
2101121012 return repoData
2101221013 }
@@ -21018,8 +21019,7 @@ const getRepos = async () => {
2101821019 sort: 'full_name',
2101921020 per_page: 100
2102021021 })
21021- core.info(`Using repository filter: ${repositoryFilter}`)
21022- core.info(`Found ${repos.length} github repositories, now getting service data for those that match the filter ...`)
21022+ core.info(`Found ${repos.length} github repositories, now getting service data for those that match ${repositoryFilter}`)
2102321023
2102421024 // We will create an array of batches to speed up execution, run each batch
2102521025 // In series, and then join them together.
@@ -21028,8 +21028,7 @@ const getRepos = async () => {
2102821028
2102921029 for (const repo of repos) {
2103021030 if (repo.name.match(repositoryFilterRegex)) {
21031- const pushMissing = true
21032- repoFns.push(parseServiceDefinition(repo, catalogFile, pushMissing))
21031+ repoFns.push(parseServiceDefinition(repo, catalogFile))
2103321032 }
2103421033 }
2103521034
@@ -28263,7 +28262,7 @@ try {
2826328262 })
2826428263
2826528264 const refreshData = async () => {
28266- core.startGroup('Loading services, systems and owners ...')
28265+ core.startGroup('🗂️ Loading services, systems and owners ...')
2826728266 const { systems, owners, structure, services } = await loadData({ core, notion })
2826828267 core.info(`Found ${structure.length} fields in the Service database: ${structure.map((item) => item.name)}`)
2826928268 core.info(`Loaded ${Object.keys(systems || {}).length} systems`)
0 commit comments