Skip to content

feat: config_properties table#1466

Draft
adityathebe wants to merge 1 commit intomainfrom
feat/config-properties
Draft

feat: config_properties table#1466
adityathebe wants to merge 1 commit intomainfrom
feat/config-properties

Conversation

@adityathebe
Copy link
Copy Markdown
Member

related: flanksource/config-db#1559

Removed fields: []links (we can just add a new property with value as the URL), status, lastTransition, headline, hidden,

@adityathebe adityathebe requested a review from Copilot June 26, 2025 06:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new config_properties table for storing additional properties of config items and introduces the corresponding Go model.

  • Defines config_properties schema with columns, indexes, and a check constraint for text/value exclusivity
  • Implements ConfigProperty struct in Go with GORM mappings
  • Sets up foreign keys to config_items and config_scrapers

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
schema/config_properties.hcl Creates config_properties table with all necessary columns and constraints
models/config_properties.go Adds ConfigProperty struct, TableName, PK, and PKCols methods
Comments suppressed due to low confidence (2)

models/config_properties.go:11

  • New model ConfigProperty lacks unit or integration tests. Consider adding tests for CRUD operations and validation of the check constraint (text IS NOT NULL AND value IS NULL) OR (text IS NULL AND value IS NOT NULL).
type ConfigProperty struct {

models/config_properties.go:27

  • [nitpick] The field name Type maps to a column named type, which is a reserved word in many SQL dialects. It's clearer to add an explicit tag: gorm:"column:type;default:NULL" to ensure correct mapping.
	Type    string `json:"type,omitempty" gorm:"default:NULL"`

Comment thread schema/config_properties.hcl Outdated
Comment thread models/config_properties.go
@adityathebe adityathebe force-pushed the feat/config-properties branch 2 times, most recently from addc663 to 096addc Compare June 26, 2025 06:26
@adityathebe adityathebe force-pushed the feat/config-properties branch from 096addc to 0cae48b Compare June 26, 2025 06:59
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