@firestartr/cli 2.4.0-snapshot-6 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +247 -336
- package/build/packages/catalog_common/index.d.ts +0 -1
- package/build/packages/cdk8s_renderer/imports/firestartr.dev.d.ts +0 -4
- package/build/packages/cdk8s_renderer/src/charts/github/repositoryChart.d.ts +2 -1
- package/build/packages/cdk8s_renderer/src/logger.d.ts +2 -2
- package/build/packages/cdk8s_renderer/src/utils/repositoryClaimUtils.d.ts +41 -11
- package/build/packages/cdk8s_renderer/src/validations/componentPagesPath.d.ts +11 -0
- package/build/packages/features_preparer/src/logger.d.ts +2 -2
- package/build/packages/features_renderer/src/logger.d.ts +2 -2
- package/build/packages/gh_provisioner/src/entities/ghrepo/index.d.ts +7 -0
- package/build/packages/gh_provisioner/src/logger.d.ts +2 -2
- package/build/packages/github/src/logger.d.ts +2 -2
- package/build/packages/importer/src/logger.d.ts +2 -2
- package/build/packages/importer/src/utils/codeowner.d.ts +5 -0
- package/build/packages/operator/src/logger.d.ts +2 -2
- package/build/packages/scaffolder/src/logger.d.ts +2 -2
- package/build/packages/terraform_provisioner/src/logger.d.ts +2 -2
- package/package.json +1 -1
- package/build/packages/catalog_common/src/codeowners/index.d.ts +0 -29
package/build/index.js
CHANGED
|
@@ -277133,202 +277133,6 @@ function policiesAreCompatible(syncPolicy, generalPolicy) {
|
|
|
277133
277133
|
FIRESTARTR_POLICIES: FIRESTARTR_POLICIES,
|
|
277134
277134
|
});
|
|
277135
277135
|
|
|
277136
|
-
// EXTERNAL MODULE: external "fs/promises"
|
|
277137
|
-
var promises_ = __nccwpck_require__(73292);
|
|
277138
|
-
;// CONCATENATED MODULE: ../catalog_common/src/codeowners/index.ts
|
|
277139
|
-
// CODEOWNERS Machinery (Dead-simple MVP)
|
|
277140
|
-
//
|
|
277141
|
-
|
|
277142
|
-
|
|
277143
|
-
// Dead-simple CODEOWNERS helpers
|
|
277144
|
-
function codeowners_parse(raw) {
|
|
277145
|
-
return raw
|
|
277146
|
-
.split(/\r?\n/)
|
|
277147
|
-
.map((line) => line.trim())
|
|
277148
|
-
.filter((line) => line.length > 0 && !line.startsWith('#'))
|
|
277149
|
-
.map((line) => {
|
|
277150
|
-
const commentIdx = line.indexOf('#');
|
|
277151
|
-
const content = commentIdx >= 0 ? line.slice(0, commentIdx).trimEnd() : line;
|
|
277152
|
-
const comment = commentIdx >= 0 ? line.slice(commentIdx + 1).trim() : undefined;
|
|
277153
|
-
if (!content) {
|
|
277154
|
-
return undefined;
|
|
277155
|
-
}
|
|
277156
|
-
const tokens = content.split(/\s+/);
|
|
277157
|
-
if (tokens.length === 0)
|
|
277158
|
-
return undefined;
|
|
277159
|
-
const pattern = tokens[0];
|
|
277160
|
-
const owners = tokens.slice(1);
|
|
277161
|
-
if (!pattern || owners.length === 0)
|
|
277162
|
-
return undefined;
|
|
277163
|
-
return { pattern, owners, ...(comment ? { comment } : {}) };
|
|
277164
|
-
})
|
|
277165
|
-
.filter(Boolean);
|
|
277166
|
-
}
|
|
277167
|
-
function format(entries) {
|
|
277168
|
-
return entries
|
|
277169
|
-
.map(({ pattern, owners, comment }) => {
|
|
277170
|
-
let line = pattern + (owners.length ? ' ' + owners.join(' ') : '');
|
|
277171
|
-
if (comment) {
|
|
277172
|
-
// Inline comment is always preceded by at least one space
|
|
277173
|
-
line += ' #' + (comment.trim().length > 0 ? ' ' + comment.trim() : '');
|
|
277174
|
-
}
|
|
277175
|
-
return line;
|
|
277176
|
-
})
|
|
277177
|
-
.join('\n');
|
|
277178
|
-
}
|
|
277179
|
-
function codeowners_validate(raw) {
|
|
277180
|
-
// Each non-blank, non-comment line must have a pattern and at least one owner
|
|
277181
|
-
// Return true if ALL such lines are valid, false otherwise
|
|
277182
|
-
return raw
|
|
277183
|
-
.split(/\r?\n/)
|
|
277184
|
-
.map((line) => line.trim())
|
|
277185
|
-
.filter((line) => line.length > 0 && !line.startsWith('#'))
|
|
277186
|
-
.every((line) => {
|
|
277187
|
-
const content = line.split('#')[0].trimEnd();
|
|
277188
|
-
const tokens = content.split(/\s+/);
|
|
277189
|
-
return (tokens.length >= 2 &&
|
|
277190
|
-
tokens[0] !== '' &&
|
|
277191
|
-
tokens.slice(1).every((owner) => owner !== ''));
|
|
277192
|
-
});
|
|
277193
|
-
}
|
|
277194
|
-
async function codeowners_get(ctx) {
|
|
277195
|
-
const filePath = ctx.path || external_path_default().resolve(process.cwd(), 'CODEOWNERS');
|
|
277196
|
-
return promises_.readFile(filePath, 'utf8');
|
|
277197
|
-
}
|
|
277198
|
-
async function set(ctx, v) {
|
|
277199
|
-
const filePath = ctx.path || external_path_default().resolve(process.cwd(), 'CODEOWNERS');
|
|
277200
|
-
await promises_.writeFile(filePath, v, 'utf8');
|
|
277201
|
-
}
|
|
277202
|
-
async function updateRule(ctx, rule) {
|
|
277203
|
-
// Read file line-by-line, replace matching pattern in-place (or append), preserving
|
|
277204
|
-
// blank lines and full-line comments to avoid silently stripping file headers or warnings.
|
|
277205
|
-
const filePath = ctx.path || external_path_default().resolve(process.cwd(), 'CODEOWNERS');
|
|
277206
|
-
let rawLines = [];
|
|
277207
|
-
try {
|
|
277208
|
-
const content = await promises_.readFile(filePath, 'utf8');
|
|
277209
|
-
rawLines = content.split(/\r?\n/);
|
|
277210
|
-
}
|
|
277211
|
-
catch (e) {
|
|
277212
|
-
if (!(typeof e === 'object' &&
|
|
277213
|
-
e !== null &&
|
|
277214
|
-
'code' in e &&
|
|
277215
|
-
e.code === 'ENOENT')) {
|
|
277216
|
-
throw e;
|
|
277217
|
-
}
|
|
277218
|
-
// file may not exist yet; start with an empty line list
|
|
277219
|
-
}
|
|
277220
|
-
const newRuleLine = format([rule]);
|
|
277221
|
-
let found = false;
|
|
277222
|
-
const updatedLines = rawLines.map((line) => {
|
|
277223
|
-
const trimmed = line.trim();
|
|
277224
|
-
// Preserve blank lines and full-line comments unchanged
|
|
277225
|
-
if (!trimmed || trimmed.startsWith('#'))
|
|
277226
|
-
return line;
|
|
277227
|
-
const commentIdx = trimmed.indexOf('#');
|
|
277228
|
-
const rulePart = commentIdx >= 0 ? trimmed.slice(0, commentIdx).trimEnd() : trimmed;
|
|
277229
|
-
const tokens = rulePart.split(/\s+/).filter(Boolean);
|
|
277230
|
-
if (tokens.length === 0)
|
|
277231
|
-
return line;
|
|
277232
|
-
if (tokens[0] === rule.pattern) {
|
|
277233
|
-
found = true;
|
|
277234
|
-
return newRuleLine;
|
|
277235
|
-
}
|
|
277236
|
-
return line;
|
|
277237
|
-
});
|
|
277238
|
-
if (!found)
|
|
277239
|
-
updatedLines.push(newRuleLine);
|
|
277240
|
-
// Ensure POSIX-compliant trailing newline without doubling it
|
|
277241
|
-
if (updatedLines[updatedLines.length - 1] !== '')
|
|
277242
|
-
updatedLines.push('');
|
|
277243
|
-
await promises_.writeFile(filePath, updatedLines.join('\n'), 'utf8');
|
|
277244
|
-
}
|
|
277245
|
-
async function remove(ctx, criteria) {
|
|
277246
|
-
const filePath = ctx.path || external_path_default().resolve(process.cwd(), 'CODEOWNERS');
|
|
277247
|
-
let rawLines = [];
|
|
277248
|
-
try {
|
|
277249
|
-
const content = await promises_.readFile(filePath, 'utf8');
|
|
277250
|
-
rawLines = content.split(/\r?\n/);
|
|
277251
|
-
}
|
|
277252
|
-
catch (e) {
|
|
277253
|
-
if (!(typeof e === 'object' &&
|
|
277254
|
-
e !== null &&
|
|
277255
|
-
'code' in e &&
|
|
277256
|
-
e.code === 'ENOENT')) {
|
|
277257
|
-
throw e;
|
|
277258
|
-
}
|
|
277259
|
-
return; // nothing to remove
|
|
277260
|
-
}
|
|
277261
|
-
const updatedLines = [];
|
|
277262
|
-
for (const line of rawLines) {
|
|
277263
|
-
const trimmed = line.trim();
|
|
277264
|
-
// Preserve blank lines and full-line comments unchanged
|
|
277265
|
-
if (!trimmed || trimmed.startsWith('#')) {
|
|
277266
|
-
updatedLines.push(line);
|
|
277267
|
-
continue;
|
|
277268
|
-
}
|
|
277269
|
-
const commentIdx = trimmed.indexOf('#');
|
|
277270
|
-
const rulePart = commentIdx >= 0 ? trimmed.slice(0, commentIdx).trimEnd() : trimmed;
|
|
277271
|
-
const inlineComment = commentIdx >= 0 ? ' ' + trimmed.slice(commentIdx) : '';
|
|
277272
|
-
const tokens = rulePart.split(/\s+/).filter(Boolean);
|
|
277273
|
-
if (tokens.length < 2) {
|
|
277274
|
-
// Malformed line (no owners); keep as-is
|
|
277275
|
-
updatedLines.push(line);
|
|
277276
|
-
continue;
|
|
277277
|
-
}
|
|
277278
|
-
const linePattern = tokens[0];
|
|
277279
|
-
let owners = tokens.slice(1);
|
|
277280
|
-
const patternMatches = !criteria.pattern || linePattern === criteria.pattern;
|
|
277281
|
-
if (!patternMatches) {
|
|
277282
|
-
updatedLines.push(line);
|
|
277283
|
-
continue;
|
|
277284
|
-
}
|
|
277285
|
-
if (criteria.owner) {
|
|
277286
|
-
// Remove the specified owner from this entry; drop the entry if no owners remain
|
|
277287
|
-
owners = owners.filter((o) => o !== criteria.owner);
|
|
277288
|
-
if (owners.length === 0) {
|
|
277289
|
-
continue;
|
|
277290
|
-
}
|
|
277291
|
-
updatedLines.push(linePattern + ' ' + owners.join(' ') + inlineComment);
|
|
277292
|
-
}
|
|
277293
|
-
else if (criteria.pattern) {
|
|
277294
|
-
// Remove the entire entry matching the pattern
|
|
277295
|
-
continue;
|
|
277296
|
-
}
|
|
277297
|
-
else {
|
|
277298
|
-
updatedLines.push(line);
|
|
277299
|
-
}
|
|
277300
|
-
}
|
|
277301
|
-
// Ensure POSIX-compliant trailing newline without doubling it
|
|
277302
|
-
if (updatedLines.length > 0 && updatedLines[updatedLines.length - 1] !== '')
|
|
277303
|
-
updatedLines.push('');
|
|
277304
|
-
await promises_.writeFile(filePath, updatedLines.join('\n'), 'utf8');
|
|
277305
|
-
}
|
|
277306
|
-
function getOwners(raw) {
|
|
277307
|
-
const entries = codeowners_parse(raw);
|
|
277308
|
-
const owners = new Set();
|
|
277309
|
-
for (const entry of entries) {
|
|
277310
|
-
for (const owner of entry.owners) {
|
|
277311
|
-
owners.add(owner);
|
|
277312
|
-
}
|
|
277313
|
-
}
|
|
277314
|
-
return Array.from(owners);
|
|
277315
|
-
}
|
|
277316
|
-
function getDefault() {
|
|
277317
|
-
return '# Sample CODEOWNERS\n* @team';
|
|
277318
|
-
}
|
|
277319
|
-
const codeowners = {
|
|
277320
|
-
parse: codeowners_parse,
|
|
277321
|
-
format,
|
|
277322
|
-
validate: codeowners_validate,
|
|
277323
|
-
get: codeowners_get,
|
|
277324
|
-
set,
|
|
277325
|
-
updateRule,
|
|
277326
|
-
remove,
|
|
277327
|
-
getOwners,
|
|
277328
|
-
getDefault,
|
|
277329
|
-
};
|
|
277330
|
-
/* harmony default export */ const src_codeowners = (codeowners);
|
|
277331
|
-
|
|
277332
277136
|
;// CONCATENATED MODULE: ../catalog_common/src/tokenizer/index.ts
|
|
277333
277137
|
class SimpleTokenizer {
|
|
277334
277138
|
/**
|
|
@@ -277435,7 +277239,6 @@ function getCronNextInterval(cronLine, tz) {
|
|
|
277435
277239
|
|
|
277436
277240
|
|
|
277437
277241
|
|
|
277438
|
-
|
|
277439
277242
|
/* harmony default export */ const catalog_common = ({
|
|
277440
277243
|
io: io,
|
|
277441
277244
|
generic: generic,
|
|
@@ -277446,7 +277249,6 @@ function getCronNextInterval(cronLine, tz) {
|
|
|
277446
277249
|
policies: policies,
|
|
277447
277250
|
logger: logger_logger,
|
|
277448
277251
|
tokenizer: tokenizer,
|
|
277449
|
-
codeowners: src_codeowners,
|
|
277450
277252
|
cron: {
|
|
277451
277253
|
validateCron: validateCron,
|
|
277452
277254
|
isValidCron: isValidCron,
|
|
@@ -282132,7 +281934,7 @@ var deepFindPathToProperty = (object, searchProp, path = []) => {
|
|
|
282132
281934
|
var dist_bundle_get = (object, path) => {
|
|
282133
281935
|
return path.reduce((current, nextProperty) => current[nextProperty], object);
|
|
282134
281936
|
};
|
|
282135
|
-
var
|
|
281937
|
+
var set = (object, path, mutator) => {
|
|
282136
281938
|
const lastProperty = path[path.length - 1];
|
|
282137
281939
|
const parentPath = [...path].slice(0, -1);
|
|
282138
281940
|
const parent = dist_bundle_get(object, parentPath);
|
|
@@ -282198,19 +282000,19 @@ var mergeResponses = (response1, response2) => {
|
|
|
282198
282000
|
const nodesPath = [...path, "nodes"];
|
|
282199
282001
|
const newNodes = dist_bundle_get(response2, nodesPath);
|
|
282200
282002
|
if (newNodes) {
|
|
282201
|
-
|
|
282003
|
+
set(response1, nodesPath, (values) => {
|
|
282202
282004
|
return [...values, ...newNodes];
|
|
282203
282005
|
});
|
|
282204
282006
|
}
|
|
282205
282007
|
const edgesPath = [...path, "edges"];
|
|
282206
282008
|
const newEdges = dist_bundle_get(response2, edgesPath);
|
|
282207
282009
|
if (newEdges) {
|
|
282208
|
-
|
|
282010
|
+
set(response1, edgesPath, (values) => {
|
|
282209
282011
|
return [...values, ...newEdges];
|
|
282210
282012
|
});
|
|
282211
282013
|
}
|
|
282212
282014
|
const pageInfoPath = [...path, "pageInfo"];
|
|
282213
|
-
|
|
282015
|
+
set(response1, pageInfoPath, dist_bundle_get(response2, pageInfoPath));
|
|
282214
282016
|
return response1;
|
|
282215
282017
|
};
|
|
282216
282018
|
|
|
@@ -287057,62 +286859,6 @@ function resolveClaimRef(kind, name, symbolsTable = renderedClaims) {
|
|
|
287057
286859
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/utils/repositoryClaimUtils.ts
|
|
287058
286860
|
|
|
287059
286861
|
|
|
287060
|
-
function resolveCodeownersRef(ref, org) {
|
|
287061
|
-
let result = '';
|
|
287062
|
-
const splittedRef = ref.split(':');
|
|
287063
|
-
if (splittedRef.length !== 2) {
|
|
287064
|
-
throw new Error(`Invalid codeowners ref ${ref}`);
|
|
287065
|
-
}
|
|
287066
|
-
if (!['user', 'group'].includes(splittedRef[0])) {
|
|
287067
|
-
throw new Error(`Invalid codeowners ref ${ref}, kind must be "user" or "group"`);
|
|
287068
|
-
}
|
|
287069
|
-
const owner = splittedRef[1];
|
|
287070
|
-
const kind = splittedRef[0];
|
|
287071
|
-
const resolvedDependency = resolveClaimRef(kind === 'user' ? 'UserClaim' : 'GroupClaim', owner);
|
|
287072
|
-
const externalNameAnnotation = catalog_common.generic.getFirestartrAnnotation('external-name');
|
|
287073
|
-
const dependencyExternalName = resolvedDependency.metadata.annotations[externalNameAnnotation];
|
|
287074
|
-
if (kind === 'user') {
|
|
287075
|
-
result = `@${dependencyExternalName}`;
|
|
287076
|
-
}
|
|
287077
|
-
else if (kind === 'group') {
|
|
287078
|
-
result = `@${org}/${dependencyExternalName}`;
|
|
287079
|
-
}
|
|
287080
|
-
return result;
|
|
287081
|
-
}
|
|
287082
|
-
/**
|
|
287083
|
-
* Converts a claim (+optional additional rules) to CodeOwnerEntry[] for the codeowners API
|
|
287084
|
-
*/
|
|
287085
|
-
function claimToCodeOwnersEntries(claim, additionalRules) {
|
|
287086
|
-
const rulesMap = new Map();
|
|
287087
|
-
const addOwnerToPath = (pattern, owner) => {
|
|
287088
|
-
const owners = rulesMap.get(pattern) ?? [];
|
|
287089
|
-
if (!owners.includes(owner)) {
|
|
287090
|
-
owners.push(owner);
|
|
287091
|
-
}
|
|
287092
|
-
rulesMap.set(pattern, owners);
|
|
287093
|
-
};
|
|
287094
|
-
if (claim.owner) {
|
|
287095
|
-
addOwnerToPath('*', resolveCodeownersRef(claim.owner, claim.providers.github.org));
|
|
287096
|
-
}
|
|
287097
|
-
if (claim.platformOwner) {
|
|
287098
|
-
addOwnerToPath('/.github/', resolveCodeownersRef(claim.platformOwner, claim.providers.github.org));
|
|
287099
|
-
}
|
|
287100
|
-
if (additionalRules) {
|
|
287101
|
-
for (const rule of additionalRules) {
|
|
287102
|
-
for (const owner of rule.owners) {
|
|
287103
|
-
addOwnerToPath(rule.path, resolveCodeownersRef(owner, claim.providers.github.org));
|
|
287104
|
-
}
|
|
287105
|
-
}
|
|
287106
|
-
}
|
|
287107
|
-
return Array.from(rulesMap.entries()).map(([pattern, owners]) => ({
|
|
287108
|
-
pattern,
|
|
287109
|
-
owners,
|
|
287110
|
-
}));
|
|
287111
|
-
}
|
|
287112
|
-
function createCodeOwnersData(claim, additionalRules) {
|
|
287113
|
-
return common.codeowners.format(claimToCodeOwnersEntries(claim, additionalRules));
|
|
287114
|
-
}
|
|
287115
|
-
// All previous code including permissions, collaborators, etc. (restored)
|
|
287116
286862
|
/**
|
|
287117
286863
|
* @description This method creates a permission for a given claimRef and permission
|
|
287118
286864
|
*
|
|
@@ -287174,7 +286920,66 @@ function createCRrefFrom(claimRef, needsSecret) {
|
|
|
287174
286920
|
},
|
|
287175
286921
|
};
|
|
287176
286922
|
}
|
|
287177
|
-
|
|
286923
|
+
/**
|
|
286924
|
+
* @description This method creates the codeowners data for the repository
|
|
286925
|
+
*
|
|
286926
|
+
* @param claim
|
|
286927
|
+
*
|
|
286928
|
+
* @returns string
|
|
286929
|
+
*/
|
|
286930
|
+
function createCodeOwnersData(claim, additionalRules) {
|
|
286931
|
+
const rulesMap = new Map();
|
|
286932
|
+
const addOwnerToPath = (path, owner) => {
|
|
286933
|
+
const owners = rulesMap.get(path) ?? [];
|
|
286934
|
+
if (!owners.includes(owner)) {
|
|
286935
|
+
owners.push(owner);
|
|
286936
|
+
}
|
|
286937
|
+
rulesMap.set(path, owners);
|
|
286938
|
+
};
|
|
286939
|
+
let message = `# This file was generated by firestartr.
|
|
286940
|
+
# WARNING: Please don't edit this file directly in the repository
|
|
286941
|
+
# Go to gitops repository to modify it!`;
|
|
286942
|
+
if (claim.owner) {
|
|
286943
|
+
addOwnerToPath('*', resolveCodeownersRef(claim.owner, claim.providers.github.org));
|
|
286944
|
+
}
|
|
286945
|
+
if (claim.platformOwner) {
|
|
286946
|
+
addOwnerToPath('/.github/', resolveCodeownersRef(claim.platformOwner, claim.providers.github.org));
|
|
286947
|
+
}
|
|
286948
|
+
if (additionalRules) {
|
|
286949
|
+
for (const rule of additionalRules) {
|
|
286950
|
+
for (const owner of rule.owners) {
|
|
286951
|
+
addOwnerToPath(rule.path, resolveCodeownersRef(owner, claim.providers.github.org));
|
|
286952
|
+
}
|
|
286953
|
+
}
|
|
286954
|
+
}
|
|
286955
|
+
for (const [path, owners] of rulesMap.entries()) {
|
|
286956
|
+
message += `\n${path.padEnd(25)} ${owners.join(' ')}`;
|
|
286957
|
+
}
|
|
286958
|
+
return message;
|
|
286959
|
+
}
|
|
286960
|
+
function resolveCodeownersRef(ref, org) {
|
|
286961
|
+
let result = '';
|
|
286962
|
+
const splittedRef = ref.split(':');
|
|
286963
|
+
if (splittedRef.length !== 2) {
|
|
286964
|
+
throw new Error(`Invalid codeowners ref ${ref}`);
|
|
286965
|
+
}
|
|
286966
|
+
if (!['user', 'group'].includes(splittedRef[0])) {
|
|
286967
|
+
throw new Error(`Invalid codeowners ref ${ref}, kind must be "user" or "group"`);
|
|
286968
|
+
}
|
|
286969
|
+
const owner = splittedRef[1];
|
|
286970
|
+
const kind = splittedRef[0];
|
|
286971
|
+
const resolvedDependency = resolveClaimRef(kind === 'user' ? 'UserClaim' : 'GroupClaim', owner);
|
|
286972
|
+
const externalNameAnnotation = catalog_common.generic.getFirestartrAnnotation('external-name');
|
|
286973
|
+
const dependencyExternalName = resolvedDependency.metadata.annotations[externalNameAnnotation];
|
|
286974
|
+
if (kind === 'user') {
|
|
286975
|
+
result = `@${dependencyExternalName}`;
|
|
286976
|
+
}
|
|
286977
|
+
else if (kind === 'group') {
|
|
286978
|
+
result = `@${org}/${dependencyExternalName}`;
|
|
286979
|
+
}
|
|
286980
|
+
return result;
|
|
286981
|
+
}
|
|
286982
|
+
const IS_SECRET_REF = new RegExp(/^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/);
|
|
287178
286983
|
function isRepoSecretRef(suspectedRef) {
|
|
287179
286984
|
return IS_SECRET_REF.test(suspectedRef);
|
|
287180
286985
|
}
|
|
@@ -287193,11 +286998,6 @@ function extractRepoSecretRef(ref) {
|
|
|
287193
286998
|
key: parts[3],
|
|
287194
286999
|
};
|
|
287195
287000
|
}
|
|
287196
|
-
/**
|
|
287197
|
-
* @description This method creates the codeowners data for the repository
|
|
287198
|
-
* Migrated: use claimToCodeOwnersEntries + common.codeowners.format instead of legacy helpers.
|
|
287199
|
-
*/
|
|
287200
|
-
// ... rest of file unchanged ...
|
|
287201
287001
|
|
|
287202
287002
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/overriders/base.ts
|
|
287203
287003
|
|
|
@@ -287243,7 +287043,6 @@ class OverriderError extends Error {
|
|
|
287243
287043
|
|
|
287244
287044
|
|
|
287245
287045
|
|
|
287246
|
-
|
|
287247
287046
|
class GithubRepositoryOverrider extends OverriderPatches {
|
|
287248
287047
|
constructor() {
|
|
287249
287048
|
super(...arguments);
|
|
@@ -287318,11 +287117,11 @@ class GithubRepositoryOverrider extends OverriderPatches {
|
|
|
287318
287117
|
apply(cr) {
|
|
287319
287118
|
const patch = [];
|
|
287320
287119
|
if (claim?.providers?.github?.overrides?.additionalCodeownersRules) {
|
|
287321
|
-
const
|
|
287120
|
+
const codeowners = createCodeOwnersData(claim, claim.providers.github.overrides.additionalCodeownersRules);
|
|
287322
287121
|
patch.push({
|
|
287323
287122
|
op: 'replace',
|
|
287324
287123
|
path: '/spec/repo/codeowners',
|
|
287325
|
-
value:
|
|
287124
|
+
value: codeowners,
|
|
287326
287125
|
});
|
|
287327
287126
|
}
|
|
287328
287127
|
return fast_json_patch_default().applyPatch(cr, patch).newDocument;
|
|
@@ -287342,7 +287141,10 @@ var lib = __nccwpck_require__(77228);
|
|
|
287342
287141
|
const __PATH_VARIABLES = {};
|
|
287343
287142
|
const __EXCLUDED_PATHS = [];
|
|
287344
287143
|
function setExcludedPaths(excludedPaths) {
|
|
287345
|
-
__EXCLUDED_PATHS.
|
|
287144
|
+
__EXCLUDED_PATHS.length = 0;
|
|
287145
|
+
for (const path of excludedPaths) {
|
|
287146
|
+
__EXCLUDED_PATHS.push(path);
|
|
287147
|
+
}
|
|
287346
287148
|
}
|
|
287347
287149
|
function getAdditionalPaths() {
|
|
287348
287150
|
return __EXCLUDED_PATHS;
|
|
@@ -287502,8 +287304,8 @@ function createExpanders(path) {
|
|
|
287502
287304
|
}
|
|
287503
287305
|
|
|
287504
287306
|
// EXTERNAL MODULE: external "node:fs/promises"
|
|
287505
|
-
var
|
|
287506
|
-
var
|
|
287307
|
+
var promises_ = __nccwpck_require__(93977);
|
|
287308
|
+
var promises_default = /*#__PURE__*/__nccwpck_require__.n(promises_);
|
|
287507
287309
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/crawler.ts
|
|
287508
287310
|
|
|
287509
287311
|
|
|
@@ -287575,7 +287377,7 @@ async function crawl(dir, filter, exec) {
|
|
|
287575
287377
|
*/
|
|
287576
287378
|
async function slurpFile(entry, exec) {
|
|
287577
287379
|
await waitForEmptySlot();
|
|
287578
|
-
return
|
|
287380
|
+
return promises_.readFile(entry, 'utf8')
|
|
287579
287381
|
.then(async (data) => {
|
|
287580
287382
|
/**
|
|
287581
287383
|
* We need to first free the slot. Otherwise if there is more
|
|
@@ -287612,7 +287414,7 @@ async function freeSlot() {
|
|
|
287612
287414
|
*
|
|
287613
287415
|
*/
|
|
287614
287416
|
async function crawlDirectory(dirEnt, exec) {
|
|
287615
|
-
const entries = (await
|
|
287417
|
+
const entries = (await promises_.readdir(dirEnt)).map((entry) => external_path_.join(dirEnt, entry));
|
|
287616
287418
|
const slurps = [];
|
|
287617
287419
|
for (const entry of entries) {
|
|
287618
287420
|
const testDir = await isDir(entry);
|
|
@@ -287628,7 +287430,7 @@ async function crawlDirectory(dirEnt, exec) {
|
|
|
287628
287430
|
});
|
|
287629
287431
|
}
|
|
287630
287432
|
function isDir(dirEnt) {
|
|
287631
|
-
return
|
|
287433
|
+
return promises_.stat(dirEnt)
|
|
287632
287434
|
.then((stat) => {
|
|
287633
287435
|
return stat.isDirectory();
|
|
287634
287436
|
})
|
|
@@ -288593,6 +288395,8 @@ class RevisionNormalizer extends Normalizer {
|
|
|
288593
288395
|
}
|
|
288594
288396
|
}
|
|
288595
288397
|
|
|
288398
|
+
// EXTERNAL MODULE: external "fs/promises"
|
|
288399
|
+
var external_fs_promises_ = __nccwpck_require__(73292);
|
|
288596
288400
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/normalizers/tfworkspace.ts
|
|
288597
288401
|
|
|
288598
288402
|
|
|
@@ -288676,11 +288480,11 @@ async function loadAdditionalFiles(files, tfRootModulePath) {
|
|
|
288676
288480
|
async function loadAdditionalFile(source, tfRootModulePath) {
|
|
288677
288481
|
try {
|
|
288678
288482
|
const filePath = external_path_.join(tfRootModulePath, source);
|
|
288679
|
-
const stats = await
|
|
288483
|
+
const stats = await external_fs_promises_.stat(filePath);
|
|
288680
288484
|
if (!stats.isFile()) {
|
|
288681
288485
|
throw new Error(`${source} is not a file`);
|
|
288682
288486
|
}
|
|
288683
|
-
const content = await
|
|
288487
|
+
const content = await external_fs_promises_.readFile(filePath, {
|
|
288684
288488
|
encoding: 'utf8',
|
|
288685
288489
|
});
|
|
288686
288490
|
return Buffer.from(content, 'utf8').toString('base64');
|
|
@@ -292440,8 +292244,8 @@ async function mkNamedTmp(...names) {
|
|
|
292440
292244
|
ensureSafeTmpNames(name);
|
|
292441
292245
|
}
|
|
292442
292246
|
const dir = external_node_path_.join(external_node_os_namespaceObject.tmpdir(), ...names);
|
|
292443
|
-
await
|
|
292444
|
-
await
|
|
292247
|
+
await promises_.rm(dir, { recursive: true, force: true });
|
|
292248
|
+
await promises_.mkdir(dir, { recursive: true });
|
|
292445
292249
|
return dir;
|
|
292446
292250
|
}
|
|
292447
292251
|
async function mkTmp(prefix = 'feature-render-') {
|
|
@@ -292953,7 +292757,7 @@ async function* resolveClaimEntries(claimRefsList) {
|
|
|
292953
292757
|
cdk8s_renderer_src_logger.info(`Resolving ${claimRefsList.join(',')}`);
|
|
292954
292758
|
for (const claimEntry of claimRefsList) {
|
|
292955
292759
|
try {
|
|
292956
|
-
const claimEntryStats = await (0,
|
|
292760
|
+
const claimEntryStats = await (0,promises_.stat)(claimEntry);
|
|
292957
292761
|
if (claimEntryStats.isDirectory()) {
|
|
292958
292762
|
yield* resolveDirEntries(claimEntry);
|
|
292959
292763
|
}
|
|
@@ -292972,7 +292776,7 @@ async function* resolveClaimEntries(claimRefsList) {
|
|
|
292972
292776
|
async function* resolveDirEntries(dir) {
|
|
292973
292777
|
let entries = [];
|
|
292974
292778
|
try {
|
|
292975
|
-
entries = await (0,
|
|
292779
|
+
entries = await (0,promises_.readdir)(dir, { withFileTypes: true });
|
|
292976
292780
|
}
|
|
292977
292781
|
catch (err) {
|
|
292978
292782
|
throw new Error(`Reading dir: ${dir}: ${err}`);
|
|
@@ -293973,7 +293777,6 @@ function toJson_FirestartrGithubRepositorySpecRepo(obj) {
|
|
|
293973
293777
|
'allowUpdateBranch': obj.allowUpdateBranch,
|
|
293974
293778
|
'hasIssues': obj.hasIssues,
|
|
293975
293779
|
'hasWiki': obj.hasWiki,
|
|
293976
|
-
'pages': obj.pages,
|
|
293977
293780
|
'topics': obj.topics?.map(y => y),
|
|
293978
293781
|
'labels': obj.labels?.map(y => toJson_FirestartrGithubRepositorySpecRepoLabels(y)),
|
|
293979
293782
|
'visibility': obj.visibility,
|
|
@@ -296131,7 +295934,7 @@ class GithubRepositoryChart extends BaseGithubChart {
|
|
|
296131
295934
|
hasIssues: claim.providers.github.hasIssues,
|
|
296132
295935
|
visibility: claim.providers.github.visibility,
|
|
296133
295936
|
defaultBranch: claim.providers.github?.branchStrategy?.defaultBranch,
|
|
296134
|
-
codeowners:
|
|
295937
|
+
codeowners: createCodeOwnersData(claim),
|
|
296135
295938
|
additionalBranches: claim.providers.github.additionalBranches || [],
|
|
296136
295939
|
labels: claim.providers.github.labels || [],
|
|
296137
295940
|
topics: claim.providers.github.topics || [],
|
|
@@ -296230,7 +296033,6 @@ class GithubRepositoryChart extends BaseGithubChart {
|
|
|
296230
296033
|
* @param claim
|
|
296231
296034
|
* @returns VarsConfiguration
|
|
296232
296035
|
*/
|
|
296233
|
-
// VarsConfiguration type was removed; use any for compatibility
|
|
296234
296036
|
createVars(claim) {
|
|
296235
296037
|
const vars = {};
|
|
296236
296038
|
const varsDefinition = claim.providers?.github?.vars;
|
|
@@ -296243,10 +296045,7 @@ class GithubRepositoryChart extends BaseGithubChart {
|
|
|
296243
296045
|
}
|
|
296244
296046
|
formatVars(blockDefinition) {
|
|
296245
296047
|
return blockDefinition.map((varDef) => {
|
|
296246
|
-
|
|
296247
|
-
// if (isRepoSecretRef(varDef.value)) {
|
|
296248
|
-
if (typeof varDef.value === 'string' &&
|
|
296249
|
-
/^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/.test(varDef.value)) {
|
|
296048
|
+
if (isRepoSecretRef(varDef.value)) {
|
|
296250
296049
|
const parts = varDef.value.split(':');
|
|
296251
296050
|
return {
|
|
296252
296051
|
name: varDef.name,
|
|
@@ -297378,6 +297177,20 @@ function searchSecretKey(secretClaim, key) {
|
|
|
297378
297177
|
return found;
|
|
297379
297178
|
}
|
|
297380
297179
|
|
|
297180
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/componentPagesPath.ts
|
|
297181
|
+
/**
|
|
297182
|
+
* Intentionally a no-op.
|
|
297183
|
+
*
|
|
297184
|
+
* Claim-kind-specific constraints such as ComponentClaim
|
|
297185
|
+
* providers.github.pages.source.path belong in the ComponentClaim schema
|
|
297186
|
+
* or in the claim->CR build/normalization step, not in src/validations.
|
|
297187
|
+
*
|
|
297188
|
+
* This function is kept to preserve the existing exported API for callers.
|
|
297189
|
+
*/
|
|
297190
|
+
function validateComponentPagesPath(_renderClaims) {
|
|
297191
|
+
return;
|
|
297192
|
+
}
|
|
297193
|
+
|
|
297381
297194
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
|
|
297382
297195
|
|
|
297383
297196
|
|
|
@@ -297386,6 +297199,7 @@ function searchSecretKey(secretClaim, key) {
|
|
|
297386
297199
|
|
|
297387
297200
|
|
|
297388
297201
|
|
|
297202
|
+
|
|
297389
297203
|
/*
|
|
297390
297204
|
* Function called when rendering but not importing
|
|
297391
297205
|
*
|
|
@@ -297402,6 +297216,7 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
|
|
|
297402
297216
|
const result = await renderClaims(catalogScope, firestartrScope, data);
|
|
297403
297217
|
try {
|
|
297404
297218
|
validateSubReferences(data.renderClaims);
|
|
297219
|
+
validateComponentPagesPath(data.renderClaims);
|
|
297405
297220
|
validateTfStateKeyUniqueness(result);
|
|
297406
297221
|
validateCrSizes(result);
|
|
297407
297222
|
validatePermissionsUniqueness(result);
|
|
@@ -298390,6 +298205,39 @@ MemberCollectionGithubDecanter.collectionKind = 'gh-members';
|
|
|
298390
298205
|
applyCollectionMixins(MemberCollectionGithubDecanter);
|
|
298391
298206
|
/* harmony default export */ const github_member_collection = (MemberCollectionGithubDecanter);
|
|
298392
298207
|
|
|
298208
|
+
;// CONCATENATED MODULE: ../importer/src/utils/codeowner.ts
|
|
298209
|
+
function extractFromCodeOwners(codeOwnersContent) {
|
|
298210
|
+
if (!codeOwnersContent) {
|
|
298211
|
+
return [];
|
|
298212
|
+
}
|
|
298213
|
+
return codeOwnersContent.split(/\r?\n/).flatMap((line) => {
|
|
298214
|
+
const trimmedLine = line.trim();
|
|
298215
|
+
// skip blank lines and full-line comments
|
|
298216
|
+
if (!trimmedLine || trimmedLine.startsWith('#')) {
|
|
298217
|
+
return [];
|
|
298218
|
+
}
|
|
298219
|
+
// strip inline comments before parsing owners
|
|
298220
|
+
const lineWithoutInlineComment = line.replace(/\s*#.*$/, '').trim();
|
|
298221
|
+
if (!lineWithoutInlineComment) {
|
|
298222
|
+
return [];
|
|
298223
|
+
}
|
|
298224
|
+
// CODEOWNERS format: <pattern> <owner1> [<owner2> ...]
|
|
298225
|
+
// first field is the path pattern; owners start from the second field
|
|
298226
|
+
const parts = lineWithoutInlineComment.split(/\s+/);
|
|
298227
|
+
if (parts.length < 2) {
|
|
298228
|
+
return [];
|
|
298229
|
+
}
|
|
298230
|
+
return parts
|
|
298231
|
+
.slice(1)
|
|
298232
|
+
.filter((part) => part.startsWith('@'))
|
|
298233
|
+
.map((owner) => ({
|
|
298234
|
+
full: owner,
|
|
298235
|
+
isTeam: owner.includes('/'),
|
|
298236
|
+
name: owner,
|
|
298237
|
+
}));
|
|
298238
|
+
});
|
|
298239
|
+
}
|
|
298240
|
+
|
|
298393
298241
|
;// CONCATENATED MODULE: ../importer/src/utils/nomicon.ts
|
|
298394
298242
|
function transformRepoName(repoName) {
|
|
298395
298243
|
// Convert to lowercase
|
|
@@ -298463,15 +298311,23 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
298463
298311
|
});
|
|
298464
298312
|
}
|
|
298465
298313
|
__decantPages() {
|
|
298466
|
-
if (this.data.
|
|
298467
|
-
this.
|
|
298468
|
-
|
|
298469
|
-
|
|
298470
|
-
|
|
298471
|
-
|
|
298472
|
-
|
|
298473
|
-
|
|
298474
|
-
|
|
298314
|
+
if (this.data.pages) {
|
|
298315
|
+
if (this.data.pages.build_type === 'workflow') {
|
|
298316
|
+
importer_src_logger.info(`Repository ${this.data.repoDetails.name} is using GitHub Actions for Pages deployment, skipping Pages configuration in claim as it's managed via workflow.`);
|
|
298317
|
+
}
|
|
298318
|
+
else if (this.data.pages.build_type === 'legacy') {
|
|
298319
|
+
this.__patchClaim({
|
|
298320
|
+
op: 'add',
|
|
298321
|
+
path: '/providers/github/pages',
|
|
298322
|
+
value: {
|
|
298323
|
+
...(typeof this.data.pages.cname === 'string' &&
|
|
298324
|
+
this.data.pages.cname.length > 0
|
|
298325
|
+
? { cname: this.data.pages.cname }
|
|
298326
|
+
: {}),
|
|
298327
|
+
source: this.data.pages.source,
|
|
298328
|
+
},
|
|
298329
|
+
});
|
|
298330
|
+
}
|
|
298475
298331
|
}
|
|
298476
298332
|
}
|
|
298477
298333
|
__decantOIDC() {
|
|
@@ -298496,7 +298352,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
298496
298352
|
// only for validation
|
|
298497
298353
|
__decantValidateCodeowners() {
|
|
298498
298354
|
if (this.data.codeowners) {
|
|
298499
|
-
const
|
|
298355
|
+
const owners = extractFromCodeOwners(this.data.codeowners);
|
|
298500
298356
|
const normalizeTeamIdentifier = (value) => {
|
|
298501
298357
|
const normalizedValue = (value.startsWith('@') ? value.slice(1) : value).toLowerCase();
|
|
298502
298358
|
if (!normalizedValue.includes('/')) {
|
|
@@ -298524,23 +298380,17 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
298524
298380
|
return (this.data.teamsAndMembers.directMembers.some((member) => member.name?.toLowerCase() === normalizedUserName) ||
|
|
298525
298381
|
this.data.teamsAndMembers.outsideMembers.some((member) => member.name?.toLowerCase() === normalizedUserName));
|
|
298526
298382
|
};
|
|
298527
|
-
//
|
|
298528
|
-
|
|
298529
|
-
|
|
298530
|
-
|
|
298531
|
-
|
|
298532
|
-
|
|
298533
|
-
|
|
298534
|
-
|
|
298535
|
-
|
|
298536
|
-
}
|
|
298537
|
-
|
|
298538
|
-
// Normal user owner
|
|
298539
|
-
if (!isInUsers(owner)) {
|
|
298540
|
-
importer_src_logger.error(`[${this.org}/${this.data.repoDetails.name}] CODEOWNERS file references user ${owner} which is not present in the repository's collaborators.`);
|
|
298541
|
-
throw new Error(`[${this.org}/${this.data.repoDetails.name}] CODEOWNERS file references user ${owner} which is not present in the repository's collaborators.`);
|
|
298542
|
-
}
|
|
298543
|
-
}
|
|
298383
|
+
// let's validate that every element in the
|
|
298384
|
+
// CODEOWNERS file is either a team or a user in the repository,
|
|
298385
|
+
// otherwise we will have dangling references in the claim which will cause issues down the line
|
|
298386
|
+
for (const owner of owners) {
|
|
298387
|
+
if (owner.isTeam && !isInTeams(owner.name)) {
|
|
298388
|
+
importer_src_logger.error(`[${this.org}/${this.data.repoDetails.name}] CODEOWNERS file references team ${owner.name} which is not present in the repository's teams.`);
|
|
298389
|
+
throw new Error(`[${this.org}/${this.data.repoDetails.name}] CODEOWNERS file references team ${owner.name} which is not present in the repository's teams.`);
|
|
298390
|
+
}
|
|
298391
|
+
else if (!owner.isTeam && !isInUsers(owner.name)) {
|
|
298392
|
+
importer_src_logger.error(`[${this.org}/${this.data.repoDetails.name}] CODEOWNERS file references user ${owner.name} which is not present in the repository's collaborators.`);
|
|
298393
|
+
throw new Error(`[${this.org}/${this.data.repoDetails.name}] CODEOWNERS file references user ${owner.name} which is not present in the repository's collaborators.`);
|
|
298544
298394
|
}
|
|
298545
298395
|
}
|
|
298546
298396
|
}
|
|
@@ -299118,7 +298968,7 @@ async function reimportGithubGitopsRepository(org, crsPath, configPath, generate
|
|
|
299118
298968
|
.replace(/\.\d{3}Z$/, 'Z'); // exact format: 2026-04-19T20:45:00Z
|
|
299119
298969
|
// we write the cr back to the file system
|
|
299120
298970
|
const newContent = catalog_common.io.toYaml(cr);
|
|
299121
|
-
await
|
|
298971
|
+
await promises_default().writeFile(filePath, newContent, 'utf-8');
|
|
299122
298972
|
}
|
|
299123
298973
|
});
|
|
299124
298974
|
// we need to search for dependencies if proceeds
|
|
@@ -299151,19 +299001,19 @@ async function searchForDependencies(org, crsPath, configPath, generatedFilters,
|
|
|
299151
299001
|
.replace(/\.\d{3}Z$/, 'Z'); // exact format: 2026-04-19T20:45:00Z
|
|
299152
299002
|
// we write the cr back to the file system
|
|
299153
299003
|
const newContent = catalog_common.io.toYaml(cr);
|
|
299154
|
-
await
|
|
299004
|
+
await promises_default().writeFile(filePath, newContent, 'utf-8');
|
|
299155
299005
|
}
|
|
299156
299006
|
}
|
|
299157
299007
|
}
|
|
299158
299008
|
});
|
|
299159
299009
|
}
|
|
299160
299010
|
async function searchCRs(dirname, functionToApply) {
|
|
299161
|
-
const files = await
|
|
299011
|
+
const files = await promises_default().readdir(dirname);
|
|
299162
299012
|
for (const file of files) {
|
|
299163
299013
|
if (file.endsWith('.yaml') || file.endsWith('.yml')) {
|
|
299164
299014
|
importer_src_logger.debug(`Processing file: ${file}`);
|
|
299165
299015
|
const filePath = external_path_default().join(dirname, file);
|
|
299166
|
-
const content = await
|
|
299016
|
+
const content = await promises_default().readFile(filePath, 'utf-8');
|
|
299167
299017
|
// let's use the catalog_common yaml loader
|
|
299168
299018
|
const cr = catalog_common.io.fromYaml(content);
|
|
299169
299019
|
// let's check if the file is a valid file (i.e a CR)
|
|
@@ -299180,7 +299030,7 @@ async function searchCRs(dirname, functionToApply) {
|
|
|
299180
299030
|
}
|
|
299181
299031
|
async function reimporter_isDirectory(path) {
|
|
299182
299032
|
try {
|
|
299183
|
-
return (await
|
|
299033
|
+
return (await promises_default().stat(path)).isDirectory(); //
|
|
299184
299034
|
}
|
|
299185
299035
|
catch (err) {
|
|
299186
299036
|
return false;
|
|
@@ -303360,8 +303210,8 @@ class WriterAdditionalFiles extends writer {
|
|
|
303360
303210
|
if (!targetPath.startsWith(absProjectPath + external_path_.sep)) {
|
|
303361
303211
|
throw new Error(`Path traversal detected: ${file.path}`);
|
|
303362
303212
|
}
|
|
303363
|
-
await
|
|
303364
|
-
await
|
|
303213
|
+
await external_fs_promises_.mkdir(external_path_.dirname(targetPath), { recursive: true });
|
|
303214
|
+
await external_fs_promises_.writeFile(targetPath, Buffer.from(file.content, 'base64').toString('utf8'));
|
|
303365
303215
|
}
|
|
303366
303216
|
catch (err) {
|
|
303367
303217
|
throw new Error(`Error writing additional file: ${file.path}: ${err}`);
|
|
@@ -305988,27 +305838,33 @@ class EntityCR {
|
|
|
305988
305838
|
const MODULES = {
|
|
305989
305839
|
FirestartrGithubGroup: {
|
|
305990
305840
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-team',
|
|
305991
|
-
|
|
305841
|
+
// github-team-v0.2.0
|
|
305842
|
+
ref: '6f1e31d8573bc614f22a9ac75e622ed970d3725b',
|
|
305992
305843
|
},
|
|
305993
305844
|
FirestartrGithubRepositorySecretsSection: {
|
|
305994
305845
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo-secrets-section',
|
|
305995
|
-
|
|
305846
|
+
// github-repo-secrets-section-v0.1.0
|
|
305847
|
+
ref: 'd0f77312682b4ff140b679de5fd824fa2a36ccda',
|
|
305996
305848
|
},
|
|
305997
305849
|
FirestartrGithubRepository: {
|
|
305998
305850
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
|
|
305999
|
-
|
|
305851
|
+
// github-repo-v0.3.0
|
|
305852
|
+
ref: '7ac2cf2c6348b3b9dfb305b8ff187e1bed0da55c',
|
|
306000
305853
|
},
|
|
306001
305854
|
FirestartrGithubRepositoryFeature: {
|
|
306002
305855
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
|
|
306003
|
-
|
|
305856
|
+
// github-files-set-v0.1.0
|
|
305857
|
+
ref: '2c4f39e995d165297550675b594c6b57812b3847',
|
|
306004
305858
|
},
|
|
306005
305859
|
FirestartrGithubMembership: {
|
|
306006
305860
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-membership',
|
|
306007
|
-
|
|
305861
|
+
// github-membership-v0.2.0
|
|
305862
|
+
ref: '2f58407e00ecde5e242a90c82214535907c9a49b',
|
|
306008
305863
|
},
|
|
306009
305864
|
FirestartrGithubOrgWebhook: {
|
|
306010
305865
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-webhook',
|
|
306011
|
-
|
|
305866
|
+
// github-org-webhook-v0.2.0
|
|
305867
|
+
ref: '12d72ba15780647b2f9c2905938913344bfeaa4d',
|
|
306012
305868
|
},
|
|
306013
305869
|
};
|
|
306014
305870
|
function getFirestartrDefaultTFM(kind) {
|
|
@@ -306745,6 +306601,42 @@ class EntityGHRepo extends base_Entity {
|
|
|
306745
306601
|
},
|
|
306746
306602
|
});
|
|
306747
306603
|
}
|
|
306604
|
+
/**
|
|
306605
|
+
* Validation logic for GitHub Pages branch settings:
|
|
306606
|
+
* - On create: If pages branch is set, it must equal the default branch.
|
|
306607
|
+
* - On update: If pages branch is set and is not the default, it must exist in remote.
|
|
306608
|
+
*/
|
|
306609
|
+
async validatePagesBranch(tfOp, repoAlreadyExists) {
|
|
306610
|
+
const pages = this.cr.spec.pages;
|
|
306611
|
+
if (!pages || !pages.source || !pages.source.branch)
|
|
306612
|
+
return;
|
|
306613
|
+
const branch = pages.source.branch;
|
|
306614
|
+
const defaultBranch = this.cr.spec.repo.defaultBranch;
|
|
306615
|
+
const repo = this.cr.name;
|
|
306616
|
+
const org = this.cr.spec.org;
|
|
306617
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} validating pages branch '${branch}' against default branch '${defaultBranch}' for operation '${tfOp}'`);
|
|
306618
|
+
if (!repoAlreadyExists) {
|
|
306619
|
+
if (branch !== defaultBranch) {
|
|
306620
|
+
throw new Error(`Pages branch must equal default branch on creation. Provided: '${branch}', expected: '${defaultBranch}'`);
|
|
306621
|
+
}
|
|
306622
|
+
return;
|
|
306623
|
+
}
|
|
306624
|
+
else if (branch !== defaultBranch) {
|
|
306625
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} validating pages branch '${branch}' against default branch '${defaultBranch}' for operation '${tfOp}' - branch is different from default, checking existence in remote`);
|
|
306626
|
+
try {
|
|
306627
|
+
await this.runWithGithubProvider(async () => {
|
|
306628
|
+
await github.branches.getBranch(repo, branch, org);
|
|
306629
|
+
});
|
|
306630
|
+
}
|
|
306631
|
+
catch (err) {
|
|
306632
|
+
if (err && err.status === 404) {
|
|
306633
|
+
throw new Error(`Pages branch '${branch}' does not exist in the repository '${org}/${repo}'.`);
|
|
306634
|
+
}
|
|
306635
|
+
// Other errors propagate
|
|
306636
|
+
throw err;
|
|
306637
|
+
}
|
|
306638
|
+
}
|
|
306639
|
+
}
|
|
306748
306640
|
async loadResources(tfOp) {
|
|
306749
306641
|
let repoAlreadyExists = false;
|
|
306750
306642
|
try {
|
|
@@ -306752,7 +306644,11 @@ class EntityGHRepo extends base_Entity {
|
|
|
306752
306644
|
repoAlreadyExists = (await this.runWithGithubProvider(async () => {
|
|
306753
306645
|
return await github.repo.repoExists(this.cr.spec.org, this.cr.name);
|
|
306754
306646
|
}));
|
|
306647
|
+
if (tfOp !== 'destroy' && tfOp !== 'plan-destroy') {
|
|
306648
|
+
await this.validatePagesBranch(tfOp, repoAlreadyExists);
|
|
306649
|
+
}
|
|
306755
306650
|
await this.provisionRepository();
|
|
306651
|
+
this.provisionPages();
|
|
306756
306652
|
await provisionDefaultBranch(this);
|
|
306757
306653
|
await provisionCodeowners(this);
|
|
306758
306654
|
await provisionVariables(this);
|
|
@@ -306860,10 +306756,25 @@ class EntityGHRepo extends base_Entity {
|
|
|
306860
306756
|
ignoreVulnerabilityAlertsDuringRead: this.cr.spec.repo.ignoreVulnerabilityAlertsDuringRead,
|
|
306861
306757
|
mergeCommitTitle: this.cr.spec.repo.mergeCommitTitle,
|
|
306862
306758
|
squashMergeCommitMessage: this.cr.spec.repo.squashMergeCommitMessage,
|
|
306863
|
-
pages: this.cr.spec.pages,
|
|
306864
306759
|
},
|
|
306865
306760
|
});
|
|
306866
306761
|
}
|
|
306762
|
+
provisionPages() {
|
|
306763
|
+
if (this.cr.spec.pages) {
|
|
306764
|
+
const source = this.cr.spec.pages.source ?? {};
|
|
306765
|
+
this.patchData({
|
|
306766
|
+
path: '/config/pages',
|
|
306767
|
+
op: PatchOperations.add,
|
|
306768
|
+
value: {
|
|
306769
|
+
source: {
|
|
306770
|
+
branch: source.branch || this.cr.spec.repo.defaultBranch,
|
|
306771
|
+
path: source.path || '/',
|
|
306772
|
+
},
|
|
306773
|
+
cname: this.cr.spec.pages.cname,
|
|
306774
|
+
},
|
|
306775
|
+
});
|
|
306776
|
+
}
|
|
306777
|
+
}
|
|
306867
306778
|
}
|
|
306868
306779
|
|
|
306869
306780
|
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghfeature/helpers/managed_files.ts
|
|
@@ -307018,10 +306929,10 @@ function providers_replaceInlineSecrets(inline, secrets) {
|
|
|
307018
306929
|
|
|
307019
306930
|
const DEBUG_DIR = external_path_default().join(external_os_default().tmpdir(), 'gh-debug');
|
|
307020
306931
|
async function initDebug(entity, deps) {
|
|
307021
|
-
await (0,
|
|
307022
|
-
await (0,
|
|
307023
|
-
await (0,
|
|
307024
|
-
await (0,
|
|
306932
|
+
await (0,promises_.rm)(DEBUG_DIR, { recursive: true, force: true });
|
|
306933
|
+
await (0,promises_.mkdir)(DEBUG_DIR, { recursive: true });
|
|
306934
|
+
await (0,promises_.writeFile)(external_path_default().join(DEBUG_DIR, 'cr.yaml'), catalog_common.io.toYaml(entity.cr.rawCr));
|
|
306935
|
+
await (0,promises_.writeFile)(external_path_default().join(DEBUG_DIR, 'deps.yaml'), catalog_common.io.toYaml(deps));
|
|
307025
306936
|
gh_provisioner_src_logger.enableFileLogging(external_path_default().join(DEBUG_DIR, 'debug.log'));
|
|
307026
306937
|
}
|
|
307027
306938
|
function getTFProjectPath(entity) {
|
|
@@ -307029,11 +306940,11 @@ function getTFProjectPath(entity) {
|
|
|
307029
306940
|
}
|
|
307030
306941
|
async function debugTerraformOutput(entity, output) {
|
|
307031
306942
|
const pathToOutput = external_path_default().join(getTFProjectPath(entity), 'terraform-output.txt');
|
|
307032
|
-
await (0,
|
|
306943
|
+
await (0,promises_.writeFile)(pathToOutput, output);
|
|
307033
306944
|
gh_provisioner_src_logger.debug(`[gh-provisioner] debug: Terraform error written to ${pathToOutput}`);
|
|
307034
306945
|
}
|
|
307035
306946
|
async function endDebug(entity) {
|
|
307036
|
-
await (0,
|
|
306947
|
+
await (0,promises_.writeFile)(external_path_default().join(DEBUG_DIR, 'config.json'), JSON.stringify(entity.document, null, 4));
|
|
307037
306948
|
gh_provisioner_src_logger.disableFileLogging();
|
|
307038
306949
|
}
|
|
307039
306950
|
|
|
@@ -307632,7 +307543,7 @@ async function runGhProvisioner(data, opts) {
|
|
|
307632
307543
|
gh_provisioner_src_logger.error(`[gh-provisioner] Error running runGhProvisioner: ${message}`);
|
|
307633
307544
|
if (!synthFinished && entity)
|
|
307634
307545
|
entity.synthEnd(message);
|
|
307635
|
-
if (entity && entity.inDebugMode) {
|
|
307546
|
+
if (entity && entity.inDebugMode && synthFinished) {
|
|
307636
307547
|
await debugTerraformOutput(entity, message);
|
|
307637
307548
|
}
|
|
307638
307549
|
throw new Error(`[gh-provisioner] Error running runGhProvisioner: ${message}`);
|
|
@@ -309424,9 +309335,9 @@ const crs_analyzerSubcommand = {
|
|
|
309424
309335
|
};
|
|
309425
309336
|
|
|
309426
309337
|
;// CONCATENATED MODULE: ./package.json
|
|
309427
|
-
const package_namespaceObject =
|
|
309338
|
+
const package_namespaceObject = {"i8":"2.4.0"};
|
|
309428
309339
|
;// CONCATENATED MODULE: ../../package.json
|
|
309429
|
-
const package_namespaceObject_1 = {"i8":"2.
|
|
309340
|
+
const package_namespaceObject_1 = {"i8":"2.4.0"};
|
|
309430
309341
|
;// CONCATENATED MODULE: ./src/subcommands/index.ts
|
|
309431
309342
|
|
|
309432
309343
|
|
|
@@ -104,7 +104,6 @@ declare const _default: {
|
|
|
104
104
|
tokenizer: {
|
|
105
105
|
SimpleTokenizer: typeof import("./src/tokenizer").SimpleTokenizer;
|
|
106
106
|
};
|
|
107
|
-
codeowners: import("./src/codeowners").CodeOwnersAPI;
|
|
108
107
|
cron: {
|
|
109
108
|
validateCron: typeof validateCron;
|
|
110
109
|
isValidCron: typeof isValidCron;
|
|
@@ -1010,10 +1010,6 @@ export interface FirestartrGithubRepositorySpecRepo {
|
|
|
1010
1010
|
* @schema FirestartrGithubRepositorySpecRepo#hasWiki
|
|
1011
1011
|
*/
|
|
1012
1012
|
readonly hasWiki?: boolean;
|
|
1013
|
-
/**
|
|
1014
|
-
* @schema FirestartrGithubRepositorySpecRepo#pages
|
|
1015
|
-
*/
|
|
1016
|
-
readonly pages?: any;
|
|
1017
1013
|
/**
|
|
1018
1014
|
* @schema FirestartrGithubRepositorySpecRepo#topics
|
|
1019
1015
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiObject, GroupVersionKind } from 'cdk8s';
|
|
2
|
+
import { NamedVars } from '../../utils/repositoryClaimUtils';
|
|
2
3
|
import { FirestartrGithubRepositoryProps } from '../../../imports/firestartr.dev';
|
|
3
4
|
import { IUnitializedStateKey } from '../../claims/base';
|
|
4
5
|
import { BaseGithubChart } from './base';
|
|
@@ -21,7 +22,7 @@ export declare class GithubRepositoryChart extends BaseGithubChart {
|
|
|
21
22
|
* @returns VarsConfiguration
|
|
22
23
|
*/
|
|
23
24
|
private createVars;
|
|
24
|
-
formatVars(blockDefinition: any):
|
|
25
|
+
formatVars(blockDefinition: any): NamedVars;
|
|
25
26
|
extraCharts(): {
|
|
26
27
|
claim: {
|
|
27
28
|
kind: string;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { CodeOwnerEntry } from 'catalog_common/src/codeowners';
|
|
2
|
-
export declare function resolveCodeownersRef(ref: string, org: string): string;
|
|
3
|
-
/**
|
|
4
|
-
* Converts a claim (+optional additional rules) to CodeOwnerEntry[] for the codeowners API
|
|
5
|
-
*/
|
|
6
|
-
export declare function claimToCodeOwnersEntries(claim: any, additionalRules?: any[]): CodeOwnerEntry[];
|
|
7
|
-
export declare function createCodeOwnersData(claim: any, additionalRules?: any[]): string;
|
|
8
1
|
/**
|
|
9
2
|
* @description This method creates a permission for a given claimRef and permission
|
|
10
3
|
*
|
|
@@ -44,6 +37,47 @@ export interface CollaboratorPermission {
|
|
|
44
37
|
role: 'admin' | 'push' | 'pull' | 'maintain';
|
|
45
38
|
collaborator: string;
|
|
46
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @description This method creates the codeowners data for the repository
|
|
42
|
+
*
|
|
43
|
+
* @param claim
|
|
44
|
+
*
|
|
45
|
+
* @returns string
|
|
46
|
+
*/
|
|
47
|
+
export declare function createCodeOwnersData(claim: any, additionalRules?: any[]): string;
|
|
48
|
+
/**
|
|
49
|
+
* A reference to a secret, which can be an internal or external source.
|
|
50
|
+
*/
|
|
51
|
+
export interface SecretRef {
|
|
52
|
+
kind: 'Secret' | 'ExternalSecret';
|
|
53
|
+
name: string;
|
|
54
|
+
key: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* * A variable definition. It must have a name and can be either a literal
|
|
58
|
+
* * value or a reference to a secret.
|
|
59
|
+
* */
|
|
60
|
+
export type Var = {
|
|
61
|
+
name: string;
|
|
62
|
+
value: string;
|
|
63
|
+
} | {
|
|
64
|
+
name: string;
|
|
65
|
+
ref: SecretRef;
|
|
66
|
+
};
|
|
67
|
+
export type RepoSecret = {
|
|
68
|
+
name: string;
|
|
69
|
+
ref: RepoSecretRef;
|
|
70
|
+
};
|
|
71
|
+
export type NamedVars = Var[];
|
|
72
|
+
export type RepoSecrets = RepoSecret[];
|
|
73
|
+
export interface VarsConfiguration {
|
|
74
|
+
actions?: NamedVars;
|
|
75
|
+
}
|
|
76
|
+
export interface RepoSecretsConfiguration {
|
|
77
|
+
dependabot?: RepoSecrets;
|
|
78
|
+
actions?: RepoSecrets;
|
|
79
|
+
codespaces?: RepoSecrets;
|
|
80
|
+
}
|
|
47
81
|
export interface RepoSecretRef {
|
|
48
82
|
kind: 'secretsclaim';
|
|
49
83
|
name: string;
|
|
@@ -51,7 +85,3 @@ export interface RepoSecretRef {
|
|
|
51
85
|
}
|
|
52
86
|
export declare function isRepoSecretRef(suspectedRef: string): boolean;
|
|
53
87
|
export declare function extractRepoSecretRef(ref: string): RepoSecretRef;
|
|
54
|
-
/**
|
|
55
|
-
* @description This method creates the codeowners data for the repository
|
|
56
|
-
* Migrated: use claimToCodeOwnersEntries + common.codeowners.format instead of legacy helpers.
|
|
57
|
-
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RenderClaims } from '../renderer/types';
|
|
2
|
+
/**
|
|
3
|
+
* Intentionally a no-op.
|
|
4
|
+
*
|
|
5
|
+
* Claim-kind-specific constraints such as ComponentClaim
|
|
6
|
+
* providers.github.pages.source.path belong in the ComponentClaim schema
|
|
7
|
+
* or in the claim->CR build/normalization step, not in src/validations.
|
|
8
|
+
*
|
|
9
|
+
* This function is kept to preserve the existing exported API for callers.
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateComponentPagesPath(_renderClaims: RenderClaims): void;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { Entity } from '../base';
|
|
2
2
|
export declare class EntityGHRepo extends Entity {
|
|
3
3
|
constructor(artifact: any);
|
|
4
|
+
/**
|
|
5
|
+
* Validation logic for GitHub Pages branch settings:
|
|
6
|
+
* - On create: If pages branch is set, it must equal the default branch.
|
|
7
|
+
* - On update: If pages branch is set and is not the default, it must exist in remote.
|
|
8
|
+
*/
|
|
9
|
+
private validatePagesBranch;
|
|
4
10
|
loadResources(tfOp: string): Promise<void>;
|
|
5
11
|
postProvision(tfOp: string): Promise<void>;
|
|
6
12
|
loadAddressesToImport(): Promise<void>;
|
|
7
13
|
provisionRepository(): Promise<void>;
|
|
14
|
+
provisionPages(): void;
|
|
8
15
|
}
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
debug: (...args: any) => void;
|
|
6
6
|
verbose: (...args: any) => void;
|
|
7
7
|
silly: (...args: any) => void;
|
|
8
|
-
enableFileLogging: typeof import("catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
-
disableFileLogging: typeof import("catalog_common/src/logger/logger").disableFileLogging;
|
|
8
|
+
enableFileLogging: typeof import("../../catalog_common/src/logger/logger").enableFileLogging;
|
|
9
|
+
disableFileLogging: typeof import("../../catalog_common/src/logger/logger").disableFileLogging;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface CodeOwnerEntry {
|
|
2
|
-
pattern: string;
|
|
3
|
-
owners: string[];
|
|
4
|
-
comment?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface CodeOwnersAPI {
|
|
7
|
-
parse: (raw: string) => CodeOwnerEntry[];
|
|
8
|
-
format: (entries: CodeOwnerEntry[]) => string;
|
|
9
|
-
validate: (raw: string) => boolean;
|
|
10
|
-
get: (context: {
|
|
11
|
-
path?: string;
|
|
12
|
-
}) => Promise<string>;
|
|
13
|
-
set: (context: {
|
|
14
|
-
path?: string;
|
|
15
|
-
}, v: string) => Promise<void>;
|
|
16
|
-
updateRule: (context: {
|
|
17
|
-
path?: string;
|
|
18
|
-
}, rule: CodeOwnerEntry) => Promise<void>;
|
|
19
|
-
remove: (context: {
|
|
20
|
-
path?: string;
|
|
21
|
-
}, criteria: {
|
|
22
|
-
pattern?: string;
|
|
23
|
-
owner?: string;
|
|
24
|
-
}) => Promise<void>;
|
|
25
|
-
getOwners: (raw: string) => string[];
|
|
26
|
-
getDefault: () => string;
|
|
27
|
-
}
|
|
28
|
-
declare const codeowners: CodeOwnersAPI;
|
|
29
|
-
export default codeowners;
|