-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avatar_url error on npm run createComments #9
Comments
Looking in the pull-comments.json, it is when the user is defined as null:
|
@krtx1 Sorry about that. I'm open to pull requests. It looks like there needs to be special handling when I am curious though, what does it mean to have a comment that wasn't made by a user? Maybe the user is deleted? This wasn't a use-case I anticipated. |
@NicholasBoll thanks for the reply. If will open a PR if I dig through the code and understand the fix well enough. One thing that I forgot to mention is that on the specific repository that I was testing this on, it had an LDAP integration, and while the user existed on the comment, the comment was made by an internal user (on GitHub's internal managed DB of users) before the LDAP integration was switched on. And my assumption is that when it was interacting with the GitHub API, when it tried to look up the user is got nothing back from LDAP, hence the null, and also over the fact that the auth is LDAP, it cannot just override that and go, first lookup internal users, then LDAP (or vice versa); the auth is the auth, single place to lookup, however I don't know the GitHub API well enough to confirm if it is possible to query LDAP and then internal users, etc. So my fix was just to edit the pull-comments.json manually and search and replace the
|
Heya :)
Have a specific issue on avatar_url on createComments:
[root@ip-10-202-197-7 github-migration]# npm run createComments
migrate-github@1.0.0 createComments /opt/github-migration
node ./createComments.js
Comments to process: 96
ETA: 02m 52s
Comment 18 already processed
ETA: 02m 51s
Adding comment 10 to https://api.github.com/repos/dummy_test/pulls/1/comments
TypeError: Cannot read property 'avatar_url' of null
at createMessage (/opt/github-migration/createMessage.js:44:35)
at createPullRequestComment (/opt/github-migration/createComments.js:158:18)
at async createComment (/opt/github-migration/createComments.js:90:5)
at async main (/opt/github-migration/createComments.js:289:5)
The avatarUrl on the destination is the default:
avatarUrl: 'https://avatars0.githubusercontent.com/u/{id}?s=40&v=4',
How can I debug this further?
The text was updated successfully, but these errors were encountered: