Skip to content

Setting assignee who is not part of the organization fails #217

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

Open
mschoettle opened this issue Jan 27, 2025 · 3 comments
Open

Setting assignee who is not part of the organization fails #217

mschoettle opened this issue Jan 27, 2025 · 3 comments

Comments

@mschoettle
Copy link
Contributor

When migrating merge requests/issues where the assignee is not part of the organization (anymore), updating the issue/PR fails with a validation error.

I propose to retrieve the current members of the organization at some point once at the beginning (let me know where the best place would be). Then in convertAssignees an additional check can ensure that the assignee still exists as a member.

As an optional step could be to add the assignee to the issue body to have this still recorded.

An open issue is that if the owner is not an organization (but a regular user), is there an API with which members can be retrieved?

@NetSysFire
Copy link

I can confirm this. In my case, the issue was not created at all despite everything else being correct. Furthermore, all other issues with assignees did not have their assignees set at all but this might be a different issue.

Migrating issue #124 ('Quit messages')...
	Migrating issue comments...
	...Done creating comments (migrated 1 comments, skipped 2 comments)
	FAILED:
{
  status: 200,
  url: 'https://api.github.com/repos/sourceofmana/sourceofmana/import/issues/11791062',
  headers: {
    'access-control-allow-origin': '*',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
    'cache-control': 'private, max-age=60, s-maxage=60',
    connection: 'close',
    'content-encoding': 'gzip',
    'content-security-policy': "default-src 'none'",
    'content-type': 'application/json; charset=utf-8',
    date: 'Tue, 01 Apr 2025 23:15:35 GMT',
    etag: 'W/"3f7bc19bef4448f70bbe858dad0bb63597095ec03095cc3f2a513a4d13be4700"',
    'github-authentication-token-expiration': '2025-05-01 21:25:21 UTC',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    server: 'github.com',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    'transfer-encoding': 'chunked',
    vary: 'Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With',
    'x-accepted-oauth-scopes': '',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'deny',
    'x-github-api-version-selected': '2022-11-28',
    'x-github-media-type': 'github.v3; param=golden-comet-preview; format=json',
    'x-github-request-id': 'D02C:79E7C:2FF95EC:3140004:67EC7397',
    'x-oauth-scopes': 'repo',
    'x-ratelimit-limit': '5000',
    'x-ratelimit-remaining': '4717',
    'x-ratelimit-reset': '1743552437',
    'x-ratelimit-resource': 'core',
    'x-ratelimit-used': '283',
    'x-xss-protection': '0'
  },
  data: {
    id: 11791062,
    status: 'failed',
    url: 'https://api.github.com/repos/sourceofmana/sourceofmana/import/issues/11791062',
    import_issues_url: 'https://api.github.com/repos/sourceofmana/sourceofmana/import/issues',
    repository_url: 'https://api.github.com/repos/sourceofmana/sourceofmana',
    created_at: '2025-04-02T01:15:32.000+02:00',
    updated_at: '2025-04-02T01:15:33.000+02:00',
    errors: [ [Object] ]
  }
}
	ERRORS:
[
  {
    location: '/issue/assignee',
    resource: 'Issue',
    field: 'assignee',
    value: '<correct user who has not accepted the invite just yet>',
    code: 'invalid'
  }
]
	...DONE migrating issue #124.

@mschoettle
Copy link
Contributor Author

I fixed this in my fork for organizations but have no solution for regular users: mschoettle@0888ad4

@spruce
Copy link
Member

spruce commented Jun 5, 2025

@mschoettle Do you wann create a PR with the change mentioned with some code around it making sure it is an org. Then maybe logging the validation error with more explanation?

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

No branches or pull requests

3 participants