Skip to content

feat: update db pooling to handle iam rds auth, move DatabaseConfigur…#2582

Open
mamundsen-specter wants to merge 9 commits intomainfrom
bi-1306
Open

feat: update db pooling to handle iam rds auth, move DatabaseConfigur…#2582
mamundsen-specter wants to merge 9 commits intomainfrom
bi-1306

Conversation

@mamundsen-specter
Copy link
Copy Markdown

@mamundsen-specter mamundsen-specter commented Apr 2, 2026

https://specterops.atlassian.net/browse/BI-1348
https://specterops.atlassian.net/browse/BI-1306

Bloodhound changes to enable RDS IAM auth. Coincides with SpecterOps/DAWGS#32

Updates PostgresConnectionString() to fetch an IAM auth token and encode it before adding it to the password of the return postgres connection string.

Updates NewPool() calls coinciding with DAWGs newpool change

Updates OpenDatabase() to pass pgxpool to Gorm.

Motivation and Context

Enabling IAM auth allows us to get away from basic password authentication to the database. This frees us up from a infrastructure resource perspective and can move us towards better density in the cluster.

PoC tenants have been created. These are in the process of being updated and recreated.

Chore (a change that does not modify the application functionality)
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Database Migrations

Screenshots (optional):

Types of changes

  • Chore (a change that does not modify the application functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Summary by CodeRabbit

  • Refactor
    • Centralized database configuration usage across the app, services, and tools for consistent connection handling; no user-facing behavior changes.
  • Tests
    • Updated integration and test harness setups to use the centralized configuration for database and graph environments.
  • Chores
    • Bumped internal module versions and aligned tooling to the new configuration approach.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Replaces direct PostgreSQL connection-string usage with a shared drivers.DatabaseConfiguration across the codebase: removes the local DatabaseConfiguration type, updates configuration construction to use config.NewDefaultConfiguration(), and changes DB/pool openers and related callers/tests to accept or pass cfg.Database.

Changes

Cohort / File(s) Summary
Config type & defaults
cmd/api/src/config/config.go, cmd/api/src/config/default.go
Removed the project-local DatabaseConfiguration and helper methods; Configuration.Database and Configuration.Neo4J now use dawgs.DatabaseConfiguration and defaults updated accordingly.
Database core API
cmd/api/src/database/db.go
OpenDatabase signature changed to accept drivers.DatabaseConfiguration; constructs pgx pool via pg.NewPool(cfg) and initializes GORM from that pool.
API / bootstrap / entrypoint
cmd/api/src/api/tools/pg.go, cmd/api/src/bootstrap/util.go, cmd/api/src/services/entrypoint.go
Switched pool and DB creation to pass cfg.Database (config object) instead of raw connection strings; dawgs.Config.ConnectionString still set from connection string where used.
CLI / Dawgs test harness
cmd/api/src/cmd/dawgs-harness/main.go
RunTestSuite signature updated to accept drivers.DatabaseConfiguration; harness now builds config.NewDefaultConfiguration() and passes cfg.Database into pg pool creation.
Daemons & integration tests
cmd/api/src/daemons/..., cmd/api/src/database/..., cmd/api/src/queries/..., cmd/api/src/services/graphify/..., packages/go/...
Many integration tests and daemons now call config.NewDefaultConfiguration(), set cfg.Database.Connection, assert no config errors, and pass cfg.Database to pg.NewPool / database.OpenDatabase instead of raw URLs.
Graphify package
packages/go/graphify/graph/graph.go
GraphService.InitializeService and helpers now accept config.Configuration; graph DB initialization uses cfg.Database and sets dawgs.Config.ConnectionString from the config.
Test harness / fixtures / dawgs wiring
cmd/api/src/test/..., cmd/api/src/test/lab/fixtures/postgres.go, cmd/api/src/test/integration/dawgs.go
Fixtures and test helpers updated to use labConfig.Database / cfg.Database for OpenDatabase and pg pool creation; dawgs.Open still receives a connection string sourced from config.
Dependency updates
go.mod
Bumped github.com/specterops/dawgs version and added indirect AWS SDK v2 / github.com/aws/smithy-go requirements.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • computator
  • ALCooper12
  • rvazarkar
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description includes Jira references, motivation context, and a summary of changes, but lacks structured sections from the template. Reorganize the description to follow the template structure with clear 'Description', 'Motivation and Context', 'How Has This Been Tested', and 'Types of changes' sections. Ensure all checklist items are properly addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately summarizes the main change: updating database pooling for IAM RDS authentication and moving DatabaseConfiguration type.

✏️ 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 bi-1306

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.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Apr 2, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/api/src/test/integration/dawgs.go (1)

59-63: ⚠️ Potential issue | 🔴 Critical

Pool may connect to a different database than DAWGS in this test path.

pgtestdb.Custom(...) returns a per-test DB URL, but the pool is created from cfg.Database before cfg.Database.Connection is updated. This can cause Pool and ConnectionString to point at different DBs.

Proposed fix
 	case pg.DriverName:
 		connConf := pgtestdb.Custom(t, GetPostgresConfig(cfg), pgtestdb.NoopMigrator{})
+		cfg.Database.Connection = connConf.URL()
 		pool, err := pg.NewPool(cfg.Database)
 		test.RequireNilErrf(t, err, "Failed to create new pgx pool: %v", err)
 		graphDatabase, err = dawgs.Open(context.Background(), cfg.GraphDriver, dawgs.Config{
-			ConnectionString: connConf.URL(),
+			ConnectionString: cfg.Database.Connection,
 			Pool:             pool,
 		})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/api/src/test/integration/dawgs.go` around lines 59 - 63, The test creates
the pg pool from cfg.Database before cfg.Database.Connection is updated to the
per-test URL, causing pg.NewPool and dawgs.Open to point at different DBs; fix
by ensuring the pool is created using the same per-test connection string (i.e.,
update cfg.Database.Connection or obtain the test DB URL first) before calling
pg.NewPool so that the Pool passed into dawgs.Open and the ConnectionString in
dawgs.Config are identical (update the sequence around pg.NewPool,
cfg.Database.Connection, and dawgs.Open to use the same URL).
🧹 Nitpick comments (2)
cmd/api/src/config/config.go (1)

34-34: Consider using lowercase alias for import.

The import alias Dawgs uses PascalCase, but Go convention prefers lowercase for import aliases (e.g., dawgs or drivers). This also makes it visually distinct from type names.

♻️ Suggested fix
-	Dawgs "github.com/specterops/dawgs/drivers"
+	"github.com/specterops/dawgs/drivers"

Then update usages to drivers.DatabaseConfiguration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/api/src/config/config.go` at line 34, Change the import alias from
`Dawgs` to a lowercase alias (e.g., `drivers` or `dawgs`) and update all usages
accordingly; for example, replace references like `Dawgs.DatabaseConfiguration`
with `drivers.DatabaseConfiguration` (or `dawgs.DatabaseConfiguration`) and
adjust any other occurrences of the `Dawgs` symbol in this package to the new
lowercase alias.
cmd/api/src/services/graphify/test/test.go (1)

104-116: LGTM - Test setup updated for configuration-driven pattern.

The test correctly creates a minimal configuration and populates cfg.Database.Connection before passing to pg.NewPool().

Minor note: Line 114 could use cfg.Database.Connection instead of connConf.URL() for consistency, though functionally identical.

♻️ Optional consistency improvement
 	graphDB, err := dawgs.Open(ctx, pg.DriverName, dawgs.Config{
 		GraphQueryMemoryLimit: 1024 * 1024 * 1024 * 2,
-		ConnectionString:      connConf.URL(),
+		ConnectionString:      cfg.Database.Connection,
 		Pool:                  pool,
 	})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/api/src/services/graphify/test/test.go` around lines 104 - 116, Replace
the direct use of connConf.URL() in the dawgs.Open call with the
already-populated cfg.Database.Connection for consistency: update the dawgs.Open
invocation (the ConnectionString field in dawgs.Config) to use
cfg.Database.Connection so the test consistently uses the same configuration
source as pg.NewPool and avoids mixing sources.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/api/src/daemons/changelog/changelog_e2e/main.go`:
- Around line 82-85: The error path in the startup uses
config.NewDefaultConfiguration() and currently calls slog.Error("Error creating
new default configuration") without the actual err; update the failure handling
for config.NewDefaultConfiguration() to include the err value in the log (e.g.,
pass err as a field or append its message) so the slog.Error call records the
underlying error before calling os.Exit(1).

---

Outside diff comments:
In `@cmd/api/src/test/integration/dawgs.go`:
- Around line 59-63: The test creates the pg pool from cfg.Database before
cfg.Database.Connection is updated to the per-test URL, causing pg.NewPool and
dawgs.Open to point at different DBs; fix by ensuring the pool is created using
the same per-test connection string (i.e., update cfg.Database.Connection or
obtain the test DB URL first) before calling pg.NewPool so that the Pool passed
into dawgs.Open and the ConnectionString in dawgs.Config are identical (update
the sequence around pg.NewPool, cfg.Database.Connection, and dawgs.Open to use
the same URL).

---

Nitpick comments:
In `@cmd/api/src/config/config.go`:
- Line 34: Change the import alias from `Dawgs` to a lowercase alias (e.g.,
`drivers` or `dawgs`) and update all usages accordingly; for example, replace
references like `Dawgs.DatabaseConfiguration` with
`drivers.DatabaseConfiguration` (or `dawgs.DatabaseConfiguration`) and adjust
any other occurrences of the `Dawgs` symbol in this package to the new lowercase
alias.

In `@cmd/api/src/services/graphify/test/test.go`:
- Around line 104-116: Replace the direct use of connConf.URL() in the
dawgs.Open call with the already-populated cfg.Database.Connection for
consistency: update the dawgs.Open invocation (the ConnectionString field in
dawgs.Config) to use cfg.Database.Connection so the test consistently uses the
same configuration source as pg.NewPool and avoids mixing sources.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 80bd70f6-7c3a-407d-a490-57a3f7b5b320

📥 Commits

Reviewing files that changed from the base of the PR and between d52f787 and ddbc30f.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (21)
  • cmd/api/src/api/tools/pg.go
  • cmd/api/src/bootstrap/util.go
  • cmd/api/src/cmd/dawgs-harness/main.go
  • cmd/api/src/config/config.go
  • cmd/api/src/config/default.go
  • cmd/api/src/daemons/changelog/changelog_e2e/main.go
  • cmd/api/src/daemons/changelog/ingestion_integration_test.go
  • cmd/api/src/daemons/datapipe/datapipe_integration_test.go
  • cmd/api/src/database/database_integration_test.go
  • cmd/api/src/database/db.go
  • cmd/api/src/database/migration/extensions_integration_test.go
  • cmd/api/src/queries/queries_integration_test.go
  • cmd/api/src/services/entrypoint.go
  • cmd/api/src/services/graphify/graphify_integration_test.go
  • cmd/api/src/services/graphify/test/test.go
  • cmd/api/src/test/integration/database.go
  • cmd/api/src/test/integration/dawgs.go
  • cmd/api/src/test/lab/fixtures/postgres.go
  • go.mod
  • packages/go/analysis/analysis_integration_test.go
  • packages/go/graphify/graph/graph.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
cmd/api/src/database/database_integration_test.go (1)

53-56: Consider hoisting new initializations into the function’s var block.

The new declarations on Line 58 and Line 65 can be grouped with existing top-of-function declarations for consistency with repository style.

Suggested refactor
 var (
-	ctx      = context.Background()
-	connConf = pgtestdb.Custom(t, getPostgresConfig(t), pgtestdb.NoopMigrator{})
+	ctx      = context.Background()
+	connConf = pgtestdb.Custom(t, getPostgresConfig(t), pgtestdb.NoopMigrator{})
+	cfg      config.Configuration
+	gormDB   *gorm.DB
+	err      error
 )
 
-cfg, err := config.NewDefaultConfiguration()
+cfg, err = config.NewDefaultConfiguration()
 if err != nil {
-	t.Errorf("Failed to create default configuration")
+	t.Errorf("Failed to create default configuration")
 }
 cfg.Database.Connection = connConf.URL()
 
-gormDB, err := database.OpenDatabase(cfg.Database)
+gormDB, err = database.OpenDatabase(cfg.Database)
 require.NoError(t, err)

As per coding guidelines: "Group variable initializations in a var ( ... ) block and hoist them to the top of the function when possible".

Also applies to: 58-65

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/api/src/database/database_integration_test.go` around lines 53 - 56,
Hoist the two new local declarations currently defined later in the function
(the ones on Lines 58 and 65) into the existing top-of-function var block
alongside ctx and connConf so all test locals are grouped; update the var ( ...
) block that contains ctx and connConf to include those new variable names and
their initializations, and remove the later standalone declarations so only the
single grouped var block declares these locals.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/api/src/cmd/dawgs-harness/main.go`:
- Around line 146-149: The error path after calling
config.NewDefaultConfiguration() currently prints a generic message; update the
failure branch in main (where cfg, err := config.NewDefaultConfiguration() is
checked) to include the underlying err details in the output (e.g., format the
error into the log message or write to stderr) so the real cause is visible
before calling os.Exit(1).

In `@cmd/api/src/daemons/datapipe/datapipe_integration_test.go`:
- Around line 71-74: The test helper is using t.Errorf which allows execution to
continue with an invalid cfg; change the failure to stop immediately by
replacing the t.Errorf call after cfg, err := config.NewDefaultConfiguration()
with a fatal assertion (e.g., t.Fatalf or require.NoError from testify) so
setupIntegrationTestSuite exits on configuration errors; ensure you reference
cfg and config.NewDefaultConfiguration in the updated check and remove any
subsequent code that assumes cfg is valid when err != nil.

In `@cmd/api/src/database/database_integration_test.go`:
- Around line 58-61: The test currently logs an error but continues when
config.NewDefaultConfiguration() fails, leaving cfg invalid; update the test to
fail fast by replacing the t.Errorf call with t.Fatalf (or use a test helper
like require.NoError) so the test stops immediately on error when cfg is
nil/invalid after calling config.NewDefaultConfiguration().

---

Nitpick comments:
In `@cmd/api/src/database/database_integration_test.go`:
- Around line 53-56: Hoist the two new local declarations currently defined
later in the function (the ones on Lines 58 and 65) into the existing
top-of-function var block alongside ctx and connConf so all test locals are
grouped; update the var ( ... ) block that contains ctx and connConf to include
those new variable names and their initializations, and remove the later
standalone declarations so only the single grouped var block declares these
locals.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: d4b157e2-c37b-4f7d-9dad-e227bdbeb98c

📥 Commits

Reviewing files that changed from the base of the PR and between 9ac8a49 and 567efbc.

📒 Files selected for processing (11)
  • cmd/api/src/cmd/dawgs-harness/main.go
  • cmd/api/src/daemons/changelog/changelog_e2e/main.go
  • cmd/api/src/daemons/changelog/ingestion_integration_test.go
  • cmd/api/src/daemons/datapipe/datapipe_integration_test.go
  • cmd/api/src/database/database_integration_test.go
  • cmd/api/src/database/migration/extensions_integration_test.go
  • cmd/api/src/queries/queries_integration_test.go
  • cmd/api/src/services/graphify/graphify_integration_test.go
  • cmd/api/src/services/graphify/test/test.go
  • packages/go/analysis/analysis_integration_test.go
  • packages/go/graphify/graph/graph.go
✅ Files skipped from review due to trivial changes (1)
  • cmd/api/src/database/migration/extensions_integration_test.go
🚧 Files skipped from review as they are similar to previous changes (7)
  • cmd/api/src/services/graphify/test/test.go
  • cmd/api/src/daemons/changelog/changelog_e2e/main.go
  • cmd/api/src/services/graphify/graphify_integration_test.go
  • packages/go/analysis/analysis_integration_test.go
  • cmd/api/src/daemons/changelog/ingestion_integration_test.go
  • packages/go/graphify/graph/graph.go
  • cmd/api/src/queries/queries_integration_test.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
cmd/api/src/database/migration/extensions_integration_test.go (1)

56-60: Hoist configuration variable declaration into the existing var block.

Line [56] introduces cfg mid-function; this can be grouped with the existing declarations at the top for consistency with repo conventions.

♻️ Suggested refactor
 func setupIntegrationTestSuite(t *testing.T) IntegrationTestSuite {
 	t.Helper()

 	var (
-		ctx      = context.Background()
-		connConf = pgtestdb.Custom(t, getPostgresConfig(t), pgtestdb.NoopMigrator{})
-		gormDB   *gorm.DB
-		db       *database.BloodhoundDB
-		err      error
+		ctx                   = context.Background()
+		connConf              = pgtestdb.Custom(t, getPostgresConfig(t), pgtestdb.NoopMigrator{})
+		testConfiguration     config.Configuration
+		gormDB                *gorm.DB
+		db                    *database.BloodhoundDB
+		err                   error
 	)

-	cfg, err := config.NewDefaultConfiguration()
+	testConfiguration, err = config.NewDefaultConfiguration()
 	require.NoError(t, err)

-	cfg.Database.Connection = connConf.URL()
+	testConfiguration.Database.Connection = connConf.URL()
@@
-	gormDB, err = database.OpenDatabase(cfg.Database)
+	gormDB, err = database.OpenDatabase(testConfiguration.Database)

As per coding guidelines "Group variable initializations in a var ( ... ) block and hoist them to the top of the function when possible" and "Prefer rich variable names, for example: databaseInterface instead of di or dbi".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/api/src/database/migration/extensions_integration_test.go` around lines
56 - 60, The cfg variable is declared mid-function; hoist its initialization
into the existing var block at the top of the test to follow the repo
convention. Replace the inline cfg, err := config.NewDefaultConfiguration() and
subsequent cfg.Database.Connection = connConf.URL() with cfg and err variables
declared inside the existing var ( ... ) block, then assign cfg using
config.NewDefaultConfiguration() and set cfg.Database.Connection =
connConf.URL() before use (keep the function names
config.NewDefaultConfiguration and connConf.URL to locate the change).
packages/go/graphify/graph/graph.go (1)

207-212: Use a richer variable name and hoist declarations in Run.

Line [207] introduces dbcfg via short declaration; prefer a descriptive name and top-level grouped declarations for readability and consistency.

♻️ Suggested refactor
 func (s *Command) Run() error {
-	ctx, cancel := context.WithCancel(context.Background())
+	var (
+		databaseConfiguration config.Configuration
+		err                   error
+	)
+
+	ctx, cancel := context.WithCancel(context.Background())
@@
-	dbcfg, err := config.NewDefaultConfiguration()
+	databaseConfiguration, err = config.NewDefaultConfiguration()
 	if err != nil {
 		return fmt.Errorf("failed to create default configuration: %w", err)
 	}
-	dbcfg.Database.Connection = s.env[environment.PostgresConnectionVarName]
+	databaseConfiguration.Database.Connection = s.env[environment.PostgresConnectionVarName]
 
-	if graphDB, err := initializeGraphDatabase(ctx, dbcfg); err != nil {
+	if graphDB, err := initializeGraphDatabase(ctx, databaseConfiguration); err != nil {
 		return fmt.Errorf("error connecting to graphDB: %w", err)
-	} else if err := s.service.InitializeService(ctx, dbcfg, graphDB); err != nil {
+	} else if err := s.service.InitializeService(ctx, databaseConfiguration, graphDB); err != nil {
 		return fmt.Errorf("error connecting to database: %w", err)

As per coding guidelines "Group variable initializations in a var ( ... ) block and hoist them to the top of the function when possible" and "Prefer rich variable names, for example: databaseInterface instead of di or dbi".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/go/graphify/graph/graph.go` around lines 207 - 212, In Run, replace
the short declaration dbcfg with a clearer name (e.g., databaseConfig or
defaultDatabaseConfig) and hoist its declaration into a grouped var block at the
top of the function along with err and any other locals; then call
config.NewDefaultConfiguration() with an assignment to the hoisted variable
(databaseConfig, err = config.NewDefaultConfiguration()), check err as before,
and continue using databaseConfig.Database.Connection =
s.env[environment.PostgresConnectionVarName] (update all references from dbcfg
to the new name). Ensure you do not re-declare variables with := inside Run so
the grouped declarations are used consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cmd/api/src/database/migration/extensions_integration_test.go`:
- Around line 56-60: The cfg variable is declared mid-function; hoist its
initialization into the existing var block at the top of the test to follow the
repo convention. Replace the inline cfg, err := config.NewDefaultConfiguration()
and subsequent cfg.Database.Connection = connConf.URL() with cfg and err
variables declared inside the existing var ( ... ) block, then assign cfg using
config.NewDefaultConfiguration() and set cfg.Database.Connection =
connConf.URL() before use (keep the function names
config.NewDefaultConfiguration and connConf.URL to locate the change).

In `@packages/go/graphify/graph/graph.go`:
- Around line 207-212: In Run, replace the short declaration dbcfg with a
clearer name (e.g., databaseConfig or defaultDatabaseConfig) and hoist its
declaration into a grouped var block at the top of the function along with err
and any other locals; then call config.NewDefaultConfiguration() with an
assignment to the hoisted variable (databaseConfig, err =
config.NewDefaultConfiguration()), check err as before, and continue using
databaseConfig.Database.Connection =
s.env[environment.PostgresConnectionVarName] (update all references from dbcfg
to the new name). Ensure you do not re-declare variables with := inside Run so
the grouped declarations are used consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: a9d19d98-bf8c-40b0-9d14-d342714f7b11

📥 Commits

Reviewing files that changed from the base of the PR and between 567efbc and 4109ba8.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (12)
  • cmd/api/src/cmd/dawgs-harness/main.go
  • cmd/api/src/daemons/changelog/changelog_e2e/main.go
  • cmd/api/src/daemons/changelog/ingestion_integration_test.go
  • cmd/api/src/daemons/datapipe/datapipe_integration_test.go
  • cmd/api/src/database/database_integration_test.go
  • cmd/api/src/database/migration/extensions_integration_test.go
  • cmd/api/src/queries/queries_integration_test.go
  • cmd/api/src/services/graphify/graphify_integration_test.go
  • cmd/api/src/services/graphify/test/test.go
  • go.mod
  • packages/go/analysis/analysis_integration_test.go
  • packages/go/graphify/graph/graph.go
✅ Files skipped from review due to trivial changes (1)
  • cmd/api/src/daemons/datapipe/datapipe_integration_test.go
🚧 Files skipped from review as they are similar to previous changes (8)
  • cmd/api/src/services/graphify/graphify_integration_test.go
  • cmd/api/src/queries/queries_integration_test.go
  • cmd/api/src/database/database_integration_test.go
  • cmd/api/src/daemons/changelog/ingestion_integration_test.go
  • cmd/api/src/cmd/dawgs-harness/main.go
  • cmd/api/src/daemons/changelog/changelog_e2e/main.go
  • packages/go/analysis/analysis_integration_test.go
  • cmd/api/src/services/graphify/test/test.go

@mamundsen-specter mamundsen-specter force-pushed the bi-1306 branch 2 times, most recently from 2a42978 to ab31174 Compare April 3, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant