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

Refactor commands output formats #96

Open
wants to merge 101 commits into
base: dev
Choose a base branch
from

Conversation

attiasas
Copy link
Contributor

@attiasas attiasas commented Jun 30, 2024

  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

Move all Results and outputs to their inner package, organize currently available code and renames to fit better.

Before:

image

After:

image

Move detection out of SCA to run first thing in audit

  • Allows to sync information from local jfrog-apps-config.
  • Prepare to remove config detection to separate command.
  • Prepare to remove dependency collection to separate command.

Change Results object to ScanCommandResults

  • Prepare the infrastructure to separate different sca children-targets in a single scan target
    image

Separate converting ScanCommandResults to different output formats and printing the output.

  • output package - Write the results in a specific format as an output string.
  • conversion package - Parse the ScanCommandResults object to convert it to different formats that we are supporting.

Make implementing a new output format (by introducing an interface) easier, and maintain the currently supported.

  • Reduce code duplications
  • Easy to see what we support
  • Easy to implement new formats / integrate new scans and results
    image

General validation improvments for results structs

  • Easy to support and maintain
  • Adds more tests
  • Exact/Partial match options (for unit + integration tests)
  • Easy to read what is tested
  • Refactor validations to its own package
    image

@attiasas attiasas added the ignore for release Automatically generated release notes label Jun 30, 2024
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Jul 10, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jul 10, 2024
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 1, 2024
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Oct 7, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore for release Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants