Skip to content
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

refactor and rename TeamsInfo #2648

Merged
merged 6 commits into from
Oct 3, 2019
Merged

refactor and rename TeamsInfo #2648

merged 6 commits into from
Oct 3, 2019

Conversation

johnataylor
Copy link
Member

No description provided.

@johnataylor johnataylor requested review from 035 and stevengum and removed request for 035 October 2, 2019 18:53
@coveralls
Copy link
Collaborator

coveralls commented Oct 2, 2019

Pull Request Test Coverage Report for Build 81615

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 31 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 78.296%

Files with Coverage Reduction New Missed Lines %
/libraries/Microsoft.Bot.Builder/Teams/TeamsActivityHandler.cs 31 77.78%
Totals Coverage Status
Change from base Build 81370: 0.2%
Covered Lines: 4787
Relevant Lines: 6114

💛 - Coveralls

@fuselabs
Copy link
Collaborator

fuselabs commented Oct 2, 2019

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

private ITeamsConnectorClient _teamsConnectorClient;
private TeamsChannelData _teamsChannelData;

public TeamsInfo(string conversationId, ConnectorClient connectorClient, TeamsChannelData teamsChannelData)
Copy link
Member Author

Choose a reason for hiding this comment

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

this might not be right - probably better to pass in teamId rather than TeamChannelData...

TeamsInfo = new TeamsInfo(
turnContext.Activity?.Conversation?.Id,
(ConnectorClient)turnContext.TurnState.Get<IConnectorClient>(),
turnContext.Activity.GetChannelData<TeamsChannelData>());
Copy link
Member Author

Choose a reason for hiding this comment

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

better to say...
turnContext.Activity.GetChannelData()?.Team?.Id

i think we only need teamId

@@ -79,10 +34,10 @@ public override async Task OnTurnAsync(ITurnContext turnContext, CancellationTok
throw new ArgumentException($"{nameof(turnContext)}.Activity must have non-null Type.");
}

if (turnContext.Activity.ChannelId == Channels.Msteams)
Copy link
Member

Choose a reason for hiding this comment

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

Should we be creating this object if the ChannelId is not Msteams?

Copy link
Member Author

Choose a reason for hiding this comment

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

the real dependency on having a teamId so I softened the check

@fuselabs
Copy link
Collaborator

fuselabs commented Oct 2, 2019

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

{
_connectorClient = connectorClient;
_teamsConnectorClient = new TeamsConnectorClient(connectorClient.BaseUri, connectorClient.Credentials, connectorClient.HttpClient);
}
Copy link
Member

Choose a reason for hiding this comment

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

Is there an else for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

no this can be null - if it is then the methods throw later

@fuselabs
Copy link
Collaborator

fuselabs commented Oct 3, 2019

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

@fuselabs
Copy link
Collaborator

fuselabs commented Oct 3, 2019

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

Copy link
Member

@stevengum stevengum left a comment

Choose a reason for hiding this comment

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

This PR looks good, but I noticed some weirdness so you need to revisit TeamsOperationsExtensions.

Comment on lines +27 to +28
var channelList = await GetTeamsConnectorClient(turnContext).Teams.FetchChannelListAsync(teamId, cancellationToken).ConfigureAwait(false);
return channelList.Conversations;
Copy link
Member

Choose a reason for hiding this comment

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

Seems silly that it returns a class with one property... I supposed the ConversationList class could be considered extensible.

That said, I think you need to rename the extension method.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the Teams generated code from the swagger. The naming is slightly confusing but its pretty buried here.

@stevengum
Copy link
Member

It's optional on revisiting the extension method mentioned in my review, but if Teams decides to add more data to the ConversationList schema in the swagger file, that method name won't make sense. (It makes partial sense right now)

@johnataylor johnataylor merged commit 3b05ba3 into master Oct 3, 2019
@johnataylor johnataylor deleted the johtaylo/teaminfo branch October 3, 2019 18:34
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.

None yet

5 participants