GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: expose per-ref diff statuses by DanielleMaywood · Pull Request #29082 · coder/coder Conversation
|
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 10e9ca4d69
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
4c58154 to
e81202d
Compare
5344c6c to
fdbbdf2
Compare
543e51e to
d0e4266
Compare
|
Re the documentation check: we will not add This reply was generated by Coder Agents. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2ae28cc to
e50e145
Compare
e50e145 to
6f60ed0
Compare
6f60ed0 to
19afa16
Compare
7c4c61b to
8795d37
Compare
8795d37 to
0e4de64
Compare
0e4de64 to
a9226da
Compare
a9226da to
ef531c0
Compare
|
|
||
| var sdkStatus *codersdk.ChatDiffStatus | ||
| var changed *codersdk.ChatDiffStatus | ||
| var primarySDK *codersdk.ChatDiffStatus |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could drop "SDK" here? It's a bit confusing, considering changed doesn't have it, etc.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Dropped it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| if (selector.RemoteOrigin == "") != (selector.GitBranch == "") { | ||
| httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ | ||
| Message: "The origin and branch query parameters must be set together.", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Set together, or omitted.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Updated it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One design question here and two points inline, all about how diff_statuses is ordered. I only looked at ordering; didn't review tests or the rest of the diff.
The primary is the last ref the git credential helper reported, so it moves on every authenticated git operation in a different branch. An agent pushing a stack (push A, push B, push A) flips diff_status and reorders diff_statuses three times. A git fetch on main, or from a detached HEAD (branch "HEAD"), becomes the primary. Is "last git operation wins" the intended policy?
🤖 This review was automatically generated with Coder Agents.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Deprecated: use DiffStatuses, which lists every pull request | ||
| // the chat tracks. | ||
| DiffStatus *ChatDiffStatus `json:"diff_status,omitempty"` | ||
| DiffStatuses []ChatDiffStatus `json:"diff_statuses,omitempty"` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: the stack's frontend treats this order as contract ("the first row is the primary" in site/src/api/queries/chats.ts, #29543), but the field has no doc comment, so Swagger and typesGenerated.ts don't say so. ChatDiffStatus also lacks the sort key, so clients can't sort the list or tell which of two events is newer.
Could we document the order here and expose the report time on ChatDiffStatus? Alternatively: a stable list order (e.g. created_at) with an explicit primary marker would also stop the top bar and sidebar PR menus from reshuffling on every report.
PS. DiffStatusRef and ChangedDiffStatus need doc comments too.
🤖
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Made the order stable
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // branch info even before the worker refreshes PR data. | ||
| if w.publishDiffStatusChangeFn != nil { | ||
| if pubErr := w.publishDiffStatusChangeFn(ctx, chatID); pubErr != nil { | ||
| if pubErr := w.publishDiffStatusChangeFn(ctx, chatID, codersdk.DiffStatusRef{RemoteOrigin: origin, GitBranch: branch}); pubErr != nil { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Check: the broadcast path in MarkStale also reaches this. Git run outside a chat process (terminal, IDE, startup script) has no CODER_CHAT_ID, so the ref is upserted into every non-archived chat on the workspace. Before #29081 that overwrote one row; now it adds a row and makes it primary, and rows are never pruned. A terminal git pull on main over HTTPS makes main the primary of every chat on the workspace, and this PR returns it in diff_statuses. Should the broadcast path still write refs now that chats keep several?
🤖
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The primary status in PublishDiffStatusChange is now named primary, the same as the changed status next to it. The 400 error for an incomplete ref selector now tells the user to set both query parameters or omit both.
diff_statuses now lists refs by first report, so the list does not change order when a ref gets a new git report. diff_status is still the ref with the most recent git report. One helper picks it, with the same tie order as before. diff_status is the primary marker and is no longer deprecated. The SDK types for the ref list, the ref selector, and the changed ref event now have doc comments.
A git report without a chat ID comes from outside a chat process, for example a terminal. MarkStale added the ref to every chat on the workspace, and the ref became the primary of each chat. Rows are not pruned, so the chats collected refs they never used. MarkStale now refreshes only the chats that already track the reported ref, and adds no rows. Reports with a chat ID do not change.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.