Skip to content

chore(deps): update dependencies and refactor postgrest#19

Merged
moshloop merged 8 commits into
mainfrom
chore/deps-postgrest-refactor
May 31, 2026
Merged

chore(deps): update dependencies and refactor postgrest#19
moshloop merged 8 commits into
mainfrom
chore/deps-postgrest-refactor

Conversation

@moshloop

@moshloop moshloop commented May 31, 2026

Copy link
Copy Markdown
Member

What

  • Update dependencies: doublestar, clicky, and add flanksource/deps
  • Refactor postgrest to use new deps.Install API
  • Update cache package to use task.GatedStderr() for stderr handling

Why

  • Align with new clicky task execution model
  • Improve dependency management practices

Summary by CodeRabbit

  • Chores
    • Updated dependencies across cloud SDKs, OpenTelemetry, and internal libraries.
  • Bug Fixes
    • Improved logging granularity for database index operations.
    • Routed cache debug output through gated debug channel to reduce noisy stderr messages.
  • Refactor
    • Streamlined PostgREST initialization and environment handling for more reliable startup.
  • Tests
    • E2E suite simplified to run with embedded Postgres; CI workflow updated to Go 1.26 and adjusted test runner invocation.

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.
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@moshloop, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 470c4718-912e-4ef2-8480-f552780f37a0

📥 Commits

Reviewing files that changed from the base of the PR and between db5a22a and 95c8cb9.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yml
  • postgrest/postgrest.go

Walkthrough

This 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.

Changes

Maintenance and Operational Updates

Layer / File(s) Summary
Direct and Indirect Dependency Updates
go.mod
Go module dependencies are upgraded across direct and indirect requirements: Google Cloud BigQuery, Azure SDK, AWS SDK v2 services and credentials, OpenTelemetry core/trace/contrib modules, internal flanksource libraries (clicky, commons, is-healthy), database drivers (go-sqlite3), serialization (ojg), and transitive dependencies including Kubernetes libraries, envoyproxy components, and Google genproto/protobuf artifacts.
Index Operation SQL Logging Level
gorm/logger.go
SqlLogger.Trace now routes create/alter/drop statements that mention indexes to commons.Debug instead of l.baseLevel; other create/alter/drop statements remain at l.baseLevel.
Cache Debug Output Routing
llm/cache/cache.go
Cache Clear() and cleanupExpired() now write debug/error messages to task.GatedStderr() (import github.com/flanksource/clicky/task) instead of os.Stderr.
PostgREST Binary Installation and Environment Configuration
postgrest/postgrest.go
Add install() to provision the postgrest binary and envFor() to build PGRST_* env vars; Start and GoOffline use exec.NewExec(bin).WithEnv(...).Start()/Run() with these helpers.
E2E Workflow: Go 1.26 & Ginkgo Invocation
.github/workflows/e2e.yml
CI e2e workflow updated to Go 1.26, Ginkgo run invoked via go run github.com/onsi/ginkgo/v2/ginkgo, and artifact upload actions bumped to actions/upload-artifact@v4.
E2E ServiceManager: Embedded Postgres Only
e2e/helpers/services.go
ServiceManager now starts/stops only embedded Postgres, stores embedded DSN and stop func, derives TCP port from DSN for readiness checks, and removes prior process-kill shutdown and non-Postgres stubs.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: dependency updates across multiple packages and a postgrest refactor with cache/logging improvements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/deps-postgrest-refactor
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/deps-postgrest-refactor

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

socket-security Bot commented May 31, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang.org/​x/​oauth2@​v0.34.0 ⏵ v0.36.071 +1100100100100
Updatedgithub.com/​aws/​aws-sdk-go-v2@​v1.41.1 ⏵ v1.41.671100100100100
Updatedgithub.com/​flanksource/​commons@​v1.51.0 ⏵ v1.52.071 +1100100100100
Updatedgithub.com/​Azure/​azure-sdk-for-go/​sdk/​azcore@​v1.19.1 ⏵ v1.21.071 +1100100100100
Updatedgithub.com/​flanksource/​clicky@​v1.21.7 ⏵ v1.21.1173 +1100100100100
Updatedgolang.org/​x/​crypto@​v0.48.0 ⏵ v0.49.074100100100100
Updatedgithub.com/​ohler55/​ojg@​v1.28.0 ⏵ v1.28.174 +1100100100100
Updatedk8s.io/​apimachinery@​v0.35.2 ⏵ v0.35.474 +1100100100100
Updatedcloud.google.com/​go/​bigquery@​v1.69.0 ⏵ v1.72.074 +1100100100100
Updatedgoogle.golang.org/​grpc@​v1.76.0 ⏵ v1.79.375 +1100 +75100100100
Updatedk8s.io/​client-go@​v0.35.2 ⏵ v0.35.47510010075100
Updatedgithub.com/​mattn/​go-sqlite3@​v1.14.30 ⏵ v1.14.389610010075100
Updatedgo.opentelemetry.io/​otel@​v1.41.0 ⏵ v1.42.076 +1100 +2100100100
Updatedk8s.io/​api@​v0.35.2 ⏵ v0.35.476100100100100
Updatedgoogle.golang.org/​api@​v0.252.0 ⏵ v0.269.079 +1100100100100
Updatedgithub.com/​Azure/​azure-sdk-for-go/​sdk/​azidentity@​v1.13.0 ⏵ v1.13.186 -1100100100100
Updatedgithub.com/​aws/​aws-sdk-go-v2/​config@​v1.32.9 ⏵ v1.32.1688 +1100100100100
Updatedcloud.google.com/​go/​logging@​v1.13.0 ⏵ v1.13.193 +1100100100100
Addedgithub.com/​flanksource/​deps@​v1.0.2693100100100100
Updatedgolang.org/​x/​exp@​v0.0.0-20260218203240-3dfff04db8fa ⏵ v0.0.0-20260312153236-7ab1446f8b9094100100100100
Updatedgithub.com/​flanksource/​gomplate/​v3@​v3.24.77 ⏵ v3.24.8194 +1100100100100
Updatedgithub.com/​itchyny/​gojq@​v0.12.18 ⏵ v0.12.1998 +1100100100100
Updatedgithub.com/​aws/​aws-sdk-go-v2/​credentials@​v1.19.9 ⏵ v1.19.1598 +1100100100100
Updatedgithub.com/​aws/​aws-sdk-go-v2/​service/​sts@​v1.41.6 ⏵ v1.42.098 +1100100100100
Updatedgithub.com/​flanksource/​is-healthy@​v1.0.86 ⏵ v1.0.8799 +1100100100100
Updatedk8s.io/​klog/​v2@​v2.130.1 ⏵ v2.140.099 +1100100100100
Updatedgolang.org/​x/​sync@​v0.19.0 ⏵ v0.20.099100100100100
Updatedgo.opentelemetry.io/​otel/​trace@​v1.41.0 ⏵ v1.42.0100 +1100100100100
Updatedgithub.com/​bmatcuk/​doublestar/​v4@​v4.8.1 ⏵ v4.9.1100 +1100100100100

View full report

moshloop added 2 commits May 31, 2026 14:08
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between f297d21 and fcd49ba.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • go.mod
  • gorm/logger.go
  • llm/cache/cache.go
  • postgrest/postgrest.go

Comment thread go.mod
Comment thread postgrest/postgrest.go
Comment on lines +22 to +28
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
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 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' || true

Repository: 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'
done

Repository: 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"
fi

Repository: 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."
fi

Repository: 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
done

Repository: 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 || true

Repository: 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 || true

Repository: 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 || true

Repository: 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 || true

Repository: flanksource/commons-db

Length of output: 10048


Clarify path construction from deps.Install result

  • deps.Install doesn’t return the resolved executable path—InstallResult only includes BinDir (no per-binary Path), so filepath.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 use pkg.Name).
  • The earlier Windows postgrest.exe concern doesn’t apply here: deps doesn’t append a .exe extension when installing/wrapping; it installs under BinDir/<package-name>.
  • Remaining concern: deps.WithBinDir(".bin") leaves BinDir relative (no filepath.Abs in WithBinDir), 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").

moshloop added 3 commits May 31, 2026 17:24
- 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/e2e.yml (1)

93-93: 💤 Low value

Consider pinning actions to commit SHAs for supply-chain security.

Static analysis flags actions/upload-artifact@v4 as 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.0

Also 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

📥 Commits

Reviewing files that changed from the base of the PR and between fcd49ba and db5a22a.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yml
  • e2e/helpers/services.go

moshloop added 2 commits May 31, 2026 19:11
./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.
@moshloop moshloop merged commit 5cbc232 into main May 31, 2026
11 checks passed
@moshloop moshloop deleted the chore/deps-postgrest-refactor branch May 31, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant