The code from #51660 doesn't work for org-level projects. The problem seems to be that the token it is using does not have permission to post on the project.
Example error here: https://teamcity.cockroachdb.com/viewLog.html?buildId=2177056&tab=buildLog&_focus=3498
failed to post issue: failed to add GitHub issue roachtest: django failed to project column 8532151: POST https://api.github.com/projects/columns/8532151/cards: 403 Must have admin rights to Repository. []
When I try locally with my own token that has this permission, it works:
โฏ curl -X POST -u rafiss:*token* -H "Accept: application/vnd.github.inertia-preview+json" https://api.github.com/projects/columns/7259065/cards -d '{"content_id": 678288445, "content_type": "Issue"}'
I'm not sure where this token is defined. I couldn't find it in the list of env vars here: https://teamcity.cockroachdb.com/admin/editBuildParams.html?id=buildType:Cockroach_Nightlies_WorkloadNightly
I've set a new access token for this. It is set in https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Cockroach_Nightlies&tab=projectParams as the env.GITHUB_API_TOKEN parameter. The permission on the access token is repo and it has the ability to perform the example call you gave in the description.
I don't know what permissions were given on the old token. I know it was from the teamcity-cockroach user. I expect the permissions were less than the new permission level for the token, so it is likely to work without any problems. If any do happen, please follow up with me and I'll update with the necessary permissions.
Leaving open in case you want to verify it works before closing.
Confirmed that the card gets added to the AppDev board now. thanks!
Most helpful comment
Confirmed that the card gets added to the AppDev board now. thanks!