github / github-artifact-exporter

A set of packages to make exporting artifacts from GitHub easier
MIT License
279 stars 31 forks source link

CLI installation does not work as documented #49

Closed goncalossilva closed 3 years ago

goncalossilva commented 3 years ago

Running npm install -g @github/github-artifact-exporter-cli does not provide github-artifacts-exporter on a fresh node installation:

$ npm install -g @github/github-artifact-exporter-cli
/home/goncalossilva/.asdf/installs/nodejs/14.17.0/.npm/bin/exporter -> /home/goncalossilva/.asdf/installs/nodejs/14.17.0/.npm/lib/node_modules/@github/github-artifact-exporter-cli/bin/run

(...)

> @github/github-artifact-exporter-cli@2.0.1 postinstall /home/goncalossilva/.asdf/installs/nodejs/14.17.0/.npm/lib/node_modules/@github/github-artifact-exporter-cli
> /home/goncalossilva/.asdf/installs/nodejs/14.17.0/.npm/lib/node_modules/.hooks/postinstall
+ @github/github-artifact-exporter-cli@2.0.1
added 119 packages from 131 contributors in 11.644s

$ github-artifact-exporter
bash: github-artifact-exporter: command not found

It does, however, provide exporter, but that doesn't seem to work as expected:

$ exporter search:issues --owner DemoOwner --repo DemoRepo --state closed --since 2021-04-01 --until 2021-05-01 --token ghp_123456789abc --format CSV > output.csv
    Error: ENOENT: no such file or directory, open '/home/goncalossilva/.asdf/installs/nodejs/14.1
    7.0/.npm/lib/node_modules/@github/github-artifact-exporter-cli/node_modules/@github/github-art
    ifact-exporter-core/queries/searchIssues.graphql'
    Code: ENOENT

I've tried this in macOS and Fedora, same result. Is the project packaged as expected? Core doesn't seem to include any of the queries:

ls /home/goncalossilva/.asdf/installs/nodejs/14.17.0/.npm/lib/node_modules/\@github/github-artifact-exporter-cli/node_modules/\@github/github-artifact-exporter-core/
CHANGELOG.md  lib  LICENSE  package.json  README.md
goncalossilva commented 3 years ago

Downloading and unarchiving the artifact from here, it's apparent that the queries folder is not being packaged. Manually creating it and fetching both searchIssues.graphql and listIssueComments.graphql does make it all work.

Chocrates commented 3 years ago

Thanks for the bug @goncalossilva I will attempt to repro and rectify this week.