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

Added optional FeatureSet parameter to eligibility interface #2623

Merged
merged 16 commits into from
Dec 3, 2024

Conversation

lakhveerk
Copy link
Contributor

@lakhveerk lakhveerk commented Nov 15, 2024

For more information about how to contribute to this repo, visit this page.

Description

Added optional parameter featureSet to the AppEligibilityInformation interface.

If this Pull Request should close/resolve any issues when merged, use the special syntax for that here.

Main changes in the PR:

  1. <Change 1>
  2. <Change 2>

Validation

Validation performed:

  1. <Step 1>
  2. <Step 2>

Unit Tests added:

Unit tests are required for all changes. If no unit tests were added as part of this change, please explain why they aren't necessary.

<Yes/No>

End-to-end tests added:

<Yes/No>

Additional Requirements

Change file added:

Ensure the change file meets the formatting requirements.

<Yes/No>

Related PRs:

Remove this section if n/a

Next/remaining steps:

List the next or remaining steps in implementing the overall feature in subsequent PRs (or is the feature 100% complete after this?).

Remove this section if n/a

  • Item 1
  • Item 2

Screenshots:

Remove this section if n/a

Before After
< image1 > < image2 >

@lakhveerk lakhveerk marked this pull request as ready for review November 19, 2024 00:11
@lakhveerk lakhveerk requested a review from a team as a code owner November 19, 2024 00:11
Comment on lines 1166 to 1170
uxFeatures: string[];
/**
* Server Feature set
*/
serverFeatures: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider alphabetizing? (This would apply to host sdk changes as well)

@@ -319,6 +338,28 @@ describe('copilot', () => {

await expect(promise).rejects.toThrowError('Error deserializing eligibility information');
});

it('getEligibilityInfo should throw if AppEligibilityInformation.featureSet.serverFeatures or uxFeatures is undefined', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest adding two separate unit tests, one for serverFeatures and one for uxFeatures being undefined so it's clearer if there was a failure, one which caused it.

@lakhveerk lakhveerk requested a review from erinha November 19, 2024 19:21
erinha
erinha previously approved these changes Nov 20, 2024
/**
* UX Feature set
*/
uxFeatures: string[];
Copy link
Contributor

@AE-MS AE-MS Nov 22, 2024

Choose a reason for hiding this comment

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

Should these be declared as ReadonlyArray<string> to ensure they aren't accidentally changed and to express the semantic that they're an "input only" property (e.g. they are immutable properties from the host)? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ReadonlyArray makes sense. Updated the code

/**
* Feature Sets
*/
featureSet?: FeatureSet;
Copy link
Contributor

@AE-MS AE-MS Nov 22, 2024

Choose a reason for hiding this comment

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

?

What would be the semantic difference between having this property be undefined vs defined but with two empty array properties?

I'm guessing the answer is something like "this has to have the ? because older version of the host won't know to send this property so it will show up as undefined then." If that's true, then consider adding documentation for the property that says:
"If this property is undefined, it indicates that the host is an older version that doesn't support this property." #Closed

Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is it's the latter, so I think adding a comment is the way to go here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep it is for back compatibility. Added the comment!

Copy link
Contributor

@AE-MS AE-MS left a comment

Choose a reason for hiding this comment

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

🕐

@lakhveerk lakhveerk requested a review from AE-MS December 2, 2024 18:21
Copy link
Contributor

@AE-MS AE-MS left a comment

Choose a reason for hiding this comment

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

:shipit:

@lakhveerk lakhveerk enabled auto-merge (squash) December 2, 2024 19:36
@lakhveerk lakhveerk requested a review from erinha December 2, 2024 22:24
@lakhveerk lakhveerk merged commit a51cd2b into main Dec 3, 2024
39 checks passed
@lakhveerk lakhveerk deleted the lakhveer/eligibility branch December 3, 2024 17:59
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.

3 participants