Repository navigation
Add REVIEW.md and lint shell scripts, Dockerfiles and workflows in CI #144
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
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -1,17 +1,41 @@ | ||
| ## Summary | ||
|
|
||
| <!-- What does this change and why? --> | ||
| <!-- What does this change and why? Link the issue that it resolves. --> | ||
|
|
||
| Closes # | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] `./run-ci-local.sh` passes (gofmt, golangci-lint, build, pg_regress, | ||
| journey) | ||
| - [ ] Tests added/updated (test-first) | ||
| - [ ] Docs updated where applicable (README / USAGE / INSTALL / ARCHITECTURE) | ||
| - [ ] Bakery / mesh / distributed changes: TLA+ model updated and TLC | ||
| re-checked (`docs/formal/`) | ||
| - [ ] Commit messages are short and imperative | ||
| - [ ] The pull request links a tracking issue. | ||
| - [ ] `./run-ci-local.sh` passes (gofmt, golangci-lint, shellcheck, hadolint, | ||
| actionlint, build, pg_regress, journey). | ||
| - [ ] The change includes unit tests, written before the code, or the Testing | ||
| section explains why it has none. | ||
| - [ ] The change includes regression tests in `extension/coldfront/test/`, or | ||
| the Testing section explains why it has none. | ||
| - [ ] The Testing section notes any impact on the integration tests | ||
| (`ci/journey.sh` and the CI matrix). | ||
| - [ ] The change updates `README.md` and `docs/`, or the Notes for Reviewers | ||
| explain why it needs no update. | ||
| - [ ] The change adds no secrets, and the Risk section covers its security | ||
| impact. | ||
| - [ ] A bakery, mesh, or distributed change updates the TLA+ model and re-runs | ||
| TLC (`docs/formal/`). | ||
| - [ ] Author's AI review completed and findings addressed. | ||
| - [ ] Commit messages are short and imperative. | ||
|
|
||
| ## Related issues | ||
| ## Testing | ||
|
|
||
| Closes # | ||
| <!-- How was the change tested? --> | ||
|
|
||
| ## Risk | ||
|
|
||
| <!-- What could go wrong, and what would the automated checks not catch? --> | ||
|
|
||
| ## How to Revert | ||
|
|
||
| <!-- How can the change be undone if needed? --> | ||
|
|
||
| ## Notes for Reviewers | ||
|
|
||
| <!-- Known limitations, design rationale, or follow-up tasks. --> |
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
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
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
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 @@ | ||
| # Rules the current Dockerfiles break. docker/Dockerfile.duckdb15-base is the | ||
| # base image recipe, so any edit to it, an inline ignore comment included, | ||
| # needs a base image republish. | ||
| failure-threshold: warning | ||
| ignored: | ||
| - DL3002 # Build stages run as root, and each final stage switches to postgres. | ||
| - DL3003 # A build step changes into a cloned source tree within one RUN. | ||
| - DL3006 # The manylinux stage aliases pull untagged images. | ||
| - DL3029 # The manylinux stage aliases pick one image per architecture. | ||
| - DL3041 # dnf installs packages without a pinned version. |
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
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
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,135 @@ | ||
| # Reviewing Changes to ColdFront | ||
|
|
||
| This file describes what a defect looks like in ColdFront, which paths the | ||
| automated review tools skip, and what a reviewer checks in every pull request. | ||
| The author's AI review, CodeRabbit, and the approving reviewer all work from | ||
| this file. | ||
|
|
||
| ## Recognizing a Failure | ||
|
|
||
| ColdFront runs inside the PostgreSQL server process and moves data between | ||
| PostgreSQL and Apache Iceberg, so a defect can lose data or crash the server. | ||
| A change fails review when the change can cause any of the following: | ||
|
|
||
| - a row that the archiver, a tiered `INSERT`, or the partitioner loses, | ||
| duplicates, or alters as the row moves between partitions or between the hot | ||
| and cold tiers. | ||
| - a cold read that returns rows or values that differ from what PostgreSQL | ||
| returns for the same data. | ||
| - two cold writes that commit to one Iceberg table out of turn, or two nodes | ||
| that register the same Iceberg table. | ||
| - a crash or memory error in `extension/coldfront/src/coldfront.c`, which | ||
| terminates the backend and makes PostgreSQL end every other session while | ||
| the server recovers from the crash. | ||
| - a storage credential or catalog token that appears in a log, an error | ||
| message, a query text, or a committed file. | ||
| - a compaction or a cold `DROP` that deletes a data file that a live snapshot | ||
| or an open transaction still reads. | ||
|
|
||
| ## Skipping Paths in Automated Review | ||
|
|
||
| CodeRabbit reviews every tracked file. Codacy skips files that do not ship or | ||
| that another check covers, as the `.codacy.yaml` file lists, and a change to | ||
| that file updates this section to match. | ||
|
|
||
| The following table describes the paths that Codacy skips: | ||
|
|
||
| | Path | Reason | | ||
| |---|---| | ||
| | `.claude/**` and `CLAUDE.md` | These files instruct coding agents and do not ship. | | ||
| | `config.example.yaml` | This file is an example configuration. | | ||
| | `THIRD_PARTY_NOTICES.md` | This file is generated license text. | | ||
| | `docker/*.patch` | These patches change duckdb-iceberg, and CodeRabbit and the approving reviewer read them. | | ||
| | `docs/formal/**` | The TLC model checker checks the TLA+ model in this directory. | | ||
| | `extension/coldfront/test/**` | These files are pg_regress tests and their expected output. | | ||
| | `**/*_test.go` | These files are Go tests, which do not ship. | | ||
|
|
||
| ## Checking a Change | ||
|
|
||
| A reviewer checks the following points in addition to the checklist in the | ||
| pull request template. The linters cover formatting, so the review omits | ||
| findings about formatting alone. | ||
|
|
||
| ### Checking Cold Writes and the Bakery | ||
|
|
||
| The bakery protocol serializes every cold write through the | ||
| `coldfront.claims` table. A change to cold writes follows these rules: | ||
|
|
||
| - A change to the bakery functions in the extension SQL, the commit callback | ||
| in `coldfront.c`, the `coldfront.iceberg_async_parquet` ordering, or the | ||
| Spock settings that replicate claims updates `docs/formal/Bakery.tla` and | ||
| re-runs every TLC configuration. A pure refactor instead explains in the | ||
| pull request why the claim, commit, and release sequence is unchanged. | ||
| [docs/formal/README.md](docs/formal/README.md) describes the model and every | ||
| configuration. | ||
| - A cold write runs outside any subtransaction, such as a `SAVEPOINT` or a | ||
| PL/pgSQL `EXCEPTION` block, because pg_duckdb refuses every cold write inside | ||
| one. | ||
| - A cold write commits to the catalog without a retry, because the bakery | ||
| prevents commit conflicts. | ||
|
|
||
| ### Checking Generated SQL | ||
|
|
||
| The query rewrite emits SQL that DuckDB or a second session runs, and that SQL | ||
| must read the same in every session. Generated SQL follows these rules: | ||
|
|
||
| - Every relation, function, and operator reference is schema-qualified, so | ||
| the code does not rely on `search_path`. | ||
| - Every value that leaves the session as text goes through | ||
| `coldfront._canonical_text`. | ||
| - A change to the shape of a rendered qual or `INSERT` regenerates every | ||
| pg_regress expected file that echoes the statement, including the `_1.out` | ||
| variants. | ||
|
|
||
| ### Checking Component Boundaries | ||
|
|
||
| Each component keeps a narrow set of dependencies. A change respects these | ||
| boundaries: | ||
|
|
||
| - SQL and the C extension make HTTP calls only through the catalog client in | ||
| duckdb-iceberg, and only the Go programs call the Lakekeeper management API. | ||
| - The archiver orchestrates plain parameterized SQL through pgx and uses no | ||
| DuckDB, Iceberg, or Arrow Go libraries. | ||
| - The compactor in `cmd/compactor/` stays a separate Go module, so its | ||
| dependencies stay out of the archiver. | ||
|
|
||
| ### Checking Tests and Dependencies | ||
|
|
||
| Tests prove the behaviour that a change claims, and a dependency workaround | ||
| proves that it is still needed. A change meets these conditions: | ||
|
|
||
| - A bug fix includes a test that fails on the unfixed code. | ||
| - A test changed alongside a fix still fails on the unfixed code in every | ||
| interleaving and input that the test can meet. | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| - A workaround for a dependency names the dependency and the pinned version | ||
| that shows the defect, and includes a test that runs the dependency without | ||
| the workaround and fails once the defect is gone. | ||
| - A change to the base image recipe (`docker/Dockerfile.duckdb15-base` and the | ||
| files that it copies) passes CI only after `base-image.yml` publishes the | ||
| base image under the tag that `ci/base-ref.sh` prints. | ||
|
|
||
| ### Checking Documentation | ||
|
|
||
| The documentation describes the current behaviour. A change keeps the | ||
| documentation consistent in these ways: | ||
|
|
||
| - `README.md` and `docs/index.md` change together where they share the | ||
| introduction. | ||
| - A new, renamed, or removed guide in `docs/` updates the `mkdocs.yml` | ||
| navigation and the `README.md` table of contents in the same commit. | ||
| - `mkdocs build --strict` passes with no warnings. | ||
|
|
||
| ## Reporting Findings | ||
|
|
||
| Every reviewer reports findings by these rules, so that the reviews of a pull | ||
| request converge: | ||
|
|
||
| - Label each finding as Critical, Major, or Minor. A Critical finding can cause | ||
| a failure listed in [Recognizing a Failure](#recognizing-a-failure). A Major | ||
| finding causes an error or a wrong result on a narrower path. A Minor finding | ||
| is any other defect. | ||
| - State whether the finding concerns code that the pull request changes or code | ||
| that existed before the pull request. | ||
| - Omit findings that concern style alone. | ||
| - On a later review of the same pull request, review only the new commits, and | ||
| do not repeat an earlier finding. | ||
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
Oops, something went wrong.
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.