Repository navigation
feat(cli): Add junior conversations list - #2234
Open
sentry-junior[bot] wants to merge 1 commit into
Open
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Print one JSON line for each active root Conversation of the token owner, with id, title, dashboard url, and Slack url. The command follows nextCursor from GET /api/conversations until no pages remain. Move the API URL and fetch helpers from briefs.ts to cli/api-client.ts, and optionValue to cli/run.ts, so both token-only commands share them. Refs #2231 Co-Authored-By: Johannes Daxboeck <114897+dingsdax@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2 of #2231. Stacked on #2232, which adds the list cursor. Merge #2232 first.
junior conversations listprints one JSON line for each active root Conversation of the token owner:{"id":"slack:C123:1700000000.000100","title":"Deploy question","url":"https://junior.example.com/conversations/slack%3AC123%3A1700000000.000100","slackUrl":"https://example.slack.com/archives/C123/p1700000000000100"}nextCursorfromGET /api/conversationsuntil no pages remain.urlis the dashboard route. The CLI builds it from--base-urlwith the same encoding asconversationPath()in the dashboard. It keeps a base path, like the API URLs do.slackUrlislocationUrl, ornullwhen there is no Slack thread.--tokenfalls back toJUNIOR_API_TOKEN. Likebriefs, the command skips app plugin loading, so it needs only a token.apiUrlandfetchJsonmove frombriefs.tstocli/api-client.ts, andoptionValuemoves tocli/run.ts. Both token-only commands now use the same helpers.cli/conversations.md, added to the CLI sidebar.Notes for review:
lastActivityAtonly moves forward, so a changed row moves above the cursor). So the CLI does not dedupe.dashboardUrl. I did not add it. The CLI builds the link from--base-url, which is also the base for the API calls.Tests:
tests/component/conversations-cli.test.tsruns the command against the real API (createJuniorApi()) and SQL, with 51 conversations, so it must follow one cursor. It checks the JSONL fields and the Slack link, and the usage error. I checked that the test fails when the command does not follownextCursor.pnpm lint, typecheck, and the docs build pass.via @dingsdax.
--
View Junior Session [Sentry]