Skip to content

Gracefully handle incomplete package.json files #239

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

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

olafurpg
Copy link
Member

Previously, scip-typescript didn't emit the required scip-typescript npm PACKAGE_NAME PACKAGE_VERSION prefix for global symbols when a package.json file was missing either the name or version field. Now, scip-typescript guarantees that all global symbols have this prefix. When the version field is missing, we fallback to the version "HEAD".

Test plan

Updated snapshot tests with e2e tests.

Previously, scip-typescript didn't emit the required
`scip-typescript npm PACKAGE_NAME PACKAGE_VERSION` prefix for global
symbols when a package.json file was missing either the `name` or
`version` field. Now, scip-typescript guarantees that all global symbols
have this prefix. When the `version` field is missing, we fallback to
the version `"HEAD"`.
@olafurpg olafurpg force-pushed the olafurpg/invalid-package-json branch from 72393d2 to d0b386b Compare March 16, 2023 10:49
@olafurpg olafurpg merged commit dfa4329 into main Mar 16, 2023
@olafurpg olafurpg deleted the olafurpg/invalid-package-json branch March 16, 2023 10:54
olafurpg added a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request Mar 16, 2023
olafurpg added a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request Mar 16, 2023
To include the fix from
sourcegraph/scip-typescript#239 in the 5.0
release.


## Test plan

Ran the following command
```
❯ docker run sourcegraph/scip-typescript@sha256:1851ad42b3b47c8fb240c5060b5757cf51ebeece5e360013e41ab8a1dd05d52c scip-typescript --version
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
0.3.7
```

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
github-actions bot pushed a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request Mar 16, 2023
To include the fix from
sourcegraph/scip-typescript#239 in the 5.0
release.

## Test plan

Ran the following command
```
❯ docker run sourcegraph/scip-typescript@sha256:1851ad42b3b47c8fb240c5060b5757cf51ebeece5e360013e41ab8a1dd05d52c scip-typescript --version
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
0.3.7
```

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

(cherry picked from commit d7070e3)
Strum355 pushed a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request Mar 16, 2023
To include the fix from
sourcegraph/scip-typescript#239 in the 5.0
release.


## Test plan

Ran the following command
```
❯ docker run sourcegraph/scip-typescript@sha256:1851ad42b3b47c8fb240c5060b5757cf51ebeece5e360013e41ab8a1dd05d52c scip-typescript --version
WARNING: The requested image&#39;s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
0.3.7
```

&lt;!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
--&gt;
 <br> Backport d7070e3 from #49499

Co-authored-by: Ólafur Páll Geirsson <[email protected]>
sqs pushed a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request Mar 18, 2023
To include the fix from
sourcegraph/scip-typescript#239 in the 5.0
release.


## Test plan

Ran the following command
```
❯ docker run sourcegraph/scip-typescript@sha256:1851ad42b3b47c8fb240c5060b5757cf51ebeece5e360013e41ab8a1dd05d52c scip-typescript --version
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
0.3.7
```

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
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.

2 participants