ARO-27271: Add CloudErrors reference doc and generation script - #4845
Open
Andrew Denton (ventifus) wants to merge 1 commit into
Open
ARO-27271: Add CloudErrors reference doc and generation script#4845Andrew Denton (ventifus) wants to merge 1 commit into
Andrew Denton (ventifus) wants to merge 1 commit into
Conversation
Andrew Denton (ventifus)
requested review from
Alfonso Casimiro (alcasim),
Ben Vesel (bennerv),
Caden Marchese (cadenmarchese),
Amber Brown (hawkowl),
Hilliary Lipsig (hlipsig),
Kevin O'Brien (kevinobriendotca),
Kipp Morris (kimorris27),
Maitiú Ó Ciaráin (mociarain),
Marius Schulz (mrWinston),
Rogerio Bastos (rogbas),
Ankur Singh (sankur-codes),
Miguel Abad Perez (tiguelu),
Tanmay Satam (tsatam),
Affinito Alessandro (tuxerrante),
Haoran Wang (wanghaoran1988) and
Jeff Yuan (yjst2012)
as code owners
May 20, 2026 21:33
Contributor
There was a problem hiding this comment.
Pull request overview
Adds automation to extract and publish a reference of all CloudError definitions emitted by the RP, to make it easy to audit what error codes/messages are exposed (motivated by ARO-27166).
Changes:
- Added
hack/extract-cloud-errors.pyto scan forapi.NewCloudError/api.WriteErrorcall sites and generate a Markdown summary usinggopls. - Added
docs/clouderrors.mdas the generated CloudErrors reference doc. - Added
make generate-cloud-errorstarget to regenerate the doc.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Makefile | Adds generate-cloud-errors make target to produce the CloudErrors reference doc. |
| hack/extract-cloud-errors.py | New generator script that scans Go sources and uses gopls to resolve constants/hover info into a Markdown table. |
| docs/clouderrors.md | Generated CloudErrors reference table checked into docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Andrew Denton (ventifus)
force-pushed
the
ventifus/ARO-27271/clouderrors-doc
branch
from
May 20, 2026 21:40
709a584 to
7fd4085
Compare
Andrew Denton (ventifus)
force-pushed
the
ventifus/ARO-27271/clouderrors-doc
branch
from
May 20, 2026 22:38
7fd4085 to
7b432a3
Compare
Andrew Denton (ventifus)
force-pushed
the
ventifus/ARO-27271/clouderrors-doc
branch
from
May 21, 2026 00:22
7b432a3 to
695c9b2
Compare
Andrew Denton (ventifus)
force-pushed
the
ventifus/ARO-27271/clouderrors-doc
branch
from
May 21, 2026 00:46
695c9b2 to
1f47918
Compare
Andrew Denton (ventifus)
force-pushed
the
ventifus/ARO-27271/clouderrors-doc
branch
from
May 21, 2026 00:56
1f47918 to
a7562c6
Compare
Collaborator
Author
|
/azp run ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Andrew Denton (ventifus)
force-pushed
the
ventifus/ARO-27271/clouderrors-doc
branch
from
May 28, 2026 00:17
a7562c6 to
4cae54c
Compare
Comment on lines
+183
to
+184
| @[ -x "$(GOBIN)/gopls" ] || GOBIN=$(GOBIN) go install golang.org/x/tools/gopls@v0.19.0 | ||
| GOPLS=$(GOBIN)/gopls python3 hack/extract-cloud-errors.py > docs/clouderrors.md |
Comment on lines
33
to
37
| GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.8.0" | ||
|
|
||
| GOPLS="${GOBIN}/gopls-v0.19.0" | ||
|
|
||
| GOTESTSUM="${GOBIN}/gotestsum-v1.13.0" |
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.
Summary
hack/extract-cloud-errors.py: drives gopls LSP to find everyapi.NewCloudErrorandapi.WriteErrorcall site across both Go modules in the repo, resolves Go constants via hover, and outputs a Markdown reference table.docs/clouderrors.md: the generated table, listing HTTP status code, error code, and message for all CloudErrors in the codebase, split into user-facing and admin sections.make generate-cloud-errorstarget to regenerate the doc after code changes.Motivated by ARO-27166 (determining what error details the RP currently exposes to users).
How to regenerate
The target installs
goplsvia bingo if not already present.