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

feat: Add UUIDs to recipes and include these in the report #148

Merged

Conversation

spdawson
Copy link
Contributor

@spdawson spdawson commented Nov 21, 2022

Description

Relying on the recipe name is fragile; switch to use the recipe UUID, and output this in reports for internal consumption.

Detectors report

Before

- classification:
    decision:
        reason: recipe_match
        state: valid
    recipe_match: true
    recipe_name: PostgreSQL
  detector_type: rails
  source:
    column_number: null
    filename: config/database.yml
    language: YAML
    language_type: data
    line_number: 85
    text: null
  type: framework_classified
  value:
    adapter: postgresql
    name: ""

After

The recipe_uuid attribute is present:

- classification:
    decision:
        reason: recipe_match
        state: valid
    recipe_match: true
    recipe_name: PostgreSQL
    recipe_uuid: 428ff7dd-22ea-4e80-8755-84c70cf460db
  detector_type: rails
  source:
    column_number: null
    filename: config/database.yml
    language: YAML
    language_type: data
    line_number: 85
    text: null
  type: framework_classified
  value:
    adapter: postgresql
    name: ""

Dataflow report

Before

datatypes:
    - name: Email Address
      detectors:
        - name: ruby
          locations:
            - filename: config/initializers/devise.rb
              linenumber: 186
risks: []
components:
    - name: aws key management service (kms)
      locations:
        - detector: gemfile-lock
          filename: Gemfile.lock
          linenumber: 78
    - name: aws s3
      locations:
        - detector: gemfile-lock
          filename: Gemfile.lock
          linenumber: 81
    - name: postgresql
      locations:
        - detector: gemfile-lock
          filename: Gemfile.lock
          linenumber: 151
    - name: redis
      locations:
        - detector: gemfile-lock
          filename: Gemfile.lock
          linenumber: 191

After

Same as before (no change).

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@swarmia
Copy link

swarmia bot commented Nov 21, 2022

elsapet
elsapet previously approved these changes Nov 21, 2022
Copy link
Contributor

@elsapet elsapet left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I wonder if we want to the recipe name as well as recipe UUID in the report. @cfabianski any thoughts on this?

pkg/report/output/dataflow/types/components.go Outdated Show resolved Hide resolved
pkg/report/output/dataflow/components/components.go Outdated Show resolved Hide resolved
@cfabianski
Copy link
Collaborator

Looks good to me, but I wonder if we want to the recipe name as well as recipe UUID in the report. @cfabianski any thoughts on this?

You are on the right track @elsapet
There is a difference between internal and external. @elsapet you have done something similar, wanna show @spdawson?

@spdawson spdawson force-pushed the AMA-3176-add-uui-ds-to-recipes-and-include-these-in-the-report branch 2 times, most recently from 2cb881a to 8a0ad5a Compare November 21, 2022 14:12
@spdawson spdawson force-pushed the AMA-3176-add-uui-ds-to-recipes-and-include-these-in-the-report branch from 8a0ad5a to 83060c6 Compare November 22, 2022 11:03
Copy link
Collaborator

@cfabianski cfabianski left a comment

Choose a reason for hiding this comment

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

LGTM

@spdawson spdawson merged commit cf4e966 into main Nov 22, 2022
@spdawson spdawson deleted the AMA-3176-add-uui-ds-to-recipes-and-include-these-in-the-report branch November 22, 2022 11:23
cfabianski added a commit that referenced this pull request Nov 22, 2022
…w-report

* origin/main:
  feat: Include classified frameworks in dataflow report (#153)
  feat: Add UUIDs to recipes and include these in the report (#148)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants