Commit df52b3a
authored
docs(1to1): declare the 49 project-group fields as a wrong route annotation (#688)
## Description
The largest single block left in the sent backlog turned out to be no
work at all, and the reason is worth recording: it was GitLab's route
annotation that was wrong, not our type.
`projects.ProjectGroupOutput` was held against the whole `Group` entity
and reported missing 49 of its fields. It is already 1:1 with what the
endpoints send.
`lib/api/projects.rb` describes both `GET :id/share_locations` and `GET
:id/invited_groups` as answering with `Entities::Group`, and both call
`present_groups`, the helper defined a few hundred lines above them in
the same file, which presents `Entities::PublicGroupDetails`. Their
sibling `GET :id/groups` calls that same helper and is annotated
`PublicGroupDetails`, correctly, so three adjacent routes share one
helper and two of them disagree with it.
`PublicGroupDetails` is `BasicGroupDetails` plus `avatar_url`,
`full_name` and `full_path`. Six keys, against roughly seventy for
`Group`. All three endpoints answer with exactly those six on
GitLab.com, and `ProjectGroupOutput` publishes all six.
I checked this against the live API rather than by reading the source,
because this is the third time in this review that the annotation has
been the thing that was wrong.
## Related Issue
No single issue: this is the project-groups tranche of the continuing
1:1 field review, whose upstream half is tracked in
<https://gitlab.com/gitlab-org/api/client-go/-/issues/2300>.
The GitLab-side fix is
[gitlab-org/gitlab!254699](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/254699),
opened today, alongside
[gitlab-org/gitlab!254698](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/254698)
for three annotations of the same class in
`lib/api/project_job_token_scope.rb`.
## Type of Change
- [x] Documentation update
- [x] Enhancement (improvement to existing functionality)
## Changes Made
- One declaration in
`cmd/audit_1to1/internal/paths/sent_declarations.go` under
`documented-response-is-not-the-one-sent`, keyed by package and entity
with the wildcard field, since every field read on the component has the
same answer.
- An entry in `docs/development/upstream-bugs.md` recording the finding,
the evidence, and the merge request that fixes it.
- README stats regenerated.
## Results
| counter | before | after |
| --- | --- | --- |
| undeclared findings | 117 | **68** |
| `typed_unsurfaced_declared` | 1129 | **1178** |
| `stale_declarations` | 0 | 0 |
`typed_unsurfaced_fields` stays 1246: nothing was published, one block
was answered.
What remains, for the next tranche: `projects.Output` vs `Project` 17,
`groups.Output` vs `BasicProjectDetails` 13, `issues.Output` vs
`EpicIssue` 10, `groups.Output` vs `Group` 10, `groups.Output` vs
`GroupDetail` 8, and a tail of 10 across six types.
## How to Test
1. `RGO_DIR="$PWD" /root/.claude/bin/rgo 'go run ./cmd/audit_1to1/
-scope=paths'` and read the summary. The JSON goes to stderr.
2. `go test ./cmd/audit_1to1/... -count=1` passes, including the
declaration table's own staleness test.
3. Against any instance, call all three endpoints and count the keys:
six each.
## Breaking Changes / Migration Notes
N/A. No runtime code changes.
## Checklist
### Code Quality
- [x] `golangci-lint run ./cmd/audit_1to1/...` clean
- [x] Follows the conventions in `CLAUDE.md`
### Testing
- [x] `go test ./cmd/audit_1to1/... -count=1` passes
- [x] `stale_declarations` stays 0, so the declaration matches something
### Documentation
- [x] `docs/development/upstream-bugs.md` records the finding and the
merge request
- [x] `markdownlint-cli2` clean on the changed file
- [x] README stats regenerated
- [x] Commit message follows Conventional Commits
### Security
- [x] No secrets, tokens or credentials1 parent 9ae164b commit df52b3a
3 files changed
Lines changed: 60 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
470 | | - | |
| 470 | + | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
264 | 278 | | |
265 | 279 | | |
266 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
202 | 245 | | |
203 | 246 | | |
204 | 247 | | |
| |||
0 commit comments