Skip to content

ARO-27271: Add CloudErrors reference doc and generation script - #4845

Open
Andrew Denton (ventifus) wants to merge 1 commit into
masterfrom
ventifus/ARO-27271/clouderrors-doc
Open

ARO-27271: Add CloudErrors reference doc and generation script#4845
Andrew Denton (ventifus) wants to merge 1 commit into
masterfrom
ventifus/ARO-27271/clouderrors-doc

Conversation

@ventifus

@ventifus Andrew Denton (ventifus) commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds hack/extract-cloud-errors.py: drives gopls LSP to find every api.NewCloudError and api.WriteError call site across both Go modules in the repo, resolves Go constants via hover, and outputs a Markdown reference table.
  • Adds 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.
  • Adds make generate-cloud-errors target to regenerate the doc after code changes.

Motivated by ARO-27166 (determining what error details the RP currently exposes to users).

How to regenerate

make generate-cloud-errors

The target installs gopls via bingo if not already present.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to scan for api.NewCloudError / api.WriteError call sites and generate a Markdown summary using gopls.
  • Added docs/clouderrors.md as the generated CloudErrors reference doc.
  • Added make generate-cloud-errors target 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.

Comment thread hack/extract-cloud-errors.py Outdated
Comment thread hack/extract-cloud-errors.py
Comment thread docs/clouderrors.md Outdated
Comment thread docs/clouderrors.md Outdated
@ventifus
Andrew Denton (ventifus) force-pushed the ventifus/ARO-27271/clouderrors-doc branch from 709a584 to 7fd4085 Compare May 20, 2026 21:40
Copilot AI review requested due to automatic review settings May 20, 2026 22:38
@ventifus
Andrew Denton (ventifus) force-pushed the ventifus/ARO-27271/clouderrors-doc branch from 7fd4085 to 7b432a3 Compare May 20, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread hack/extract-cloud-errors.py Outdated
Comment thread docs/clouderrors.md
Comment thread docs/clouderrors.md Outdated
Comment thread .bingo/Variables.mk Outdated
@ventifus
Andrew Denton (ventifus) force-pushed the ventifus/ARO-27271/clouderrors-doc branch from 7b432a3 to 695c9b2 Compare May 21, 2026 00:22
Copilot AI review requested due to automatic review settings May 21, 2026 00:46
@ventifus
Andrew Denton (ventifus) force-pushed the ventifus/ARO-27271/clouderrors-doc branch from 695c9b2 to 1f47918 Compare May 21, 2026 00:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread hack/extract-cloud-errors.py Outdated
Comment thread hack/extract-cloud-errors.py
Comment thread hack/extract-cloud-errors.py
Comment thread docs/clouderrors.md
@ventifus
Andrew Denton (ventifus) force-pushed the ventifus/ARO-27271/clouderrors-doc branch from 1f47918 to a7562c6 Compare May 21, 2026 00:56
@ventifus

Copy link
Copy Markdown
Collaborator Author

/azp run ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings May 28, 2026 00:17
@ventifus
Andrew Denton (ventifus) force-pushed the ventifus/ARO-27271/clouderrors-doc branch from a7562c6 to 4cae54c Compare May 28, 2026 00:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread Makefile
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 thread .bingo/variables.env
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"
@ventifus Andrew Denton (ventifus) added the chainsaw Pull requests or issues owned by Team Chainsaw label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chainsaw Pull requests or issues owned by Team Chainsaw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants