Closed slimslenderslacks closed 4 years ago
@slimslenderslacks This skill uses the repo.org.chatTeam.id
field to pass into the various mutations as teamId
.
Here's the payload of the relevant skill invocation:
{
"data": {
"Push": [
{
"commits": [
{
"committer": {
"login": "slimslenderslacks",
"person": {
"chatId": {
"screenName": "Jim Clark",
"userId": "2****************************************************************************************Q"
}
}
}
}
],
"repo": {
"channels": [],
"name": "blah",
"org": {
"chatTeam": {
"id": "19:1cbbd0651ae34f84a634dde276b69f63@thread.tacv2"
},
"provider": {
"providerId": "4213884e-29a1-4e1b-a01f-356af2656b7d"
}
},
"owner": "slimslender",
"url": "h*********************************h"
}
}
]
},
"extensions": {
"operationName": "PushToUnmappedRepo",
"query_id": "cc7233a1-8d15-41ed-96ec-c17cb6dde395",
"team_id": "A3P0OHOOZ",
"team_name": "msteams",
"correlation_id": "42bd4b78-cf7c-4c8e-ab1c-886159dcc9cc.1asiP7dQF03QtVHYSIwG8",
"log_url": "h*********************************************************************************************8"
},
"secrets": [
{
"uri": "atomist://api-key",
"value": "e********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************g"
}
],
"skill": {
"id": "78a7cd1c-57ef-4da2-a5be-50de771755c2",
"name": "auto-link-channel-skill",
"version": "0.1.5",
"platform": "gcf",
"artifacts": [
{
"url": "g***********************************************************************************************************************************p",
"name": "gcf",
"memory": 512,
"runtime": "nodejs12",
"timeout": 60,
"__typename": "AtomistSkillGCFArtifact",
"entryPoint": "entryPoint"
}
],
"namespace": "atomist",
"configuration": {
"repository": {
"commitSha": "c93864452e6cb9a7fb1305e9071b3670847fdf45"
},
"instances": [
{
"name": "auto-link_chat_channels",
"signals": null,
"parameters": [
{
"name": "invite",
"value": false
},
{
"name": "ignore",
"value": []
},
{
"name": "repos",
"value": {
"excludes": null,
"includes": null
}
}
],
"displayName": "Auto-Link Chat Channels",
"resourceProviders": [
{
"name": "github",
"typeName": "GitHubAppResourceProvider",
"selectedResourceProviders": [
{
"id": "A3P0OHOOZ_4213884e-29a1-4e1b-a01f-356af2656b7d"
}
]
},
{
"name": "chat",
"typeName": "ChatProvider",
"selectedResourceProviders": [
{
"id": "4b1c0af7-a444-490d-8ca9-346c7d7d6d7e"
}
]
}
]
}
]
},
"dispatchStyle": "multiple"
}
}
As you can see repo.org.chatTeam.id
is 19:1cbbd0651ae34f84a634dde276b69f63@thread.tacv2
which apparently is not a correct chatTeam id per the error message.
Here's the mutation call that fails:
{"query":"mutation addBotToChannel($teamId: String!, $channelId: String!) { addBotToSlackChannel(chatTeamId: $teamId, channelId: $channelId) { id }}","variables":{"teamId":"19:1cbbd0651ae34f84a634dde276b69f63@thread.tacv2","channelId":"19:6e32a7987f70425bb1886236b96b79de@thread.tacv2"}}
Also the same chatTeamId worked fine in a previous mutation call:
{"query":"mutation createChannel($teamId: String!, $name: String!) { createSlackChannel(chatTeamId: $teamId, name: $name) { id }}","variables":{"teamId":"19:1cbbd0651ae34f84a634dde276b69f63@thread.tacv2","name":"blah"}}
I don't think this is a skill issue and I'm inclined to close this here.
@dansmithy maybe you can help with requirements on this. I think addBotToChannel
is either not meant to be called for MSTeams (because the bot is always in the channel), or the mutation itself should no-op when MSTeams is called.
I think we got actually created the channel correctly but the skill was marked as having failed because of the above. I'm not sure. If we decide that addBotToChannel should not fail for MSTeams then we should close this issue and open another one. But at the moment, the skill looks like it fails for MSTeams.
As far as I can tell, the channel linking for MSTeams was actually working - it's just that it looked like it wasn't working because of the failure and because the github notifications skill had to be deleted and re-enabled on this team.
Yeah, it certainly failed because the mutation failure and also did not invite committers to the newly created channel.
@slimslenderslacks I've put a hack in that checks if the team is slack and only then calls the failing mutation. Using the unstable version of this skill should let you re-test this.
Actually, one amendment to the above is that the channel was being created but not linked - I had to link it manually. But let me flip this over to unstable, and see if it gets linked.
Actually, one amendment to the above is that the channel was being created but not linked - I had to link it manually. But let me flip this over to unstable, and see if it gets linked.
Yes, I know it didn't link because linking comes after inviting the bot.
Moving on to version 0.1.6-6 is a big improvement in the flow. Channel is linked, and the skill completes successfully
@cdupuis I've asked @dansmithy to talk to you about possibly having a mutation that no-ops for MS Teams.
When we create a new repo on a team with MSTeams, the skill successfully creates the channel but can not link it. It could be that the skill only supports Slack teams today.