Skip to content

Commit 37d2a1b

Browse files
committed
Don't add new features
1 parent 713f48a commit 37d2a1b

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/githubHelper.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as utils from './utils';
44
import { Octokit as GitHubApi, RestEndpointMethodTypes } from '@octokit/rest';
55
import { Endpoints } from '@octokit/types';
66
import GitlabHelper from './gitlabHelper';
7+
import { LabelSchema } from '@gitbeaker/core/dist/types/types';
78

89
type IssuesListForRepoResponseData =
910
Endpoints['GET /repos/{owner}/{repo}/issues']['response']['data'];
@@ -12,7 +13,9 @@ type PullsListResponseData =
1213

1314
const gitHubLocation = 'https://github.com';
1415

15-
export default class GithubHelper {
16+
export type SimpleLabel = Pick<LabelSchema, 'name' | 'color'>;
17+
18+
export class GithubHelper {
1619
githubApi: GitHubApi;
1720
githubUrl: string;
1821
githubOwner: string;
@@ -454,7 +457,7 @@ export default class GithubHelper {
454457
/**
455458
* Create a GitHub label from a GitLab label
456459
*/
457-
async createLabel(label) {
460+
async createLabel(label: SimpleLabel) {
458461
// convert from GitLab to GitHub
459462
let githubLabel = {
460463
owner: this.githubOwner,

src/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import GithubHelper from './githubHelper';
1+
import { GithubHelper, SimpleLabel } from './githubHelper';
22
import GitlabHelper from './gitlabHelper';
33
import settings from '../settings';
44

@@ -10,9 +10,6 @@ import * as fs from 'fs';
1010

1111
import AWS from 'aws-sdk';
1212
import { sleep } from './utils';
13-
import { LabelSchema } from '@gitbeaker/core/dist/types/types';
14-
15-
type Label = Pick<LabelSchema, 'name' | 'color' | 'description'>;
1613

1714
const issueCounters = {
1815
nrOfPlaceholderIssues: 0,
@@ -228,7 +225,9 @@ async function transferLabels(attachmentLabel = true, useLowerCase = true) {
228225
inform('Transferring Labels');
229226

230227
// Get a list of all labels associated with this project
231-
let labels: Label[] = await gitlabApi.Labels.all(settings.gitlab.projectId);
228+
let labels: SimpleLabel[] = await gitlabApi.Labels.all(
229+
settings.gitlab.projectId
230+
);
232231

233232
// get a list of the current label names in the new GitHub repo (likely to be just the defaults)
234233
let githubLabels: string[] = await githubHelper.getAllGithubLabelNames();
@@ -238,16 +237,13 @@ async function transferLabels(attachmentLabel = true, useLowerCase = true) {
238237
const hasAttachmentLabel = {
239238
name: 'has attachment',
240239
color: '#fbca04',
241-
description: 'Issue has attachments which might not have been migrated',
242240
};
243241
labels.push(hasAttachmentLabel);
244242
}
245243

246244
const gitlabMergeRequestLabel = {
247245
name: 'gitlab merge request',
248246
color: '#b36b00',
249-
description:
250-
'An issue replacing a merge request which cannot be migrated because of deleted branches',
251247
};
252248
labels.push(gitlabMergeRequestLabel);
253249

0 commit comments

Comments
 (0)