Skip to content

Fixes and documentation updates needed while using this tool - #34

Open
npahucki wants to merge 2 commits into
nverges:mainfrom
npahucki:main
Open

Fixes and documentation updates needed while using this tool#34
npahucki wants to merge 2 commits into
nverges:mainfrom
npahucki:main

Conversation

@npahucki

@npahucki npahucki commented Apr 21, 2025

Copy link
Copy Markdown

I ran into several issues while importing using the tool as it was:

  1. It failed to run on anything other than node >= 20 - I noted this in the README.
  2. The error logging was not working correctly, you'd get an error message, but no reason as the error param was not accepted by the error logging function.
  3. Comments were all created with the import date instead of the date on exported comment. I tried to also set the commenter name, but this seems to require a different way of authentication (OAuth).
  4. Don't exit when files fail to upload - this is normal if you are using a free workspace and files are over 10MB - just skip and log error for resolution later. (Perhaps an option for exiting vs. continuing on file upload errors).
  5. Rejected and Delivered issues are not imported - I noted this in the README.

Comment thread logger/detailed_logger.js

error(message) {
console.error(chalk.red(`❌ ${message}`));
error(message, error) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error parameter is being passed in calls, but was not used here, so the reason for the error was lost.

Comment thread src/files/import.js
file = new Blob([file], { type: file.type });
}
// console.log(chalk.yellow("Created Blob from file object"));
} catch (e) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let this error bubble up.

Comment thread src/files/upload.js
);
} catch (error) {
detailedLogger.error("Error uploading file:", error.message);
process.exit(0);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exited (with the incorrect code at that) when a file was too big to upload to a free workspace - this stopped the import which is not desired.

const [fullMatch, userName, dateString] = body.match(/ \((.+) - (.+, [0-9]{4})\)$/) || [];
const createdAt = dateString ? new Date(dateString).toISOString() : undefined;
const createAsUser = userMapping[userName]?.linearName || userName;
if (createdAt && createAsUser) body = `${createAsUser} wrote:\n\n${body.slice(0, body.indexOf(fullMatch))}`;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we can't (easily) specify the user who made the comment, putting the mapped user who wrote the comment at the top makes it clear who made the comment vs how Pivotal has it at the bottom using the Pivotal user name which may not be the same as the Linear use name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant