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

Fetching Codecov repository tokens fails if repo exists as private GH repo but you say it should be public #5

Open
sqs opened this issue Aug 11, 2018 · 1 comment
Assignees

Comments

@sqs
Copy link
Member

sqs commented Aug 11, 2018

npm init @sourcegraph in the existing private repo https://github.com/sourcegraph/extensions-client-common consistently failed. I fixed it by making the repo public (so I am not blocked on this and it is not urgent).

$ TRAVIS_TOKEN=REDACTED BUILDKITE_TOKEN=REDACTED CODECOV_TOKEN=REDACTED GITHUB_TOKEN=REDACTED npm init @sourcegraph
npx: installed 154 in 3.028s
Using GITHUB_TOKEN from env var
Using CODECOV_TOKEN from env var
Using BUILDKITE_TOKEN from env var
*️⃣ Welcome to the Sourcegraph npm package initializer
? What should the name of the package be? Examples: @sourcegraph/codeintellify, @sourcegraph/react-loading-spinner, cxp @sourcegraph/ext
ensions-client-common
? Description 
? 🔐 Should this package be public or private? public
📘 Existing git remote detected, skipping GitHub repository creation
🔑 Giving all FTTs admin access
? License? MIT
📄 Adding LICENSE
? Does this package have tests? Yes
📄 tsconfig.json already exists, skipping creation
📄 tslint.json already exists, skipping creation
📄 Adding prettier.config.js
📄 Adding .prettierignore
📄 Adding .gitignore
📄 package.json already exists, skipping creation
📂 Creating src directory
📦 Installing dependencies

> [email protected] uninstall /home/sqs/src/github.com/sourcegraph/extensions-client-common/node_modules/husky
> node ./bin/uninstall.js

husky
uninstalling Git hooks
done


> [email protected] install /home/sqs/src/github.com/sourcegraph/extensions-client-common/node_modules/husky
> node ./bin/install.js

husky
setting up Git hooks
done

npm WARN @gql2ts/[email protected] requires a peer of graphql@>= 0.10 <1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @gql2ts/[email protected] requires a peer of graphql@>= 0.10 <1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>= 2.3.1 < 3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @commitlint/[email protected]
+ @sourcegraph/[email protected]
+ @commitlint/[email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ @sourcegraph/[email protected]
+ @sourcegraph/[email protected]
updated 12 packages and audited 12303 packages in 11.362s
found 0 vulnerabilities

🔑 Fetching CodeCov repository tokens
{ StatusCodeError: 404 - {"error":{"reason":"GitHub API: Not Found","context":null},"meta":{"status":404}}
    at new StatusCodeError (/home/sqs/.npm/_npx/20320/lib/node_modules/@sourcegraph/create/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/sqs/.npm/_npx/20320/lib/node_modules/@sourcegraph/create/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/sqs/.npm/_npx/20320/lib/node_modules/@sourcegraph/create/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (/home/sqs/.npm/_npx/20320/lib/node_modules/@sourcegraph/create/node_modules/request/request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (/home/sqs/.npm/_npx/20320/lib/node_modules/@sourcegraph/create/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (/home/sqs/.npm/_npx/20320/lib/node_modules/@sourcegraph/create/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'StatusCodeError',
  statusCode: 404,
  message:
   '404 - {"error":{"reason":"GitHub API: Not Found","context":null},"meta":{"status":404}}',
  error:
   { error: { reason: 'GitHub API: Not Found', context: null },
     meta: { status: 404 } },
  options:
   { resolveWithFullResponse: true,
     baseUrl: 'https://codecov.io/api/',
     json: true,
     headers: { Authorization: 'token REDACTED' },
     uri: 'gh/sourcegraph/extensions-client-common',
     method: 'GET',
     callback: [Function: RP$callback],
     transform: undefined,
     simple: true,
     transform2xxOnly: false },
@felixfbecker
Copy link
Contributor

felixfbecker commented Aug 11, 2018

Yes, the CLI does not support changing the state of e.g. the repo from private to public. It is only build to create things, idempotently. Any change must either be done manually, or by deleting the object and running again (e.g. deleting the GitHub repo, deleting buildkite.yml). It would be nice if it did support changing, but that would make the code a lot more complex (basically implementing a desired state configuration algorithm and transitions for every object into every possible state).

It somewhat confuses me though that Codecov would fail just because the repo is private, given that you have a codecov API token...

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

No branches or pull requests

2 participants