@firestartr/cli 2.3.0-snapshot-2 → 2.3.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 +3 -241
- package/build/packages/cdk8s_renderer/imports/firestartr.dev.d.ts +0 -33
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +0 -36
- package/build/packages/cdk8s_renderer/src/claims/github/component.schema.d.ts +0 -6
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +0 -36
- package/build/packages/cdk8s_renderer/src/claims/github/repository.d.ts +0 -6
- package/build/packages/gh_provisioner/src/entities/ghrepo/helpers/index.d.ts +0 -1
- package/build/packages/github/index.d.ts +0 -2
- package/build/packages/github/src/repository.d.ts +0 -8
- package/build/packages/importer/src/decanter/gh/github_repo.d.ts +0 -2
- package/package.json +1 -1
- package/build/packages/cdk8s_renderer/src/claims/github/component.labels.schema.d.ts +0 -32
- package/build/packages/cdk8s_renderer/src/initializers/component_labels.d.ts +0 -11
- package/build/packages/gh_provisioner/src/entities/ghrepo/helpers/labels.d.ts +0 -2
package/build/index.js
CHANGED
|
@@ -284669,16 +284669,6 @@ async function getRepoInfo(owner, name) {
|
|
|
284669
284669
|
const res = await octokit.repos.get({ owner: owner, repo: name });
|
|
284670
284670
|
return res['data'];
|
|
284671
284671
|
}
|
|
284672
|
-
async function repoExists(owner, name) {
|
|
284673
|
-
github_src_logger.info(`Checking if repo exists: ${owner}/${name}`);
|
|
284674
|
-
try {
|
|
284675
|
-
await getRepoInfo(owner, name);
|
|
284676
|
-
return true;
|
|
284677
|
-
}
|
|
284678
|
-
catch (error) {
|
|
284679
|
-
return false;
|
|
284680
|
-
}
|
|
284681
|
-
}
|
|
284682
284672
|
async function getPages(owner, name) {
|
|
284683
284673
|
github_src_logger.info(`Getting pages for ${owner}/${name}`);
|
|
284684
284674
|
const octokit = await getOctokitForOrg(owner);
|
|
@@ -284806,20 +284796,6 @@ async function addCommitStatus(state, sha, repo, owner = 'prefapp', target_url =
|
|
|
284806
284796
|
context,
|
|
284807
284797
|
});
|
|
284808
284798
|
}
|
|
284809
|
-
async function getRepoIssuesLabels(owner, repo) {
|
|
284810
|
-
github_src_logger.info(`Getting issues labels for ${owner}/${repo}`);
|
|
284811
|
-
const octokit = await getOctokitForOrg(owner);
|
|
284812
|
-
const res = await octokit.issues.listLabelsForRepo({
|
|
284813
|
-
owner: owner,
|
|
284814
|
-
repo: repo,
|
|
284815
|
-
});
|
|
284816
|
-
const metadataLabels = res.data.map((label) => ({
|
|
284817
|
-
name: label.name,
|
|
284818
|
-
description: label.description || '',
|
|
284819
|
-
color: label.color,
|
|
284820
|
-
}));
|
|
284821
|
-
return metadataLabels;
|
|
284822
|
-
}
|
|
284823
284799
|
/* harmony default export */ const repository = ({
|
|
284824
284800
|
listReleases,
|
|
284825
284801
|
getReleaseByTag,
|
|
@@ -284828,7 +284804,6 @@ async function getRepoIssuesLabels(owner, repo) {
|
|
|
284828
284804
|
uploadFile,
|
|
284829
284805
|
deleteFile,
|
|
284830
284806
|
getRepoInfo,
|
|
284831
|
-
repoExists,
|
|
284832
284807
|
getPages,
|
|
284833
284808
|
getBranchProtection,
|
|
284834
284809
|
getTeams,
|
|
@@ -284836,7 +284811,6 @@ async function getRepoIssuesLabels(owner, repo) {
|
|
|
284836
284811
|
getOIDCRepo,
|
|
284837
284812
|
addStatusCheck,
|
|
284838
284813
|
addCommitStatus,
|
|
284839
|
-
getRepoIssuesLabels,
|
|
284840
284814
|
});
|
|
284841
284815
|
|
|
284842
284816
|
;// CONCATENATED MODULE: ../github/src/team.ts
|
|
@@ -287937,44 +287911,6 @@ MetadataInitializer.applicableKinds = [
|
|
|
287937
287911
|
];
|
|
287938
287912
|
|
|
287939
287913
|
|
|
287940
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/initializers/component_labels.ts
|
|
287941
|
-
|
|
287942
|
-
class ComponentLabelsInitializer extends InitializerPatches {
|
|
287943
|
-
constructor() {
|
|
287944
|
-
super(...arguments);
|
|
287945
|
-
this.applicableProviders = ['github'];
|
|
287946
|
-
}
|
|
287947
|
-
async __validate() {
|
|
287948
|
-
return true;
|
|
287949
|
-
}
|
|
287950
|
-
async __patches(_claim, _previousCR) {
|
|
287951
|
-
return [
|
|
287952
|
-
{
|
|
287953
|
-
validate(cr) {
|
|
287954
|
-
if (cr.spec.repo.labels) {
|
|
287955
|
-
const visited = {};
|
|
287956
|
-
for (const label of cr.spec.repo.labels) {
|
|
287957
|
-
if (visited[label.name]) {
|
|
287958
|
-
throw `There is already a label called ${label.name} in the ComponentClaim ${cr.metadata.name}. Labels must be unique`;
|
|
287959
|
-
}
|
|
287960
|
-
visited[label.name] = true;
|
|
287961
|
-
}
|
|
287962
|
-
}
|
|
287963
|
-
return true;
|
|
287964
|
-
},
|
|
287965
|
-
apply(cr) {
|
|
287966
|
-
return cr;
|
|
287967
|
-
},
|
|
287968
|
-
identify() {
|
|
287969
|
-
return 'initializers/ComponentLabels';
|
|
287970
|
-
},
|
|
287971
|
-
},
|
|
287972
|
-
];
|
|
287973
|
-
}
|
|
287974
|
-
}
|
|
287975
|
-
ComponentLabelsInitializer.applicableKinds = ['ComponentClaim'];
|
|
287976
|
-
|
|
287977
|
-
|
|
287978
287914
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/initializers/index.ts
|
|
287979
287915
|
|
|
287980
287916
|
|
|
@@ -287986,7 +287922,6 @@ ComponentLabelsInitializer.applicableKinds = ['ComponentClaim'];
|
|
|
287986
287922
|
|
|
287987
287923
|
|
|
287988
287924
|
|
|
287989
|
-
|
|
287990
287925
|
const INITIALIZERS = [
|
|
287991
287926
|
UUIDInitializer,
|
|
287992
287927
|
InitializerClaimRef,
|
|
@@ -287994,7 +287929,6 @@ const INITIALIZERS = [
|
|
|
287994
287929
|
PolicyInitializer,
|
|
287995
287930
|
SyncerInitializer,
|
|
287996
287931
|
MetadataInitializer,
|
|
287997
|
-
ComponentLabelsInitializer,
|
|
287998
287932
|
];
|
|
287999
287933
|
const INITIALIZERS_BY_FILE_NAME = {
|
|
288000
287934
|
[TechnologyInitializer.FILE_NAME()]: TechnologyInitializer,
|
|
@@ -289404,12 +289338,6 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
289404
289338
|
pattern: '^[a-z0-9][a-z0-9-]*$',
|
|
289405
289339
|
},
|
|
289406
289340
|
},
|
|
289407
|
-
labels: {
|
|
289408
|
-
type: 'array',
|
|
289409
|
-
items: {
|
|
289410
|
-
$ref: 'firestartr.dev://github/GithubComponentClaimLabel',
|
|
289411
|
-
},
|
|
289412
|
-
},
|
|
289413
289341
|
overrides: {
|
|
289414
289342
|
type: 'object',
|
|
289415
289343
|
properties: {},
|
|
@@ -289618,40 +289546,6 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
289618
289546
|
},
|
|
289619
289547
|
});
|
|
289620
289548
|
|
|
289621
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/component.labels.schema.ts
|
|
289622
|
-
|
|
289623
|
-
/* harmony default export */ const component_labels_schema = ({
|
|
289624
|
-
$schema: SCHEMA,
|
|
289625
|
-
$id: 'GithubComponentClaimLabels',
|
|
289626
|
-
definitions: {
|
|
289627
|
-
GithubComponentClaimLabel: {
|
|
289628
|
-
$id: 'firestartr.dev://github/GithubComponentClaimLabel',
|
|
289629
|
-
type: 'object',
|
|
289630
|
-
required: ['name', 'color'],
|
|
289631
|
-
properties: {
|
|
289632
|
-
name: {
|
|
289633
|
-
type: 'string',
|
|
289634
|
-
minLength: 1,
|
|
289635
|
-
maxLength: 50,
|
|
289636
|
-
pattern: '^(?!\\s+$).+$',
|
|
289637
|
-
description: 'Label name (1-50 chars, not only whitespaces)',
|
|
289638
|
-
},
|
|
289639
|
-
color: {
|
|
289640
|
-
type: 'string',
|
|
289641
|
-
pattern: '^[0-9a-fA-F]{6}$',
|
|
289642
|
-
description: 'Color in hexadecimal without # (6 chars)',
|
|
289643
|
-
},
|
|
289644
|
-
description: {
|
|
289645
|
-
type: 'string',
|
|
289646
|
-
maxLength: 100,
|
|
289647
|
-
description: 'Optional label description (max 100 chars)',
|
|
289648
|
-
},
|
|
289649
|
-
},
|
|
289650
|
-
additionalProperties: false,
|
|
289651
|
-
},
|
|
289652
|
-
},
|
|
289653
|
-
});
|
|
289654
|
-
|
|
289655
289549
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
|
|
289656
289550
|
|
|
289657
289551
|
|
|
@@ -289659,7 +289553,6 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
289659
289553
|
|
|
289660
289554
|
|
|
289661
289555
|
|
|
289662
|
-
|
|
289663
289556
|
const GithubSchemas = [
|
|
289664
289557
|
github_group_schema,
|
|
289665
289558
|
github_user_schema,
|
|
@@ -289667,7 +289560,6 @@ const GithubSchemas = [
|
|
|
289667
289560
|
github_component_schema,
|
|
289668
289561
|
github_orgwebhook_schema,
|
|
289669
289562
|
component_secrets_vars_schema,
|
|
289670
|
-
component_labels_schema,
|
|
289671
289563
|
];
|
|
289672
289564
|
|
|
289673
289565
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.ts
|
|
@@ -293682,7 +293574,6 @@ function toJson_FirestartrGithubRepositorySpecRepo(obj) {
|
|
|
293682
293574
|
'hasWiki': obj.hasWiki,
|
|
293683
293575
|
'pages': obj.pages,
|
|
293684
293576
|
'topics': obj.topics?.map(y => y),
|
|
293685
|
-
'labels': obj.labels?.map(y => toJson_FirestartrGithubRepositorySpecRepoLabels(y)),
|
|
293686
293577
|
'visibility': obj.visibility,
|
|
293687
293578
|
'defaultBranch': obj.defaultBranch,
|
|
293688
293579
|
'additionalBranches': obj.additionalBranches?.map(y => toJson_FirestartrGithubRepositorySpecRepoAdditionalBranches(y)),
|
|
@@ -293829,22 +293720,6 @@ function toJson_FirestartrGithubRepositorySpecFirestartrTechnology(obj) {
|
|
|
293829
293720
|
// filter undefined values
|
|
293830
293721
|
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
293831
293722
|
}
|
|
293832
|
-
/**
|
|
293833
|
-
* Converts an object of type 'FirestartrGithubRepositorySpecRepoLabels' to JSON representation.
|
|
293834
|
-
*/
|
|
293835
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
293836
|
-
function toJson_FirestartrGithubRepositorySpecRepoLabels(obj) {
|
|
293837
|
-
if (obj === undefined) {
|
|
293838
|
-
return undefined;
|
|
293839
|
-
}
|
|
293840
|
-
const result = {
|
|
293841
|
-
'name': obj.name,
|
|
293842
|
-
'color': obj.color,
|
|
293843
|
-
'description': obj.description,
|
|
293844
|
-
};
|
|
293845
|
-
// filter undefined values
|
|
293846
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
293847
|
-
}
|
|
293848
293723
|
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
293849
293724
|
/**
|
|
293850
293725
|
* @schema FirestartrGithubRepositorySpecRepoVisibility
|
|
@@ -295840,7 +295715,6 @@ class GithubRepositoryChart extends BaseGithubChart {
|
|
|
295840
295715
|
defaultBranch: claim.providers.github?.branchStrategy?.defaultBranch,
|
|
295841
295716
|
codeowners: createCodeOwnersData(claim),
|
|
295842
295717
|
additionalBranches: claim.providers.github.additionalBranches || [],
|
|
295843
|
-
labels: claim.providers.github.labels || [],
|
|
295844
295718
|
topics: claim.providers.github.topics || [],
|
|
295845
295719
|
},
|
|
295846
295720
|
actions,
|
|
@@ -298153,17 +298027,6 @@ const TYPE_MAP = {
|
|
|
298153
298027
|
Team: 'group',
|
|
298154
298028
|
Organization: 'org',
|
|
298155
298029
|
};
|
|
298156
|
-
const DEFAULT_LABELS = [
|
|
298157
|
-
'bug',
|
|
298158
|
-
'documentation',
|
|
298159
|
-
'duplicate',
|
|
298160
|
-
'enhancement',
|
|
298161
|
-
'good first issue',
|
|
298162
|
-
'help wanted',
|
|
298163
|
-
'invalid',
|
|
298164
|
-
'question',
|
|
298165
|
-
'wontfix',
|
|
298166
|
-
];
|
|
298167
298030
|
class RepoGithubDecanter extends GithubDecanter {
|
|
298168
298031
|
constructor(data, org, githubTeams = {}) {
|
|
298169
298032
|
super(data, org);
|
|
@@ -298378,19 +298241,6 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
298378
298241
|
}));
|
|
298379
298242
|
}
|
|
298380
298243
|
}
|
|
298381
|
-
async __decantRepoLabels() {
|
|
298382
|
-
let labels = this.data.labels || [];
|
|
298383
|
-
labels = labels.filter((label) => {
|
|
298384
|
-
return !DEFAULT_LABELS.includes(label.name);
|
|
298385
|
-
});
|
|
298386
|
-
if (labels && labels.length > 0) {
|
|
298387
|
-
this.__patchClaim({
|
|
298388
|
-
op: 'add',
|
|
298389
|
-
value: labels,
|
|
298390
|
-
path: '/providers/github/labels',
|
|
298391
|
-
});
|
|
298392
|
-
}
|
|
298393
|
-
}
|
|
298394
298244
|
async __gatherRepoTeamsAndMembers() {
|
|
298395
298245
|
this.data['teamsAndMembers'] = {};
|
|
298396
298246
|
const directMembers = (await github.repo.getCollaborators(this.data.repoDetails.owner.login, this.data.repoDetails.name, 'direct')).map((member) => {
|
|
@@ -298457,16 +298307,6 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
298457
298307
|
}
|
|
298458
298308
|
importer_src_logger.info(`No CODEOWNERS file found for ${this.data.repoDetails.name}, skipping.`);
|
|
298459
298309
|
}
|
|
298460
|
-
async __gatherRepoLabels() {
|
|
298461
|
-
try {
|
|
298462
|
-
const labels = await github.repo.getRepoIssuesLabels(this.org, this.data.repoDetails.name);
|
|
298463
|
-
this.data['labels'] = labels;
|
|
298464
|
-
}
|
|
298465
|
-
catch (e) {
|
|
298466
|
-
importer_src_logger.error(`Error fetching labels for ${this.data.repoDetails.name}: ${e.message}`);
|
|
298467
|
-
throw new Error(`Error fetching labels for ${this.data.repoDetails.name}: ${e.message}`);
|
|
298468
|
-
}
|
|
298469
|
-
}
|
|
298470
298310
|
async __adaptInitializerBranchStrategies(_claim) {
|
|
298471
298311
|
const bpData = this.data.branchStrategy.data;
|
|
298472
298312
|
if (this.data.branchStrategy.kind === 'custom') {
|
|
@@ -305802,7 +305642,7 @@ const MODULES = {
|
|
|
305802
305642
|
},
|
|
305803
305643
|
FirestartrGithubRepository: {
|
|
305804
305644
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
|
|
305805
|
-
ref: '
|
|
305645
|
+
ref: 'fix/remove-topics-from-creation-to-avoid-crashes',
|
|
305806
305646
|
},
|
|
305807
305647
|
FirestartrGithubRepositoryFeature: {
|
|
305808
305648
|
module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
|
|
@@ -306396,76 +306236,6 @@ function provisionPermissions(fsGithubRepository) {
|
|
|
306396
306236
|
}
|
|
306397
306237
|
}
|
|
306398
306238
|
|
|
306399
|
-
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/helpers/labels.ts
|
|
306400
|
-
// if we are to provision labels using tofu and the label already
|
|
306401
|
-
// exists, we should not attempt to re-create it. This function checks
|
|
306402
|
-
// if the label exists and if so, imports it into Terraform state. This is needed because
|
|
306403
|
-
// tofu does not have an "upsert" operation for labels, so we need to check
|
|
306404
|
-
// if the label exists before trying to create it, otherwise we will get an error.
|
|
306405
|
-
|
|
306406
|
-
|
|
306407
|
-
|
|
306408
|
-
async function provisionLabels(fsGithubRepository, repoAlreadyExists) {
|
|
306409
|
-
try {
|
|
306410
|
-
const cr = fsGithubRepository.cr;
|
|
306411
|
-
const labels = cr.spec.repo.labels;
|
|
306412
|
-
if (!labels || labels.length === 0) {
|
|
306413
|
-
return;
|
|
306414
|
-
}
|
|
306415
|
-
if (repoAlreadyExists) {
|
|
306416
|
-
await importLabelsIfNeeded(fsGithubRepository);
|
|
306417
|
-
}
|
|
306418
|
-
for (const label of labels) {
|
|
306419
|
-
gh_provisioner_src_logger.debug(`[gh-provisioner] ${fsGithubRepository.k8sId} provisioning label ${label.name}`);
|
|
306420
|
-
fsGithubRepository.patchData({
|
|
306421
|
-
op: PatchOperations.add,
|
|
306422
|
-
path: '/config/labels/-',
|
|
306423
|
-
value: {
|
|
306424
|
-
name: label.name,
|
|
306425
|
-
color: label.color,
|
|
306426
|
-
description: label.description,
|
|
306427
|
-
},
|
|
306428
|
-
});
|
|
306429
|
-
}
|
|
306430
|
-
}
|
|
306431
|
-
catch (err) {
|
|
306432
|
-
gh_provisioner_src_logger.error(`[gh-provisioner] ${fsGithubRepository.k8sId} error on provisionLabels: ${err}`);
|
|
306433
|
-
throw new Error(`Error on provisionLabels: ${err}`);
|
|
306434
|
-
}
|
|
306435
|
-
}
|
|
306436
|
-
async function importLabelsIfNeeded(fsGithubRepository) {
|
|
306437
|
-
const cr = fsGithubRepository.cr;
|
|
306438
|
-
try {
|
|
306439
|
-
const labels = cr.spec.repo.labels;
|
|
306440
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} checking if labels need to be imported`);
|
|
306441
|
-
const repoIssuesList = await fsGithubRepository.runWithGithubProvider(async () => {
|
|
306442
|
-
return await github.repo.getRepoIssuesLabels(cr.spec.org, cr.name);
|
|
306443
|
-
});
|
|
306444
|
-
// labels that already exist in GitHub must be imported into Terraform state
|
|
306445
|
-
// so that Terraform manages them rather than trying to create them (which would fail)
|
|
306446
|
-
for (const label of labels) {
|
|
306447
|
-
if (!checkIfLabelExists(label.name, repoIssuesList)) {
|
|
306448
|
-
continue;
|
|
306449
|
-
}
|
|
306450
|
-
fsGithubRepository.patchImportData({
|
|
306451
|
-
op: PatchOperations.add,
|
|
306452
|
-
path: '/imports/-',
|
|
306453
|
-
value: {
|
|
306454
|
-
to: 'github_issue_label.this["' + label.name + '"]',
|
|
306455
|
-
id: `${cr.name}:${label.name}`,
|
|
306456
|
-
},
|
|
306457
|
-
});
|
|
306458
|
-
}
|
|
306459
|
-
}
|
|
306460
|
-
catch (err) {
|
|
306461
|
-
gh_provisioner_src_logger.error(`[gh-provisioner] ${fsGithubRepository.k8sId} error on importLabelsIfNeeded: ${err}`);
|
|
306462
|
-
throw new Error(`Error on importLabelsIfNeeded: ${err}`);
|
|
306463
|
-
}
|
|
306464
|
-
}
|
|
306465
|
-
function checkIfLabelExists(labelName, repoIssuesList) {
|
|
306466
|
-
return repoIssuesList.some((label) => label.name === labelName);
|
|
306467
|
-
}
|
|
306468
|
-
|
|
306469
306239
|
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/helpers/index.ts
|
|
306470
306240
|
|
|
306471
306241
|
|
|
@@ -306473,7 +306243,6 @@ function checkIfLabelExists(labelName, repoIssuesList) {
|
|
|
306473
306243
|
|
|
306474
306244
|
|
|
306475
306245
|
|
|
306476
|
-
|
|
306477
306246
|
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/post/additional_branches.ts
|
|
306478
306247
|
|
|
306479
306248
|
|
|
@@ -306538,7 +306307,6 @@ async function provisionRegularBranch(repo, branchName, sourceBranch, org) {
|
|
|
306538
306307
|
|
|
306539
306308
|
|
|
306540
306309
|
|
|
306541
|
-
|
|
306542
306310
|
class EntityGHRepo extends base_Entity {
|
|
306543
306311
|
constructor(artifact) {
|
|
306544
306312
|
super(artifact, {
|
|
@@ -306547,24 +306315,18 @@ class EntityGHRepo extends base_Entity {
|
|
|
306547
306315
|
variables: [],
|
|
306548
306316
|
teams: [],
|
|
306549
306317
|
collaborators: [],
|
|
306550
|
-
labels: [],
|
|
306551
306318
|
},
|
|
306552
306319
|
});
|
|
306553
306320
|
}
|
|
306554
306321
|
async loadResources(tfOp) {
|
|
306555
|
-
let repoAlreadyExists = false;
|
|
306556
306322
|
try {
|
|
306557
306323
|
this.synthMessage('Loading resources to Synth...');
|
|
306558
|
-
repoAlreadyExists = (await this.runWithGithubProvider(async () => {
|
|
306559
|
-
return await github.repo.repoExists(this.cr.spec.org, this.cr.name);
|
|
306560
|
-
}));
|
|
306561
306324
|
await this.provisionRepository();
|
|
306562
306325
|
await provisionDefaultBranch(this);
|
|
306563
306326
|
await provisionCodeowners(this);
|
|
306564
306327
|
await provisionVariables(this);
|
|
306565
306328
|
await provisionOIDCSubjectClaim(this);
|
|
306566
306329
|
await provisionPermissions(this);
|
|
306567
|
-
await provisionLabels(this, repoAlreadyExists);
|
|
306568
306330
|
this.synthMessage('Synth finished');
|
|
306569
306331
|
this.synthEnd(JSON.stringify(this.document, null, 2));
|
|
306570
306332
|
}
|
|
@@ -308763,9 +308525,9 @@ const crs_analyzerSubcommand = {
|
|
|
308763
308525
|
};
|
|
308764
308526
|
|
|
308765
308527
|
;// CONCATENATED MODULE: ./package.json
|
|
308766
|
-
const package_namespaceObject =
|
|
308528
|
+
const package_namespaceObject = {"i8":"2.3.0"};
|
|
308767
308529
|
;// CONCATENATED MODULE: ../../package.json
|
|
308768
|
-
const package_namespaceObject_1 = {"i8":"2.
|
|
308530
|
+
const package_namespaceObject_1 = {"i8":"2.3.0"};
|
|
308769
308531
|
;// CONCATENATED MODULE: ./src/subcommands/index.ts
|
|
308770
308532
|
|
|
308771
308533
|
|
|
@@ -1018,12 +1018,6 @@ export interface FirestartrGithubRepositorySpecRepo {
|
|
|
1018
1018
|
* @schema FirestartrGithubRepositorySpecRepo#topics
|
|
1019
1019
|
*/
|
|
1020
1020
|
readonly topics?: string[];
|
|
1021
|
-
/**
|
|
1022
|
-
* Array of labels to create in GitHub
|
|
1023
|
-
*
|
|
1024
|
-
* @schema FirestartrGithubRepositorySpecRepo#labels
|
|
1025
|
-
*/
|
|
1026
|
-
readonly labels?: FirestartrGithubRepositorySpecRepoLabels[];
|
|
1027
1021
|
/**
|
|
1028
1022
|
* @schema FirestartrGithubRepositorySpecRepo#visibility
|
|
1029
1023
|
*/
|
|
@@ -1210,33 +1204,6 @@ export interface FirestartrGithubRepositorySpecFirestartrTechnology {
|
|
|
1210
1204
|
* Converts an object of type 'FirestartrGithubRepositorySpecFirestartrTechnology' to JSON representation.
|
|
1211
1205
|
*/
|
|
1212
1206
|
export declare function toJson_FirestartrGithubRepositorySpecFirestartrTechnology(obj: FirestartrGithubRepositorySpecFirestartrTechnology | undefined): Record<string, any> | undefined;
|
|
1213
|
-
/**
|
|
1214
|
-
* @schema FirestartrGithubRepositorySpecRepoLabels
|
|
1215
|
-
*/
|
|
1216
|
-
export interface FirestartrGithubRepositorySpecRepoLabels {
|
|
1217
|
-
/**
|
|
1218
|
-
* Label name (1-50 characters, not only whitespace)
|
|
1219
|
-
*
|
|
1220
|
-
* @schema FirestartrGithubRepositorySpecRepoLabels#name
|
|
1221
|
-
*/
|
|
1222
|
-
readonly name: string;
|
|
1223
|
-
/**
|
|
1224
|
-
* Hexadecimal color without # (6 characters)
|
|
1225
|
-
*
|
|
1226
|
-
* @schema FirestartrGithubRepositorySpecRepoLabels#color
|
|
1227
|
-
*/
|
|
1228
|
-
readonly color: string;
|
|
1229
|
-
/**
|
|
1230
|
-
* Optional label description (max 100 characters)
|
|
1231
|
-
*
|
|
1232
|
-
* @schema FirestartrGithubRepositorySpecRepoLabels#description
|
|
1233
|
-
*/
|
|
1234
|
-
readonly description?: string;
|
|
1235
|
-
}
|
|
1236
|
-
/**
|
|
1237
|
-
* Converts an object of type 'FirestartrGithubRepositorySpecRepoLabels' to JSON representation.
|
|
1238
|
-
*/
|
|
1239
|
-
export declare function toJson_FirestartrGithubRepositorySpecRepoLabels(obj: FirestartrGithubRepositorySpecRepoLabels | undefined): Record<string, any> | undefined;
|
|
1240
1207
|
/**
|
|
1241
1208
|
* @schema FirestartrGithubRepositorySpecRepoVisibility
|
|
1242
1209
|
*/
|
|
@@ -784,12 +784,6 @@ declare const schemas: {
|
|
|
784
784
|
pattern: string;
|
|
785
785
|
};
|
|
786
786
|
};
|
|
787
|
-
labels: {
|
|
788
|
-
type: string;
|
|
789
|
-
items: {
|
|
790
|
-
$ref: string;
|
|
791
|
-
};
|
|
792
|
-
};
|
|
793
787
|
overrides: {
|
|
794
788
|
type: string;
|
|
795
789
|
properties: {};
|
|
@@ -947,36 +941,6 @@ declare const schemas: {
|
|
|
947
941
|
additionalProperties: boolean;
|
|
948
942
|
};
|
|
949
943
|
};
|
|
950
|
-
} | {
|
|
951
|
-
$schema: string;
|
|
952
|
-
$id: string;
|
|
953
|
-
definitions: {
|
|
954
|
-
GithubComponentClaimLabel: {
|
|
955
|
-
$id: string;
|
|
956
|
-
type: string;
|
|
957
|
-
required: string[];
|
|
958
|
-
properties: {
|
|
959
|
-
name: {
|
|
960
|
-
type: string;
|
|
961
|
-
minLength: number;
|
|
962
|
-
maxLength: number;
|
|
963
|
-
pattern: string;
|
|
964
|
-
description: string;
|
|
965
|
-
};
|
|
966
|
-
color: {
|
|
967
|
-
type: string;
|
|
968
|
-
pattern: string;
|
|
969
|
-
description: string;
|
|
970
|
-
};
|
|
971
|
-
description: {
|
|
972
|
-
type: string;
|
|
973
|
-
maxLength: number;
|
|
974
|
-
description: string;
|
|
975
|
-
};
|
|
976
|
-
};
|
|
977
|
-
additionalProperties: boolean;
|
|
978
|
-
};
|
|
979
|
-
};
|
|
980
944
|
})[] | {
|
|
981
945
|
$id: string;
|
|
982
946
|
definitions: {
|
|
@@ -315,12 +315,6 @@ export declare const GithubSchemas: ({
|
|
|
315
315
|
pattern: string;
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
|
-
labels: {
|
|
319
|
-
type: string;
|
|
320
|
-
items: {
|
|
321
|
-
$ref: string;
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
318
|
overrides: {
|
|
325
319
|
type: string;
|
|
326
320
|
properties: {};
|
|
@@ -478,34 +472,4 @@ export declare const GithubSchemas: ({
|
|
|
478
472
|
additionalProperties: boolean;
|
|
479
473
|
};
|
|
480
474
|
};
|
|
481
|
-
} | {
|
|
482
|
-
$schema: string;
|
|
483
|
-
$id: string;
|
|
484
|
-
definitions: {
|
|
485
|
-
GithubComponentClaimLabel: {
|
|
486
|
-
$id: string;
|
|
487
|
-
type: string;
|
|
488
|
-
required: string[];
|
|
489
|
-
properties: {
|
|
490
|
-
name: {
|
|
491
|
-
type: string;
|
|
492
|
-
minLength: number;
|
|
493
|
-
maxLength: number;
|
|
494
|
-
pattern: string;
|
|
495
|
-
description: string;
|
|
496
|
-
};
|
|
497
|
-
color: {
|
|
498
|
-
type: string;
|
|
499
|
-
pattern: string;
|
|
500
|
-
description: string;
|
|
501
|
-
};
|
|
502
|
-
description: {
|
|
503
|
-
type: string;
|
|
504
|
-
maxLength: number;
|
|
505
|
-
description: string;
|
|
506
|
-
};
|
|
507
|
-
};
|
|
508
|
-
additionalProperties: boolean;
|
|
509
|
-
};
|
|
510
|
-
};
|
|
511
475
|
})[];
|
|
@@ -29,7 +29,6 @@ export interface IGithubRepositoryClaim extends IComponentClaim {
|
|
|
29
29
|
orphan: boolean;
|
|
30
30
|
}[];
|
|
31
31
|
topics?: string[];
|
|
32
|
-
labels?: IComponentClaimLabel[];
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
34
|
}
|
|
@@ -54,10 +53,5 @@ interface IRepositoryPage {
|
|
|
54
53
|
path: string;
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
|
-
interface IComponentClaimLabel {
|
|
58
|
-
name: string;
|
|
59
|
-
color: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
}
|
|
62
56
|
export type IComponentClaimOwnerType = 'user' | 'group';
|
|
63
57
|
export {};
|
|
@@ -24,7 +24,6 @@ declare const _default: {
|
|
|
24
24
|
uploadFile: typeof import("./src/repository").uploadFile;
|
|
25
25
|
deleteFile: typeof import("./src/repository").deleteFile;
|
|
26
26
|
getRepoInfo: typeof import("./src/repository").getRepoInfo;
|
|
27
|
-
repoExists: typeof import("./src/repository").repoExists;
|
|
28
27
|
getPages: typeof import("./src/repository").getPages;
|
|
29
28
|
getBranchProtection: typeof import("./src/repository").getBranchProtection;
|
|
30
29
|
getTeams: typeof import("./src/repository").getTeams;
|
|
@@ -32,7 +31,6 @@ declare const _default: {
|
|
|
32
31
|
getOIDCRepo: typeof import("./src/repository").getOIDCRepo;
|
|
33
32
|
addStatusCheck: typeof import("./src/repository").addStatusCheck;
|
|
34
33
|
addCommitStatus: typeof import("./src/repository").addCommitStatus;
|
|
35
|
-
getRepoIssuesLabels: typeof import("./src/repository").getRepoIssuesLabels;
|
|
36
34
|
};
|
|
37
35
|
team: {
|
|
38
36
|
getTeamMembers: typeof import("./src/team").getTeamMembers;
|
|
@@ -800,7 +800,6 @@ export declare function getRepoInfo(owner: string, name: string): Promise<{
|
|
|
800
800
|
[key: string]: unknown;
|
|
801
801
|
};
|
|
802
802
|
}>;
|
|
803
|
-
export declare function repoExists(owner: string, name: string): Promise<boolean>;
|
|
804
803
|
export declare function getPages(owner: string, name: string): Promise<{
|
|
805
804
|
url: string;
|
|
806
805
|
status: "built" | "building" | "errored";
|
|
@@ -1322,11 +1321,6 @@ export declare function uploadFile(destinationPath: string, filePath: string, re
|
|
|
1322
1321
|
export declare function deleteFile(path: string, repo: string, owner?: string, branch?: string, message?: string): Promise<void>;
|
|
1323
1322
|
export declare function addStatusCheck(output: any, is_failure: boolean, head_sha: string, name: string, status: string, repo: string, owner?: string): Promise<void>;
|
|
1324
1323
|
export declare function addCommitStatus(state: commitStatusState, sha: string, repo: string, owner?: string, target_url?: string, description?: string, context?: string): Promise<void>;
|
|
1325
|
-
export declare function getRepoIssuesLabels(owner: string, repo: string): Promise<{
|
|
1326
|
-
name: string;
|
|
1327
|
-
description: string;
|
|
1328
|
-
color: string;
|
|
1329
|
-
}[]>;
|
|
1330
1324
|
declare const _default: {
|
|
1331
1325
|
listReleases: typeof listReleases;
|
|
1332
1326
|
getReleaseByTag: typeof getReleaseByTag;
|
|
@@ -1335,7 +1329,6 @@ declare const _default: {
|
|
|
1335
1329
|
uploadFile: typeof uploadFile;
|
|
1336
1330
|
deleteFile: typeof deleteFile;
|
|
1337
1331
|
getRepoInfo: typeof getRepoInfo;
|
|
1338
|
-
repoExists: typeof repoExists;
|
|
1339
1332
|
getPages: typeof getPages;
|
|
1340
1333
|
getBranchProtection: typeof getBranchProtection;
|
|
1341
1334
|
getTeams: typeof getTeams;
|
|
@@ -1343,6 +1336,5 @@ declare const _default: {
|
|
|
1343
1336
|
getOIDCRepo: typeof getOIDCRepo;
|
|
1344
1337
|
addStatusCheck: typeof addStatusCheck;
|
|
1345
1338
|
addCommitStatus: typeof addCommitStatus;
|
|
1346
|
-
getRepoIssuesLabels: typeof getRepoIssuesLabels;
|
|
1347
1339
|
};
|
|
1348
1340
|
export default _default;
|
|
@@ -10,13 +10,11 @@ export default class RepoGithubDecanter extends GithubDecanter {
|
|
|
10
10
|
__decantOIDC(): void;
|
|
11
11
|
__decantValidateCodeowners(): void;
|
|
12
12
|
__decantRelations(): void;
|
|
13
|
-
__decantRepoLabels(): Promise<void>;
|
|
14
13
|
__gatherRepoTeamsAndMembers(): Promise<void>;
|
|
15
14
|
__gatherPages(): Promise<void>;
|
|
16
15
|
__gatherOIDCSubjectClaim(): Promise<void>;
|
|
17
16
|
__gatherBranchStrategy(): Promise<void>;
|
|
18
17
|
__gatherCodeowners(): Promise<void>;
|
|
19
|
-
__gatherRepoLabels(): Promise<void>;
|
|
20
18
|
__adaptInitializerBranchStrategies(_claim: any): Promise<BranchStrategiesInitializer>;
|
|
21
19
|
__adaptInitializerBase(_claim: any): Promise<InitializerDefault>;
|
|
22
20
|
__adaptOverriderRepo(_claim: any): Promise<GithubRepositoryOverrider>;
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
$schema: string;
|
|
3
|
-
$id: string;
|
|
4
|
-
definitions: {
|
|
5
|
-
GithubComponentClaimLabel: {
|
|
6
|
-
$id: string;
|
|
7
|
-
type: string;
|
|
8
|
-
required: string[];
|
|
9
|
-
properties: {
|
|
10
|
-
name: {
|
|
11
|
-
type: string;
|
|
12
|
-
minLength: number;
|
|
13
|
-
maxLength: number;
|
|
14
|
-
pattern: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
color: {
|
|
18
|
-
type: string;
|
|
19
|
-
pattern: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
description: {
|
|
23
|
-
type: string;
|
|
24
|
-
maxLength: number;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
additionalProperties: boolean;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InitializerPatches } from './base';
|
|
2
|
-
export declare class ComponentLabelsInitializer extends InitializerPatches {
|
|
3
|
-
applicableProviders: string[];
|
|
4
|
-
static applicableKinds: string[];
|
|
5
|
-
__validate(): Promise<boolean>;
|
|
6
|
-
__patches(_claim: any, _previousCR: any): Promise<{
|
|
7
|
-
validate(cr: any): boolean;
|
|
8
|
-
apply(cr: any): any;
|
|
9
|
-
identify(): string;
|
|
10
|
-
}[]>;
|
|
11
|
-
}
|