Skip to content

Conversation

@melotic
Copy link
Member

@melotic melotic commented Jun 21, 2023

DetectedComponent has the metadata such as whether the component is a development dependency, and the root components, but this data is not actually set.

Instead, detectors create DetectedComponents with the TypedComponent, and the metadata is passed into ComponentRecorder which then appends the component to the graph with proper metadata.

This switches experiments from using DetectedComponent to ScannedComponent by using the IGraphTranslationService to parse the data from the ComponentRecorder.

Fixes #611

@melotic melotic added the type:bug Bug fix of existing functionality label Jun 21, 2023
@melotic melotic requested a review from a team as a code owner June 21, 2023 19:33
@melotic melotic requested a review from chsalgado June 21, 2023 19:33
@melotic
Copy link
Member Author

melotic commented Jun 21, 2023

Sample diff
{
  "AddedIds": [],
  "RemovedIds": [
    "test 1.0.0 - Npm"
  ],
  "DevelopmentDependencyChanges": [
    {
      "Id": "@sinclair/typebox 0.28.17 - Npm",
      "OldValue": false,
      "NewValue": true
    }
  ],
  "AddedRootIds": {
    "express 4.18.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "ms 2.0.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "body-parser 1.20.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "function-bind 1.1.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "inherits 2.0.4 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "safer-buffer 2.1.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "bytes 3.1.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "ipaddr.js 1.9.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "on-finished 2.4.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "http-errors 2.0.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "ms 2.1.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "get-intrinsic 1.2.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "negotiator 0.6.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "encodeurl 1.0.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "toidentifier 1.0.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "@sinclair/typebox 0.28.17 - Npm": [
      "@sinclair/typebox 0.28.17 - Npm"
    ],
    "ee-first 1.1.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "object-inspect 1.12.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "parseurl 1.3.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "has 1.0.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "methods 1.1.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "type-is 1.6.18 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "mime 1.6.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "fresh 0.5.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "destroy 1.2.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "forwarded 0.2.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "qs 6.11.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "etag 1.8.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "proxy-addr 2.0.7 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "merge-descriptors 1.0.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "vary 1.1.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "debug 2.6.9 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "send 0.18.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "raw-body 2.5.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "array-flatten 1.1.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "escape-html 1.0.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "content-disposition 0.5.4 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "media-typer 0.3.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "serve-static 1.15.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "has-symbols 1.0.3 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "mime-types 2.1.35 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "side-channel 1.0.4 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "content-type 1.0.5 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "call-bind 1.0.2 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "depd 2.0.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "mime-db 1.52.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "cookie 0.5.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "range-parser 1.2.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "setprototypeof 1.2.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "cookie-signature 1.0.6 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "unpipe 1.0.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "has-proto 1.0.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "finalhandler 1.2.0 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "utils-merge 1.0.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "path-to-regexp 0.1.7 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "safe-buffer 5.2.1 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "iconv-lite 0.4.24 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "accepts 1.3.8 - Npm": [
      "express 4.18.2 - Npm"
    ],
    "statuses 2.0.1 - Npm": [
      "express 4.18.2 - Npm"
    ]
  },
  "RemovedRootIds": {}
}

@melotic melotic merged commit 97a2320 into main Jun 22, 2023
@melotic melotic deleted the users/justinperez/experiments-metadata branch June 22, 2023 18:15
@github-actions
Copy link

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Experiments not properly recording dev dependencies for NPM

3 participants