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

Parsing npm outdated output with multiple dependents per dependency fails #9566

Closed
fniessink opened this issue Aug 28, 2024 · 0 comments · Fixed by #9569
Closed

Parsing npm outdated output with multiple dependents per dependency fails #9566

fniessink opened this issue Aug 28, 2024 · 0 comments · Fixed by #9569
Assignees
Labels
Bug Something isn't working

Comments

@fniessink
Copy link
Member

Parse error
Traceback (most recent call last):
  File "/home/collector/base_collectors/source_collector.py", line 150, in __safely_parse_source_responses
    return await self._parse_source_responses(responses)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/collector/base_collectors/source_collector.py", line 163, in _parse_source_responses
    included_entities = [entity for entity in await self._parse_entities(responses) if self._include_entity(entity)]
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/collector/base_collectors/file_source_collector.py", line 113, in _parse_entities
    entities.extend(self._parse_json(json, filename))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/collector/source_collectors/npm/dependencies.py", line 15, in _parse_json
    return Entities(
           ^^^^^^^^^
  File "/home/collector/model/entity.py", line 34, in __init__
    self.extend(entities)
  File "/home/collector/model/entity.py", line 52, in extend
    for entity in entities:
  File "/home/collector/source_collectors/npm/dependencies.py", line 17, in <genexpr>
    key=<redacted>'{dependency}@{versions.get("current", "?")}',
                        ^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
{
"@testing-library/jest-dom": [
    {
      "current": "6.4.6",
      "wanted": "6.5.0",
      "latest": "6.5.0",
      "dependent": "foo",
      "location": "/builds/project/baz/node_modules/@testing-library/jest-dom"
    },
    {
      "current": "6.4.6",
      "wanted": "6.5.0",
      "latest": "6.5.0",
      "dependent": "bar",
      "location": "/builds/project/baznode_modules/@testing-library/jest-dom"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant