Skip to content

feat(postgres): support user-defined labels - #561

Merged
rbjornstad merged 2 commits into
mainfrom
feature/postgres-user-labels
Oct 15, 2026
Merged

rbjornstad merged 2 commits into
mainfrom
feature/postgres-user-labels

Conversation

@rbjornstad

Copy link
Copy Markdown
Contributor

Summary

  • Add optional labels to CreatePostgresInput and UpdatePostgresInput.
  • Reuse existing label validation and merge behavior while preserving platform labels.
  • Add mutation tests and regenerate GraphQL code.

Validation

  • go test ./internal/persistence/postgres ./internal/graph/... passed.
  • mise run fmt ::: generate passed.
  • Full mise run test is blocked because sandbox policy denies Docker socket access.
  • GraphQL lint reports existing schema diagnostics, including unrelated ones in postgres.graphqls; none target the new input fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Accepted user labels can overwrite an existing platform-managed label.

1 open finding
What changed in this PR

Adds user-defined labels to Postgres create and update mutations using shared label validation and merging.

Changes:

  • Adds optional labels to GraphQL inputs and Go models.
  • Applies label changes and records updates in the activity log.
  • Adds label tests and regenerates GraphQL code.
File Description
internal/​persistence/​postgres/​queries.go Applies labels and records changes.
internal/​persistence/​postgres/​queries_test.go Tests validation, replacement, removal, and preservation.
internal/​persistence/​postgres/​models.go Adds label inputs and validation.
internal/​graph/​schema/​postgres.graphqls Exposes and documents label inputs.
internal/​graph/​gengql/​root_.generated.go Updates the embedded schema.
internal/​graph/​gengql/​postgres.generated.go Adds label input decoding.
Files not reviewed (1)
  • internal/graph/gengql/postgres.generated.go: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/persistence/postgres/queries.go
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved issues were identified, and regression tests cover label semantics and platform-label preservation.

0 open findings

1 resolved since last review
Files not reviewed (1)
  • internal/graph/gengql/postgres.generated.go: Generated file

🧠 Review effort: Balanced

@rbjornstad
rbjornstad marked this pull request as ready for review October 15, 2026 09:34
@rbjornstad
rbjornstad requested a review from a team as a code owner October 15, 2026 09:34
@rbjornstad
rbjornstad merged commit 421106c into main Oct 15, 2026
14 checks passed
@rbjornstad
rbjornstad deleted the feature/postgres-user-labels branch October 15, 2026 10:42
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.

3 participants