chore(deps): update dependencies and refactor postgrest#19
Conversation
Update go.mod and go.sum with latest dependency versions including: - bmatcuk/doublestar v4.8.1 -> v4.9.1 - flanksource/clicky v1.21.7 -> v1.21.8 - Add flanksource/deps v1.0.26 - Various indirect dependency updates Refactor postgrest package to use new deps.Install API instead of deprecated BinaryWithEnv function. Update cache package to use task.GatedStderr() for consistent stderr handling. This improves dependency management and aligns with the new clicky task execution model.
|
Warning Review limit reached
More reviews will be available in 43 minutes and 10 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR refreshes go.mod dependency versions, routes cache debug output through clicky task.GatedStderr, narrows SqlLogger index DDL logging to commons.Debug, refactors PostgREST binary install/env handling, updates the e2e CI to Go 1.26 and ginkgo via go run, and limits e2e ServiceManager to embedded Postgres. ChangesMaintenance and Operational Updates
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Update the following dependencies to their latest versions: - flanksource/commons: v1.51.0 → v1.52.0 - flanksource/gomplate/v3: v3.24.77 → v3.24.81 - flanksource/is-healthy: v1.0.86 → v1.0.87 These updates include bug fixes and improvements from upstream packages.
Update all Go module dependencies to their latest available versions. This includes: - Cloud Google APIs (bigquery, logging, kms, pubsub, etc.) - Azure SDK packages (azcore, azidentity) - AWS SDK v2 packages (core, config, credentials, services) - OpenTelemetry packages (otel, contrib, detectors) - Kubernetes packages (api, apimachinery, client-go, klog) - Go standard library packages (crypto, net, sync, tools, etc.) - Various other dependencies Removed unused dependency: github.com/zeebo/errs Added new dependency: cloud.google.com/go/pubsub/v2 These updates include bug fixes, performance improvements, and security patches from upstream projects.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@go.mod`:
- Line 3: CI and docs pin Go 1.22 while go.mod declares go 1.26.1; update the CI
workflow and example specs to match by replacing GO_VERSION and go-version
values from "1.22" to "1.26.1" in .github/workflows/e2e.yml (update the
GO_VERSION env and the uses: actions/setup-go@... go-version input) and change
the go-version value in specs/2025-10-15-e2e-testing.md (and any other examples
that reference go-version) so all references consistently use "1.26.1".
In `@postgrest/postgrest.go`:
- Around line 22-28: The install function currently calls
deps.Install("postgrest", config.Postgrest.Version, deps.WithBinDir(".bin")) and
then constructs the path with filepath.Join(result.BinDir, "postgrest"), but
WithBinDir(".bin") leaves BinDir relative and makes the returned path
cwd-dependent; update install to resolve the bin dir to an absolute path before
passing it to deps.Install (e.g., call filepath.Abs on config-provided or
".bin"), pass deps.WithBinDir(absBin) into deps.Install, then continue returning
filepath.Join(result.BinDir, "postgrest"); keep the same join logic (no .exe
handling) and reference the install function, deps.Install call, result.BinDir,
and deps.WithBinDir(".bin").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47d334d9-1584-4c4a-8efb-fea9572de2fc
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (4)
go.modgorm/logger.gollm/cache/cache.gopostgrest/postgrest.go
| func install(config api.Config) (string, error) { | ||
| result, err := deps.Install("postgrest", config.Postgrest.Version, deps.WithBinDir(".bin")) | ||
| if err != nil { | ||
| return "", err | ||
| } | ||
| return filepath.Join(result.BinDir, "postgrest"), nil | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect deps.Install signature and the returned result struct fields
gh search code --repo flanksource/deps "func Install" || true
gh api repos/flanksource/deps/git/trees/HEAD?recursive=1 --jq '.tree[].path' 2>/dev/null | grep -iE 'install|deps\.go' || trueRepository: flanksource/commons-db
Length of output: 1453
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "type InstallResult|InstallResult" -S flanksource/deps deps.go deps/**/*.go 2>/dev/null || true
fd -i "deps.go" . | head -n 20
# Print the deps.go InstallResult definition and Install implementation (bounded output)
DEPS_GO="$(fd -i "deps.go" . | head -n 1 || true)"
echo "DEPS_GO=$DEPS_GO"
if [ -n "${DEPS_GO}" ]; then
nl -ba "$DEPS_GO" | sed -n '1,240p'
nl -ba "$DEPS_GO" | sed -n '240,520p'
fi
# Inspect postgrest installer code around the cited lines
POSTGREST_FILE="$(fd -i "postgrest.go" . | head -n 5)"
echo "POSTGREST_FILE=$POSTGREST_FILE"
for f in $POSTGREST_FILE; do
echo "---- $f ----"
nl -ba "$f" | sed -n '1,120p'
doneRepository: flanksource/commons-db
Length of output: 212
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate deps.go / deps package files
echo "== deps.go candidates =="
fd -i "deps.go" . || true
echo
echo "== InstallResult definition =="
# Search entire repo for InstallResult type
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' "type InstallResult" . || true
echo
echo "== deps.Install implementation & BinDir usage =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' "func Install\(" . || true
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' "BinDir" . || true
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' "exe\"" . || true
echo
echo "== postgrest/postgrest.go around lines 22-28 =="
FILE="postgrest/postgrest.go"
if [ -f "$FILE" ]; then
sed -n '1,80p' "$FILE" | cat -n
else
echo "Missing $FILE"
fiRepository: flanksource/commons-db
Length of output: 3000
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== go.mod (deps version) =="
rg -n "github.com/flanksource/deps" go.mod go.sum || true
echo
echo "== GOPATH =="
go env GOPATH || true
echo
GOPATH="$(go env GOPATH)"
MODROOT="$GOPATH/pkg/mod"
echo "== Searching for InstallResult in module cache: $MODROOT =="
# Find the deps module directory
DEPS_DIR="$(find "$MODROOT" -maxdepth 4 -type d -path "*github.com*flanksource*deps*" 2>/dev/null | head -n 20 || true)"
echo "DEPS_DIR=$DEPS_DIR"
# Search for InstallResult type and BinDir usage inside the deps module
if [ -n "${DEPS_DIR:-}" ]; then
rg -n "type InstallResult" "$DEPS_DIR" -S || true
rg -n "BinDir" "$DEPS_DIR" -S || true
rg -n "func Install\(" "$DEPS_DIR" -S || true
# Print the file section that defines InstallResult
FILE="$(rg -l "type InstallResult" "$DEPS_DIR" -S | head -n 1 || true)"
echo
echo "== InstallResult definition file =="
echo "$FILE"
if [ -n "${FILE:-}" ]; then
sed -n '1,220p' "$FILE" | cat -n | head -n 220
fi
else
echo "Could not locate deps module directory in GOPATH cache."
fiRepository: flanksource/commons-db
Length of output: 4043
🏁 Script executed:
#!/bin/bash
set -euo pipefail
DEPS_DIR="/home/jailuser/go/pkg/mod/github.com/flanksource/deps@v1.0.26"
echo "DEPS_DIR=$DEPS_DIR"
echo "== Files mentioning InstallResult (case-sensitive/insensitive) =="
rg -n "InstallResult" "$DEPS_DIR" -S --hidden || true
echo
rg -n "install result|InstallResult|BinDir|WithBinDir" "$DEPS_DIR" -S --hidden || true
echo
echo "== Locate deps.Install implementation =="
rg -n "func Install\(" "$DEPS_DIR" -S --hidden || true
echo
echo "== WithBinDir definition =="
rg -n "WithBinDir" "$DEPS_DIR" -S --hidden || true
echo
echo "== Inspect candidate result struct types =="
# Find structs near "BinDir" and print small windows
mapfile -t BIN_FILES < <(rg -l "BinDir" "$DEPS_DIR" -S --hidden || true)
printf "%s\n" "${BIN_FILES[@]}" | head -n 20
for f in "${BIN_FILES[@]:0:10}"; do
echo "---- $f ----"
# Print first 200 lines of file (bounded)
sed -n '1,220p' "$f" | cat -n
doneRepository: flanksource/commons-db
Length of output: 18788
🏁 Script executed:
#!/bin/bash
set -euo pipefail
DEPS_DIR="/home/jailuser/go/pkg/mod/github.com/flanksource/deps@v1.0.26"
echo "== types.go: InstallResult definition =="
TYPES="$DEPS_DIR/pkg/types/types.go"
sed -n '330,520p' "$TYPES" | cat -n
echo
echo "== installer/options.go: WithBinDir behavior =="
OPTS="$DEPS_DIR/pkg/installer/options.go"
sed -n '1,120p' "$OPTS" | cat -n
echo
echo "== deps.go: deps.Install (how result is built/returned) =="
DEPS_GO="$DEPS_DIR/deps.go"
sed -n '1,160p' "$DEPS_GO" | cat -n
echo
echo "== installer/installer.go: compute final installed name/path (binaryName/.exe) =="
INST="$DEPS_DIR/pkg/installer/installer.go"
# show around known line hits for finalPath/binPath
sed -n '600,760p' "$INST" | cat -n
sed -n '780,920p' "$INST" | cat -n
sed -n '920,1020p' "$INST" | cat -n
sed -n '1020,1110p' "$INST" | cat -n
echo
echo "== Search within deps module for Windows suffix handling (.exe / runtime.GOOS) =="
rg -n "exe\\b|\\.exe|runtime\\.GOOS|OSOverride|binaryName\\s*:?=" "$DEPS_DIR/pkg/installer" -S --hidden || trueRepository: flanksource/commons-db
Length of output: 40157
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for the postgrest package definition in the deps module cache
DEPS_DIR="/home/jailuser/go/pkg/mod/github.com/flanksource/deps@v1.0.26"
echo "Searching for postgrest specs in: $DEPS_DIR"
rg -n "postgrest" "$DEPS_DIR" -S --hidden --glob '*.{go,ts,yaml,yml,json,md,tmpl,template}*' || true
echo
# Also search for a "BinaryName" field in the postgrest-related spec file(s)
POST_FILES="$(rg -l "postgrest" "$DEPS_DIR" -S --hidden || true)"
echo "Candidate files: $(echo "$POST_FILES" | wc -l)"
echo "$POST_FILES" | head -n 20
for f in $(echo "$POST_FILES" | head -n 10); do
echo "---- $f ----"
# show a bounded window around occurrences
line="$(rg -n "postgrest" "$f" | head -n 1 | cut -d: -f1 || true)"
if [ -n "${line:-}" ]; then
start=$((line-80)); [ $start -lt 1 ] && start=1
end=$((line+80))
sed -n "${start},${end}p" "$f" | cat -n
else
sed -n '1,180p' "$f" | cat -n
fi
echo
done
# Finally, check whether deps normalizes WithBinDir to absolute paths (cwd dependence mitigation)
echo "== deps config: relative BinDir handling =="
CFG="$DEPS_DIR/pkg/config/config.go"
sed -n '80,140p' "$CFG" | cat -n || trueRepository: flanksource/commons-db
Length of output: 19487
🏁 Script executed:
#!/bin/bash
set -euo pipefail
DEPS_DIR="/home/jailuser/go/pkg/mod/github.com/flanksource/deps@v1.0.26"
echo "== postgrest entry in defaults.yaml (expanded context) =="
# show a larger window around the postgrest block
rg -n "postgrest:" "$DEPS_DIR/pkg/config/defaults.yaml" -n | head -n 5 || true
LINE="$(rg -n "postgrest:" "$DEPS_DIR/pkg/config/defaults.yaml" | head -n 1 | cut -d: -f1)"
start=$((LINE-20)); [ $start -lt 1 ] && start=1
end=$((LINE+60))
sed -n "${start},${end}p" "$DEPS_DIR/pkg/config/defaults.yaml" | cat -n
echo
echo "== Any other postgrest registry fields elsewhere? =="
rg -n "postgrest" "$DEPS_DIR/pkg/config/defaults.yaml" -n || true
echo
echo "== extract.FindBinaryInDir implementation =="
# Find extract package file containing FindBinaryInDir
EXTRACT_FILE="$(rg -l "func FindBinaryInDir" "$DEPS_DIR/pkg" | head -n 1 || true)"
echo "EXTRACT_FILE=$EXTRACT_FILE"
if [ -n "$EXTRACT_FILE" ]; then
sed -n '1,220p' "$EXTRACT_FILE" | cat -n | head -n 220
fi
echo
echo "== deps installer: where BinDir is normalized (filepath.Abs etc) =="
rg -n "filepath\.Abs\(.*BinDir|BinDir.*Abs|Abs\(.*BinDir|WithBinDir" "$DEPS_DIR/pkg/installer" -S || true
echo
echo "== deps installer.NewWithConfig / installer init around options =="
INIT_FILE="$(rg -l "func NewWithConfig" "$DEPS_DIR/pkg/installer" | head -n 1 || true)"
echo "INIT_FILE=$INIT_FILE"
if [ -n "$INIT_FILE" ]; then
sed -n '1,220p' "$INIT_FILE" | cat -n | head -n 220
sed -n '220,520p' "$INIT_FILE" | cat -n | head -n 300
fi
echo
echo "== Where createSymlinks / wrapper scripts name files (to see Windows extension) =="
# quick scan for ".exe" in installer
rg -n "\\.exe|exe\\b" "$DEPS_DIR/pkg/installer" -S || trueRepository: flanksource/commons-db
Length of output: 35751
🏁 Script executed:
#!/bin/bash
set -euo pipefail
DEPS_DIR="/home/jailuser/go/pkg/mod/github.com/flanksource/deps@v1.0.26"
# Find DefaultOptions()
rg -n "func DefaultOptions|DefaultOptions\(" "$DEPS_DIR/pkg/installer" -S --hidden || true
DEF_FILE="$(rg -l "func DefaultOptions" "$DEPS_DIR/pkg/installer" -S --hidden | head -n 1 || true)"
echo "DEF_FILE=$DEF_FILE"
if [ -n "${DEF_FILE:-}" ]; then sed -n '1,220p' "$DEF_FILE" | cat -n; fi
echo
echo "== Where Installer sets/overrides options.BinDir =="
# Search for ".BinDir" normalization/Abs
rg -n "Abs\\(.*BinDir|BinDir.*Abs\\(|IsAbs\\(.*BinDir" "$DEPS_DIR/pkg/installer" -S --hidden || true
echo
echo "== InstallResult BinDir assignment in installWithNewPackageManagerWithResult =="
# show around where result.BinDir set; already seen line 35-36, but show small window
sed -n '1100,1160p' "$DEPS_DIR/pkg/installer/installer.go" 2>/dev/null | cat -n || true
echo
echo "== Wrapper script template (if any) uses binDir; checks relative paths =="
# find createWrapperScript template content generation around BinDir usage
rg -n "binDir" "$DEPS_DIR/pkg/installer/installer.go" -S --hidden || trueRepository: flanksource/commons-db
Length of output: 10048
Clarify path construction from deps.Install result
deps.Installdoesn’t return the resolved executable path—InstallResultonly includesBinDir(no per-binaryPath), sofilepath.Join(result.BinDir, "postgrest")is consistent with how deps computes the installed target (finalPath := filepath.Join(i.options.BinDir, name)and wrapper/symlink names also usepkg.Name).- The earlier Windows
postgrest.execoncern doesn’t apply here: deps doesn’t append a.exeextension when installing/wrapping; it installs underBinDir/<package-name>. - Remaining concern:
deps.WithBinDir(".bin")leavesBinDirrelative (nofilepath.AbsinWithBinDir), so the resulting binary path is cwd-dependent; prefer an absolute bin dir.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@postgrest/postgrest.go` around lines 22 - 28, The install function currently
calls deps.Install("postgrest", config.Postgrest.Version,
deps.WithBinDir(".bin")) and then constructs the path with
filepath.Join(result.BinDir, "postgrest"), but WithBinDir(".bin") leaves BinDir
relative and makes the returned path cwd-dependent; update install to resolve
the bin dir to an absolute path before passing it to deps.Install (e.g., call
filepath.Abs on config-provided or ".bin"), pass deps.WithBinDir(absBin) into
deps.Install, then continue returning filepath.Join(result.BinDir, "postgrest");
keep the same join logic (no .exe handling) and reference the install function,
deps.Install call, result.BinDir, and deps.WithBinDir(".bin").
- ginkgo rejects flags after the package list; use 'ginkgo run' with flags before ./e2e - bump GO_VERSION/matrix to 1.26 to match go.mod (go 1.26.1) - upgrade actions/upload-artifact v3 -> v4 (v3 is auto-failed by GitHub)
The e2e ServiceManager was scaffolding: startXxx were TODO no-ops while AllHealthy did real port-dials, so AllHealthy never returned true and the BeforeSuite health gate timed out after 2m — the suite had never passed. Wire startPostgres to db.StartEmbedded (dynamic free port, waits for readiness) and gate AllHealthy on Postgres only, since that is the sole service actually started. The remaining specs assert on URL strings and locally-generated fixtures, not live Redis/OpenSearch/Loki/LocalStack, so no live instance is needed for them. Removes the dead start/health stubs for the unstarted services.
Installing the CLI with @latest pulled v2.29.0 against the v2.28.0 library in go.mod, which Ginkgo warns about and can mis-parse flags. 'go run github.com/onsi/ginkgo/v2/ginkgo' uses the module-pinned version.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/e2e.yml (1)
93-93: 💤 Low valueConsider pinning actions to commit SHAs for supply-chain security.
Static analysis flags
actions/upload-artifact@v4as unpinned. Pinning to a full commit SHA (e.g.,actions/upload-artifact@<sha>) prevents tag-based attacks where a malicious actor could move a tag to a compromised commit.Example:
- uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0Also applies to: 100-100
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/e2e.yml at line 93, The workflow currently uses an unpinned action reference actions/upload-artifact@v4 which is flagged for supply-chain risk; replace the tag with a pinned commit SHA (e.g., actions/upload-artifact@<full-commit-sha>) to lock the action to a specific commit, updating the single occurrence of actions/upload-artifact@v4 (and any other identical occurrences) in the e2e.yml workflow to use the full SHA instead of the floating tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/e2e.yml:
- Line 93: The workflow currently uses an unpinned action reference
actions/upload-artifact@v4 which is flagged for supply-chain risk; replace the
tag with a pinned commit SHA (e.g., actions/upload-artifact@<full-commit-sha>)
to lock the action to a specific commit, updating the single occurrence of
actions/upload-artifact@v4 (and any other identical occurrences) in the e2e.yml
workflow to use the full SHA instead of the floating tag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0d3d269a-ae33-498f-9113-188b085e0688
📒 Files selected for processing (2)
.github/workflows/e2e.ymle2e/helpers/services.go
./e2e is a test-only package, so 'go build ./e2e' fails with 'no non-test Go files' (exit 1 under bash -e). 'go test -c -o /dev/null' compiles the test binary without running it — the correct build check.
What
deps.InstallAPItask.GatedStderr()for stderr handlingWhy
Summary by CodeRabbit