Skip to content

Use unknow type for labels#28

Merged
zhenghaoz merged 3 commits intomasterfrom
any
Nov 24, 2025
Merged

Use unknow type for labels#28
zhenghaoz merged 3 commits intomasterfrom
any

Conversation

@zhenghaoz
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the gorsejs SDK to use the unknown type for user and item labels instead of string[], removes the Redis dependency from tests, and updates the test suite to work with an actual Gorse server instance. The change makes the labels field more flexible to accommodate various data structures like objects with arbitrary properties.

Key changes:

  • Changed Labels type from string[] to unknown in User and Item interfaces to support flexible label structures
  • Removed Redis dependency and related test infrastructure (redis client, docker-compose.yml, config.toml)
  • Updated tests to use actual Gorse server data instead of mocked Redis responses
  • Added Value and Comment fields to Feedback interface, introduced ItemPatch interface, and renamed LatestOutput to Score

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/interfaces.ts Changed Labels type from string[] to unknown for flexible label data; added Score, ItemPatch interfaces and Value field to Feedback
src/model/item.ts Updated updateItem to use ItemPatch type; fixed getItemNeighbors return type; added trailing commas
src/model/feedback.ts Updated deleteFeedback return type to Success; added trailing commas for consistency
src/model/recommend.ts Renamed LatestOutput to Score interface; added trailing commas
src/model/user.ts Added trailing commas for code style consistency
src/client.ts Updated updateItem signature to accept ItemPatch instead of Item; added trailing commas
tests/gorse.test.ts Removed Redis mock setup; updated tests to use actual Gorse server with real data expectations
package.json Bumped version to 0.5.0; removed redis dependency
yarn.lock Removed redis and related package entries; reorganized some package definitions
README.md Updated usage examples to reflect new Label structure and added Value/Comment fields to feedback
CONTRIBUTING.md Updated setup instructions to use curl script instead of docker-compose
.github/workflows/ci.yml Simplified CI setup to use setup script instead of docker-compose
docker-compose.yml Removed file (no longer needed for testing)
config.toml Removed file (no longer needed for testing)
.devcontainer/devcontainer.json Added dev container configuration for development environment
.devcontainer/Dockerfile Added dev container Dockerfile

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/gorse.test.ts Outdated
Comment thread tests/gorse.test.ts Outdated
Comment thread tests/gorse.test.ts Outdated
Comment thread src/interfaces.ts
Comment thread src/model/item.ts Outdated
zhenghaoz and others added 2 commits November 24, 2025 21:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zhenghaoz zhenghaoz merged commit ffd94de into master Nov 24, 2025
1 check passed
@zhenghaoz zhenghaoz deleted the any branch November 24, 2025 13:44
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.

2 participants