Repository navigation
ci: add claude review workflow #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Code Review Criteria | ||
|
|
||
| When reviewing pull requests in this repository, check the following areas: | ||
|
|
||
| | Area | What to check | | ||
| | ---- | ------------- | | ||
| | Public API compatibility | Changes to exported identifiers, function signatures, the `Option` type or the `Error` struct fields. A breaking change needs a major version bump and a `/vN` module path. | | ||
| | Output formats | Changes to the `Error()` string, the `%v` / `%+v` JSON shape, JSON field names or the `slog` group keys. Consumers parse and match these, so treat them as API. `README.md` and `DESIGN.md` show the exact strings and must stay in sync. | | ||
| | Standard library semantics | `Is`, `As` and `Unwrap` keep working with the standard `errors` package. `Is` keeps its identifier-prefix matching. `CausedBy` chains stay reachable through `errors.Unwrap`. | | ||
| | Immutability of sentinels | Sentinel errors from `New` are shared package-level values. `Wrap` and every option must clone `Details`, `Identifier` and `Properties` and never mutate the template error. Watch for slice aliasing through `append`. | | ||
| | Concurrency | Sentinels are wrapped from many goroutines at once. No option may write to shared maps or slices. Tests run with `-race`. | | ||
| | Nil safety | Nil receivers, `Wrap(nil)`, `CausedBy(nil)`, empty property keys and nil maps must not panic. An error library must never crash the caller's error path. | | ||
| | Stack capture | `runtime.Caller` depth is hard-coded. A new entry point or an extra call layer shifts the captured frame. Tests should assert the reported function name. | | ||
| | Dependencies | The library has no runtime dependency. A new non-test import outside the standard library needs a strong reason. `go.mod` and `go.sum` stay consistent. | | ||
| | Tests | New behavior is covered by Ginkgo/Gomega specs in `errors_test.go`, in the existing `Describe` / `It` style. | | ||
| | CI and workflows | GitHub Actions are pinned to a commit SHA with a version comment, matching the existing workflows. | | ||
| | Security | No secrets or real hostnames in tests or examples. Flag changes that start logging `Properties` or `Details` in new places, since callers may put sensitive values there. | |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Code Review | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, labeled, unlabeled] | ||
| pull_request_target: | ||
| types: [opened, synchronize] | ||
|
|
||
| jobs: | ||
| review: | ||
| # May also trigger on bump branches when a human updates them (acceptable double-review). | ||
| if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' && github.actor != 'scality-renovate[bot]' | ||
| uses: scality/workflows/.github/workflows/claude-code-review.yml@91619d883650e6238f517757f7b978757c2cb086 # v2.12.1 | ||
| secrets: | ||
| # The review prompt is a slash command shipped by the scality-skills | ||
| # plugin, which the shared workflow clones from the agent-hub marketplace | ||
| # with this app key. Without it the plugin is skipped and the review | ||
| # silently does nothing. | ||
| ACTIONS_APP_PRIVATE_KEY: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} | ||
|
|
||
| review-dependency-bump: | ||
| # pr.user.login catches bump PRs updated by a human, where github.actor is no longer the bot. | ||
| if: github.event_name == 'pull_request_target' && (github.actor == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot[bot]' || github.actor == 'scality-renovate[bot]' || github.event.pull_request.user.login == 'scality-renovate[bot]') | ||
| uses: scality/workflows/.github/workflows/claude-code-dependency-review.yml@91619d883650e6238f517757f7b978757c2cb086 # v2.12.1 | ||
| with: | ||
| ACTIONS_APP_ID: ${{ vars.ACTIONS_APP_ID }} | ||
| secrets: | ||
| ACTIONS_APP_PRIVATE_KEY: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # go-errors | ||
|
|
||
| This is a **Go library for structured error handling** (`github.com/scality/go-errors`). It contains: | ||
|
|
||
| - A single package `errors` in `errors.go`: `New`, `Wrap` with functional options, stack capture, identifier chaining | ||
| - Standard library compatibility: `errors.Is`, `errors.As`, `errors.Unwrap`, `fmt` verbs (`%v` / `%+v` as JSON) and `slog.LogValuer` | ||
| - Ginkgo/Gomega tests in `errors_test.go`, run with `go test -race ./...` | ||
| - Linting with golangci-lint, via the devcontainer in `.devcontainer/` | ||
| - Design notes in `DESIGN.md`, usage and exact output formats in `README.md` | ||
| - No runtime dependencies: `go.mod` only pulls test dependencies |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.