Skip to content

feat(OG): Add helper methods to schema_findings BED-7511#2410

Open
mistahj67 wants to merge 8 commits intorefactor-rel-findings-to-findingsfrom
refactor-rel-findings-4
Open

feat(OG): Add helper methods to schema_findings BED-7511#2410
mistahj67 wants to merge 8 commits intorefactor-rel-findings-to-findingsfrom
refactor-rel-findings-4

Conversation

@mistahj67
Copy link
Contributor

@mistahj67 mistahj67 commented Feb 24, 2026

Description

Add helper methods to schema_findings
Add enrichment to all getters for schema_findings

Describe your changes in detail

Motivation and Context

Resolves BED-7511

Why is this change required? What problem does it solve?

How Has This Been Tested?

Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

Screenshots (optional):

Types of changes

  • 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

Checklist:

@mistahj67 mistahj67 self-assigned this Feb 24, 2026
@mistahj67 mistahj67 added the api A pull request containing changes affecting the API code. label Feb 24, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-rel-findings-4

Comment @coderabbitai help to get the list of available commands and usage tips.

@mistahj67 mistahj67 force-pushed the refactor-rel-findings-3 branch from 6ec312a to 1e89fde Compare February 24, 2026 20:21
@mistahj67 mistahj67 force-pushed the refactor-rel-findings-4 branch from 34d9a97 to 6c349dd Compare February 24, 2026 20:22
Comment on lines 189 to 222
// This is the kind that the finding is associated with based on the kind_id, it is enriched by db getters
Kind graph.Kind `gorm:"-"`
// This is the subtypes a finding is associated with, it is enriched by the db getters
Subtypes []string `gorm:"-"`
}

func (s SchemaFinding) GetType() SchemaFindingType {
return s.Type
}

func (s SchemaFinding) String() string {
return s.Name
}

func (s SchemaFinding) FindingKind() graph.Kind {
return s.Kind
}

func (s SchemaFinding) GetDisplayName() string {
return s.DisplayName
}

func (s SchemaFinding) GetSubtypes() []string {
return s.Subtypes
}

func (s SchemaFinding) Is(others ...graph.Kind) bool {
for _, other := range others {
if s.Kind.Is(other) {
return true
}
}
return false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main approach with the upcoming refactor will be to leverage these small functions. While these might be overkill to retrieve the base fields, it should help with maintainability

@mistahj67 mistahj67 changed the base branch from refactor-rel-findings-3 to refactor-rel-findings-to-findings February 26, 2026 00:14
@mistahj67 mistahj67 force-pushed the refactor-rel-findings-4 branch from 8d51f87 to 8aacddd Compare February 26, 2026 00:40
@mistahj67 mistahj67 force-pushed the refactor-rel-findings-4 branch from 8aacddd to 94ad3a7 Compare February 26, 2026 00:49
@mistahj67 mistahj67 changed the title feat(OG): Add helper methods to schema_findings feat(OG): Add helper methods to schema_findings BED-7511 Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api A pull request containing changes affecting the API code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant