Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add AP scanning related types #414

Merged
merged 1 commit into from
Dec 12, 2024
Merged

add AP scanning related types #414

merged 1 commit into from
Dec 12, 2024

Conversation

matthyx
Copy link
Contributor

@matthyx matthyx commented Dec 10, 2024

PR Type

Enhancement


Description

  • Added support for Application Profile scanning functionality by introducing new API constants and notification types:
    • New command path constant ApplicationProfileScanCommandPath with value "scanApplicationProfile"
    • New notification policy type TypeScanApplicationProfile with value "scanApplicationProfile"
  • Maintained consistent code formatting and structure with existing scan-related constants

Changes walkthrough 📝

Relevant files
Enhancement
clusterapis.go
Add Application Profile scanning constants and types         

apis/clusterapis.go

  • Added new constant ApplicationProfileScanCommandPath for scanning
    application profiles
  • Added new notification policy type TypeScanApplicationProfile for
    triggering application profile scans
  • +9/-6     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Signed-off-by: Matthias Bertschy <[email protected]>
    @matthyx matthyx marked this pull request as ready for review December 12, 2024 08:06
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Naming Consistency
    The new constant TypeScanApplicationProfile uses a different naming pattern compared to other similar constants like TypeScanImages. Consider renaming to maintain consistency.

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Improve code readability by grouping related constants together with appropriate spacing

    Group related constants together by adding a blank line between different functional
    groups (scan-related vs non-scan-related constants).

    apis/clusterapis.go [5-11]

    +VulnerabilityScanCommandVersion   string = "v1"
     ApplicationProfileScanCommandPath string = "scanApplicationProfile"
     ContainerScanCommandPath          string = "scanImage"
     RegistryScanCommandPath          string = "scanRegistryImage"
     SBOMCalculationCommandPath        string = "generateSBOM"
    +
     DBCommandPath                     string = "DBCommand"
     ServerReady                       string = "ready"
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The suggestion to group related constants with blank lines would improve code organization and readability, making it easier to identify different functional groups of constants. This is a good practice for maintaining clean and organized code.

    6
    Maintain consistent naming conventions across related constants to improve code maintainability

    Consider using a more descriptive and consistent naming pattern for the scan command
    path. Other scan-related paths use 'scan' as prefix, while this one uses
    'scanApplication'.

    apis/clusterapis.go [6]

    -ApplicationProfileScanCommandPath string = "scanApplicationProfile"
    +ApplicationProfileScanCommandPath string = "scanAppProfile"
    • Apply this suggestion
    Suggestion importance[1-10]: 3

    Why: While the suggestion aims for naming consistency, changing from 'scanApplicationProfile' to 'scanAppProfile' offers minimal benefit and could potentially reduce clarity. The existing name is already clear and follows a valid naming pattern.

    3

    @matthyx matthyx merged commit 1b78a7f into main Dec 12, 2024
    3 checks passed
    @matthyx matthyx deleted the ap branch December 12, 2024 08:16
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants