docs: fix broken links - #3084
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
📝 WalkthroughWalkthroughThe documentation updates replace obsolete relative links with current paths and replace hardcoded PostgreSQL connection details with placeholders. ChangesDocumentation navigation updates
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3084 +/- ##
=======================================
Coverage 76.29% 76.29%
=======================================
Files 83 83
Lines 9215 9215
=======================================
Hits 7030 7030
Misses 1635 1635
Partials 550 550 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@docs/operations/tracing.mdx`:
- Line 50: Update the PostgreSQL configuration example in the tracing
documentation to use the current schema with database.engine and database.uri
instead of database.write. Replace the URI placeholder with a valid database
name suffix such as /db_name, while preserving the existing placeholder host and
credentials.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5da40db2-a755-4dc0-b6a2-9cd4119b8b93
📒 Files selected for processing (8)
docs/api-reference/bundle/write-bundle.mdxdocs/getting-started/examples/facebook-groups.mdxdocs/getting-started/examples/instagram.mdxdocs/getting-started/examples/mercury.mdxdocs/getting-started/examples/notion.mdxdocs/operations/bundle.mdxdocs/operations/tracing.mdxdocs/permify-overview/faqs.mdx
| connection: 'postgres' | ||
| database: 'morf-health-demo' | ||
| uri: 'postgres://postgres:SphU4Uf3QXNntT@permify.us-east-1.rds.amazonaws.com:5432' | ||
| uri: 'postgres://postgres:yourpassword@your-host.rds.amazonaws.com:5432' |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- relevant files ---'
git ls-files | rg '(^|/)(configuration|config|tracing)\.(mdx?|ts|tsx|js|jsx|json|yaml|yml)$|postgres|database' | head -200
printf '%s\n' '--- documentation context ---'
sed -n '35,65p' docs/operations/tracing.mdx
sed -n '80,110p' docs/setting-up/configuration.mdx
printf '%s\n' '--- configuration symbols and PostgreSQL references ---'
rg -n -S 'morf-health-demo|postgres://|PostgreSQL|postgres|database\s*:' --glob '!node_modules' --glob '!dist' --glob '!build' . | head -300Repository: Permify/permify
Length of output: 37025
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- configuration definitions and loading ---'
rg -n -S 'type .*Config|type .*Database|Database struct|URI\s+string|database.*uri|NewWithSeparateURIs|conf\.Database|Database\.URI|Database\.Write' \
--glob '*.go' --glob '!**/*_test.go' . | head -300
printf '%s\n' '--- database construction call sites ---'
rg -n -S 'postgres\.New|NewWithSeparateURIs|New\(' pkg internal --glob '*.go' | head -250
printf '%s\n' '--- candidate configuration files ---'
fd -t f -e go . | rg '(^|/)(config|configuration|options|settings)(/|\.go$)' | head -150Repository: Permify/permify
Length of output: 36922
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- configuration structure and defaults ---'
sed -n '130,205p' internal/config/config.go
sed -n '1,130p' internal/factories/database.go
printf '%s\n' '--- PostgreSQL constructors ---'
sed -n '1,125p' pkg/database/postgres/postgres.go
printf '%s\n' '--- configuration decoding and migration paths ---'
rg -n -S 'mapstructure|Unmarshal|ReadInConfig|SetDefault|database\.write|database\.writer|database\.reader|write:' internal pkg --glob '*.go' --glob '!**/*_test.go' | head -250Repository: Permify/permify
Length of output: 41123
🌐 Web query:
pgx v5 pgxpool.ParseConfig PostgreSQL URI without database path default database name
💡 Result:
In pgx v5, if a PostgreSQL connection URI does not specify a database name (i.e., there is no path component after the host/port), the driver defaults to using the current operating system username as the database name [1][2]. This behavior follows the standard PostgreSQL connection logic (libpq), where the database name defaults to the user name if not explicitly provided [1][3]. When you use pgxpool.ParseConfig(connString), it internally calls pgx.ParseConfig, which applies these same resolution rules—merging default settings, environment variables, and the provided connection string [4][1][5]. If you need to change this behavior, you can manually modify the Database field in the pgxpool.Config object after calling ParseConfig but before creating the pool: config, err:= pgxpool.ParseConfig("postgres://user:password@localhost:5432/") if err!= nil { // handle error } // Manually set the default database name config.ConnConfig.Database = "my_actual_db" pool, err:= pgxpool.NewWithConfig(context.Background, config)
Citations:
- 1: https://github.com/jackc/pgx/blob/cc05954369991f8761280932ba76f41729533bb7/pgconn/config.go
- 2: https://github.com/jackc/pgx/blob/6067cfab4f674940e745d14579632430c2c33b32/conn.go
- 3: https://github.com/jackc/pgx/blob/master/pgconn/config.go
- 4: https://github.com/jackc/pgx/blob/master/pgxpool/pool.go
- 5: https://pkg.go.dev/github.com%2Fjackc%2Fpgx%2Fv5
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- pgx dependency version ---'
rg -n 'jackc/pgx|pgx/v5' go.mod go.sum | head -20
printf '%s\n' '--- full database examples using the legacy write block ---'
rg -n -S -A12 -B4 'database:\s*$|write:\s*$|database:\s*['"'"'"]' docs/operations docs/docs/reference docs/setting-up --glob '*.mdx' --glob '*.md' | head -250
printf '%s\n' '--- current configuration documentation around database settings ---'
sed -n '85,125p' docs/setting-up/configuration.mdx
sed -n '420,460p' docs/setting-up/configuration.mdxRepository: Permify/permify
Length of output: 18078
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- configuration defaults ---'
sed -n '205,290p' internal/config/config.go
sed -n '150,215p' pkg/cmd/serve.go
printf '%s\n' '--- read-only contract probe ---'
python3 - <<'PY'
from pathlib import Path
import re
doc = Path("docs/operations/tracing.mdx").read_text()
block = doc.split("```", 2)[1]
keys = []
for line in block.splitlines():
if line.startswith("database:"):
in_db = True
elif "in_db" in locals() and in_db and line and not line.startswith(" ") and not line.startswith("#"):
break
elif "in_db" in locals() and in_db:
m = re.match(r"^ ([A-Za-z_][A-Za-z0-9_]*):", line)
if m:
keys.append(m.group(1))
config_text = Path("internal/config/config.go").read_text()
allowed = set(re.findall(r'mapstructure:"([^"]+)"', config_text))
print("database block child keys:", keys)
print("recognized config keys:", sorted(allowed & set(keys)))
print("unrecognized database block child keys:", sorted(set(keys) - allowed))
PYRepository: Permify/permify
Length of output: 6005
Use the current PostgreSQL configuration schema.
database.write is unsupported. Use database.engine and database.uri with placeholder values. Include /db_name in the URI because pgx otherwise derives the database name from the operating-system user.
🤖 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 `@docs/operations/tracing.mdx` at line 50, Update the PostgreSQL configuration
example in the tracing documentation to use the current schema with
database.engine and database.uri instead of database.write. Replace the URI
placeholder with a valid database name suffix such as /db_name, while preserving
the existing placeholder host and credentials.
Summary by CodeRabbit