kubescape / storage

Apache License 2.0
1 stars 6 forks source link

fix: conform to the filesystem path limit #45

Closed vladklokun closed 10 months ago

vladklokun commented 11 months ago

PR Type:

Bug fix, Refactoring


PR Description:

This PR includes changes to conform to the filename limit of the underlying file system. It also cleans up redundant type definitions from the Vulnerability Summary storage and fixes typos in Vulnerability Summary storage source file names. The changes include refactoring the file extensions for JSON and metadata files, adding helper functions for file path creation, and updating the corresponding tests.


PR Main Files Walkthrough:

files: `pkg/registry/file/storage.go`: The file extensions for JSON and metadata files have been shortened. Helper functions have been added for creating paths for payload and metadata files, and for identifying if a file is a metadata or payload file. These changes are reflected in the functions that write, get, and count files. `pkg/registry/file/storage_test.go`: The tests have been updated to reflect the changes in file extensions and the use of helper functions for file path creation in the storage.go file. `pkg/registry/file/vulnerabilitysummarystorage.go`: This is a new file that implements a storage for vulnerability summaries. It provides vulnerability summaries for scopes like namespace and cluster. The summaries are generated on the fly and not stored. `pkg/registry/file/vulnerabilitysummarystorage_test.go`: This new file contains tests for the vulnerability summary storage. The tests cover getting a single vulnerability summary and a list of vulnerability summaries.

User Description:

What this PR does?

This PR:

codiumai-pr-agent[bot] commented 11 months ago

PR Analysis

How to use

To invoke the PR-Agent, add a comment using one of the following commands: /review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option. /describe: Modify the PR title and description based on the contents of the PR. /improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback. /ask \<QUESTION>: Pose a question about the PR. /update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value For example: /review --pr_reviewer.extra_instructions="focus on the file: ..." To list the possible configuration parameters, use the /config command.

github-actions[bot] commented 11 months ago

Summary:

github-actions[bot] commented 10 months ago

Summary: