feat(OG): Add helper methods to schema_findings BED-7511#2410
Open
mistahj67 wants to merge 8 commits intorefactor-rel-findings-to-findingsfrom
Open
feat(OG): Add helper methods to schema_findings BED-7511#2410mistahj67 wants to merge 8 commits intorefactor-rel-findings-to-findingsfrom
mistahj67 wants to merge 8 commits intorefactor-rel-findings-to-findingsfrom
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
6ec312a to
1e89fde
Compare
34d9a97 to
6c349dd
Compare
mistahj67
commented
Feb 24, 2026
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 | ||
| } |
Contributor
Author
There was a problem hiding this comment.
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
8d51f87 to
8aacddd
Compare
8aacddd to
94ad3a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist: