Skip to content

feat(agentd): support configured db schema#103

Merged
EfeDurmaz16 merged 1 commit into
mainfrom
fides-agentd-db-schema
May 6, 2026
Merged

feat(agentd): support configured db schema#103
EfeDurmaz16 merged 1 commit into
mainfrom
fides-agentd-db-schema

Conversation

@EfeDurmaz16

Copy link
Copy Markdown
Owner

Summary

  • add AGENTD_DB_SCHEMA support by applying a validated Postgres search_path to authority store clients
  • create the configured authority schema before migrations run
  • wire Docker Compose to place agentd authority tables in a dedicated agentd schema
  • document the env var and cover unsafe schema names plus configured schema creation

Verification

  • pnpm --filter @fides/agentd test
  • pnpm --filter @fides/agentd lint
  • pnpm build
  • git diff --check
  • POSTGRES_PASSWORD=fides docker compose config >/tmp/fides-compose-agentd-schema.yml && rg -n "AGENTD_DB_SCHEMA|agentd:" /tmp/fides-compose-agentd-schema.yml

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd170edd94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

assertValidAuthoritySchemaName(schemaName)

const url = new URL(connectionString)
url.searchParams.set('options', `-c search_path=${schemaName},public`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Quote the configured schema in the search path

When AGENTD_DB_SCHEMA contains uppercase letters, the migration creates a quoted mixed-case schema via CREATE SCHEMA ... "${schemaName}", but the connection option here sets an unquoted search_path. Postgres folds unquoted identifiers to lowercase, so a value like AgentD creates schema "AgentD" while the client searches agentd,public, causing the authority tables to be created/read from public instead of the configured schema. Either reject non-lowercase names or quote/escape the schema consistently in the search path.

Useful? React with 👍 / 👎.

@EfeDurmaz16 EfeDurmaz16 merged commit 7e52774 into main May 6, 2026
9 checks passed
@EfeDurmaz16 EfeDurmaz16 deleted the fides-agentd-db-schema branch May 6, 2026 19:28
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.

2 participants