Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Existing bucket, with an appropriate security policy. One possible policy is to

#### transfer.milestones

If this is set to true (default) then the migration process will transfer milestones.
If this is set to true (default) then the migration process will transfer milestones.

#### transfer.labels

Expand Down Expand Up @@ -123,6 +123,10 @@ It would of course be better to find the cause for migration fails, so that no r
If this is set to true (default is false) then all merge requests will be migrated as GitHub issues (rather than pull requests). This can be
used to sidestep the problem where pull requests are rejected by GitHub if the feature branch no longer exists or has been merged.

#### filterByLabel

Filters all merge requests and issues by these labels. The applicable values can be found in the Gitlab API documentation for [issues](https://docs.gitlab.com/ee/api/issues.html#list-project-issues) and [merge requests](https://docs.gitlab.com/ee/api/merge_requests.html#list-merge-requests) respectively. Default is `null` which returns all issues/merge requests.

#### skipMatchingComments

This is an array (empty per default) that may contain string values. Any note/comment in any issue, that contains one or more of those string values, will be skipped (meaining not migrated). Note that this is case insensitive, therefore the string value `foo` would also lead to skipping notes containing a (sub)string `FOO`.
Expand Down
1 change: 1 addition & 0 deletions sample_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
usePlaceholderIssuesForMissingIssues: true,
useReplacementIssuesForCreationFails: true,
useIssuesForAllMergeRequests: false,
filterByLabel: null,
skipMatchingComments: [],
mergeRequests: {
logFile: './merge-requests.json',
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ async function transferIssues() {
// TODO return all issues via pagination
let issues = await gitlabApi.Issues.all({
projectId: settings.gitlab.projectId,
labels: settings.filterByLabel,
}) as any[];

// sort issues in ascending order of their issue number (by iid)
Expand Down Expand Up @@ -375,6 +376,7 @@ async function transferMergeRequests() {
// this project
let mergeRequests = await gitlabApi.MergeRequests.all({
projectId: settings.gitlab.projectId,
labels: settings.filterByLabel,
}) as any;

// Sort merge requests in ascending order of their number (by iid)
Expand Down Expand Up @@ -457,6 +459,7 @@ async function logMergeRequests(logFile) {
// TODO return all MRs via pagination
let mergeRequests = await gitlabApi.MergeRequests.all({
projectId: settings.gitlab.projectId,
labels: settings.filterByLabel,
}) as any;

// sort MRs in ascending order of when they were created (by id)
Expand Down
1 change: 1 addition & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default interface Settings {
usePlaceholderIssuesForMissingIssues: boolean;
useReplacementIssuesForCreationFails: boolean;
useIssuesForAllMergeRequests: boolean;
filterByLabel: string | null;
skipMatchingComments: string[];
mergeRequests: {
logFile: string;
Expand Down