Add script for retrieving original source location#2037
Conversation
This adds a script that can be used for retrieving the original source location when given a location in the released extension. It will download the source map from the Actions workflow run of the release and use the `source-map` library to extract the original location.
aeisenberg
left a comment
There was a problem hiding this comment.
I think it's ok to download the artifacts from the workflow run, but it's not an ideal solution. Does anyone else have some suggestions?
| if (!(await pathExists(sourceMapsDirectory))) { | ||
| console.log("Downloading source maps..."); | ||
|
|
||
| const workflowRuns = runGhJSON<WorkflowRunListItem[]>([ |
There was a problem hiding this comment.
So, this will only work for as long as the workflow runs are still available from actions. Ideally, we can publish the source map as part of the release process and download the release artifact instead.
There was a problem hiding this comment.
Definitely! We'd probably need to create a ZIP file and upload it as a release asset. I think we can do this in a follow-up PR.
I guess the other option is to have the artifact in the release artifacts. Has this been considered? |
That was what I had in mind, but don't know if there are any downsides to this. |
I can't think of one. It feels like it makes sense too. |
|
Thanks both! I've created #2049 for uploading the sourcmaps as part of the release process. We can either merge this script as-is and update it once we have actually released a new version with the sourcemaps uploaded, or I can try to upload the sourcemaps to the existing release. In either case, I think it might still make sense to merge this as-is; I can update this to download the sourcemaps from the release assets in a follow-up PR. |
aeisenberg
left a comment
There was a problem hiding this comment.
Thanks. From my perspective this looks good. And in the future, we may move to using release artifacts for the smap.
This adds a script that can be used for retrieving the original source location when given a location in the released extension. It will download the source map from the Actions workflow run of the release and use the
source-maplibrary to extract the original location.Example input:
npx ts-node scripts/source-map.ts v1.7.8 "/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:131164:13"Output:
Checklist
ready-for-doc-reviewlabel there.