Skip to content

Commit c4ac447

Browse files
committed
Rename debug to dryRun
fixes piceaTech#136
1 parent 322ab01 commit c4ac447

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ If this is set to true (default) then the migration process will transfer releas
182182
Note that github api for releases is limited and hence this will only transfer the title and description of the releases
183183
and add them to github in chronological order, but it would not preserve the original release dates, nor transfer artefacts or assets.
184184

185-
### debug
185+
### dryRun
186186

187187
As default it is set to false. Doesn't fire the requests to github api and only does the work on the gitlab side to test for wonky cases before using up api-calls
188188

sample_settings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export default {
44
gitlab: {
55
// url: 'https://gitlab.mycompany.com',
66
token: '{{gitlab private token}}',
7-
projectId: null,
7+
projectId: 0,
88
listArchivedProjects: true,
9-
sessionCookie: null,
9+
sessionCookie: "",
1010
},
1111
github: {
1212
// baseUrl: 'https://github.mycompany.com:123/etc',
@@ -42,13 +42,13 @@ export default {
4242
mergeRequests: true,
4343
releases: true,
4444
},
45-
debug: false,
45+
dryRun: false,
4646
useIssueImportAPI: true,
4747
usePlaceholderMilestonesForMissingMilestones: true,
4848
usePlaceholderIssuesForMissingIssues: true,
4949
useReplacementIssuesForCreationFails: true,
5050
useIssuesForAllMergeRequests: false,
51-
filterByLabel: null,
51+
filterByLabel: undefined,
5252
trimOversizedLabelDescriptions: false,
5353
skipMergeRequestStates: [],
5454
skipMatchingComments: [],

src/githubHelper.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export class GithubHelper {
353353

354354
await utils.sleep(this.delayInMs);
355355

356-
if (settings.debug) return Promise.resolve({ data: issue });
356+
if (settings.dryRun) return Promise.resolve({ data: issue });
357357

358358
return this.githubApi.issues.create(props);
359359
}
@@ -454,7 +454,7 @@ export class GithubHelper {
454454
props.milestone = this.convertMilestone(issue);
455455
props.labels = this.convertLabels(issue);
456456

457-
if (settings.debug) return Promise.resolve({ data: issue });
457+
if (settings.dryRun) return Promise.resolve({ data: issue });
458458

459459
//
460460
// Issue comments
@@ -676,7 +676,7 @@ export class GithubHelper {
676676

677677
await utils.sleep(this.delayInMs);
678678

679-
if (settings.debug) return true;
679+
if (settings.dryRun) return true;
680680

681681
await this.githubApi.issues
682682
.createComment({
@@ -711,7 +711,7 @@ export class GithubHelper {
711711

712712
await utils.sleep(this.delayInMs);
713713

714-
if (settings.debug) return Promise.resolve();
714+
if (settings.dryRun) return Promise.resolve();
715715

716716
return await this.githubApi.issues.update(props);
717717
}
@@ -746,7 +746,7 @@ export class GithubHelper {
746746

747747
await utils.sleep(this.delayInMs);
748748

749-
if (settings.debug) return Promise.resolve({ number: -1, title: 'DEBUG' });
749+
if (settings.dryRun) return Promise.resolve({ number: -1, title: 'DEBUG' });
750750

751751
const created = await this.githubApi.issues.createMilestone(
752752
githubMilestone
@@ -772,7 +772,7 @@ export class GithubHelper {
772772

773773
await utils.sleep(this.delayInMs);
774774

775-
if (settings.debug) return Promise.resolve();
775+
if (settings.dryRun) return Promise.resolve();
776776
// create the GitHub label
777777
return await this.githubApi.issues.createLabel(githubLabel);
778778
}
@@ -870,7 +870,7 @@ export class GithubHelper {
870870
}
871871
}
872872

873-
if (settings.debug) return Promise.resolve({ data: mergeRequest });
873+
if (settings.dryRun) return Promise.resolve({ data: mergeRequest });
874874

875875
if (canCreate) {
876876
let bodyConverted = await this.convertIssuesAndComments(
@@ -1055,7 +1055,7 @@ export class GithubHelper {
10551055
if (
10561056
mergeRequest.state === 'merged' &&
10571057
pullRequest.state !== 'closed' &&
1058-
!settings.debug
1058+
!settings.dryRun
10591059
) {
10601060
// Merging the pull request adds new commits to the tree; to avoid that, just close the merge requests
10611061
mergeRequest.state = 'closed';
@@ -1074,7 +1074,7 @@ export class GithubHelper {
10741074

10751075
await utils.sleep(this.delayInMs);
10761076

1077-
if (settings.debug) {
1077+
if (settings.dryRun) {
10781078
return Promise.resolve();
10791079
}
10801080

src/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default interface Settings {
2-
debug: boolean;
2+
dryRun: boolean;
33
gitlab: GitlabSettings;
44
github: GithubSettings;
55
usermap: {

0 commit comments

Comments
 (0)