Repository navigation
Conversation
|
Thanks for the PR. It is labeled If AI was used to create this PR, you must run the Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
|
Thanks @p4rtridge, and for picking up access_token.go from #2883. I checked the expected bytes against the three encoders in access_token.go and the command codes against core/binary_protocol/src/codes.rs (41, 42, 43), and they match. One small thing: the old failure message printed the bodies with |
Thanks for reviewing! I’ve changed the failure message from |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4640 +/- ##
============================================
- Coverage 91.03% 91.02% -0.01%
+ Complexity 3878 3873 -5
============================================
Files 1561 1561
Lines 403732 403123 -609
Branches 337601 337006 -595
============================================
- Hits 367521 366931 -590
+ Misses 28851 28828 -23
- Partials 7360 7364 +4
🚀 New features to boost your workflow:
|
|
/skill team-review |
There was a problem hiding this comment.
Summary: The new access-token serialization tests match the command codes, byte layout, and server wire format. The added name rows miss the 255-byte boundary, the empty-name rows encode a rejected name, and the three tests duplicate one harness.
Counts: critical 0, warning 0, nit 2, simplification 1
This review was generated by Claude Code 2.1.310 on deepseek-flash[1m]. Review the output before you act on it.
hubcio
left a comment
There was a problem hiding this comment.
no findings in the reviewed changes.
Which issue does this PR address?
Relates to #2883
Rationale
The personal access token command encoders in the Go SDK had only partial
serialization coverage. The existing test checked the
CreatePersonalAccessTokenexpiry encoding with a single fixed name. It did not check the command code,
the name length prefix for other name lengths, or the other two access token
commands. Exact-byte assertions catch protocol compatibility regressions.
What changed?
Reworked
access_token_test.gointo table-driven serialization tests for allthree commands in
access_token.go. Each case checks the command code and thecomplete request body.
CreatePersonalAccessToken(code 42): the four existing expiry cases (serverdefault, little-endian layout, values past 32 bits, never expire), plus an
empty name and a longer name, to cover the
u8length prefix.GetPersonalAccessTokens(code 41): the body is empty.DeletePersonalAccessToken(code 43): short, empty and longer names.That is 10 cases. No production code changed.
Local Execution
go test -count=1 ./...,go test -race -count=1 ./...andgo vet ./...fromforeign/go.AI Usage
against the encoders in
access_token.goand the server's protocoldefinitions.