Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

feat: add pagination to alerts and messages endpoints#1186

Closed
yrobla wants to merge 9 commits into
mainstacklok/codegate:mainfrom
issue-1020stacklok/codegate:issue-1020Copy head branch name to clipboard
Closed

feat: add pagination to alerts and messages endpoints#1186
yrobla wants to merge 9 commits into
mainstacklok/codegate:mainfrom
issue-1020stacklok/codegate:issue-1020Copy head branch name to clipboard

Conversation

@yrobla

@yrobla yrobla commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

Modify the API to add pagination to those endpoints, to be able to render faster in the browser

Closes: #1020

@yrobla yrobla marked this pull request as draft March 3, 2025 10:29
Modify the API to add pagination to those endpoints, to be able
to render faster in the browser

Closes: #1020
@yrobla yrobla marked this pull request as ready for review March 3, 2025 16:00
peppescg
peppescg previously approved these changes Mar 3, 2025

@peppescg peppescg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚢

Comment thread src/codegate/api/v1.py Outdated
@alex-mcgovern

Copy link
Copy Markdown
Contributor

Copying this from Slack, so it doesn't get buried in discussion.

In early testing, we all saw crashed in the frontend — our Table implementation expects that chat_id on each object in the list of messages is unique — I am seeing some duplication in the response, e.g.

curl -s "http://localhost:8989/api/v1/workspaces/default/messages?page=1&page_size=50" | jq -r '.data | map(.chat_id)'
[
  "5c7d8bc9-716d-4106-aafc-890564cb212f", # dup #1
  "cf50f1e5-4064-42e5-bf26-15249dc78e46",
  "0fdd2a27-821a-427f-8bf6-cca39bfde838",
  "5ac437ff-6b1c-4aa4-b276-d43bce33f28e",
  "aa85b6a5-423a-4cd0-a27f-51088b5fe30c",
  "aadeadbb-43e0-4c20-9565-f0e5599596c7", # dup #2
  "00916b98-a3d3-424d-8e1f-d24da8c51afc",
  "3fae75e6-e32b-4d24-9856-f0b0cc88785e",
  "5c7d8bc9-716d-4106-aafc-890564cb212f", # dup #1
  "f397d262-07f6-4724-ac94-f0d45a09eb01",
  "9aa71a60-ab7f-4d76-b9a3-13ec25d65661",
  "aadeadbb-43e0-4c20-9565-f0e5599596c7", # dup #2
  "131a028d-9e00-4565-8796-40cef7cd3b83",
  "88a40a5f-dd98-46eb-bf53-7422853629c0"
]

* feat: filter messages by ID

* lint fix

* fix: use `.bindparams` for `filter_by_ids`
@yrobla

yrobla commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

closed in favor of @alex-mcgovern PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pagination to endpoints that read entire tables (alerts/messages)

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.