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

Publishing to github fails due to deprecated options in @octokit/rest.js #493

Closed
3 tasks done
positlabs opened this issue Apr 23, 2018 · 17 comments
Closed
3 tasks done

Comments

@positlabs
Copy link

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

Using v5.2.0, attempting to publish to github releases. Seems like the github api host (api.github.com) is undefined for some reason. Possibly an issue with octokit

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

josh:gif-goat pixelfiend$ DEBUG=electron-forge:* electron-forge publish
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +1s
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:publish triggering make +0ms
  electron-forge:lifecycle Process Started: Resolving Forge Config +0ms
  electron-forge:project-resolver searching for project in: /Users/pixelfiend/workspace/gif-goat +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/pixelfiend/workspace/gif-goat/package.json +1ms
  electron-forge:lifecycle Process Succeeded: Resolving Forge Config +8ms
  electron-forge:require-search searching [ '../makers/darwin/dmg.js',
  '../makers/generic/dmg.js',
  'electron-forge-maker-dmg',
  'dmg',
  '/Users/pixelfiend/workspace/gif-goat/dmg',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/makers/darwin/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/makers/generic/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/electron-forge-maker-dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/dmg',
  '/Users/pixelfiend/workspace/gif-goat/dmg',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/makers/darwin/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/makers/generic/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-maker-dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/dmg',
  '/Users/pixelfiend/workspace/gif-goat/dmg',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/dmg' ] relative to /Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api +0ms
  electron-forge:require-search testing ../makers/darwin/dmg.js +6ms
We need to package your application before we can make it
  electron-forge:lifecycle Process Started: Preparing to Package Application for arch: x64 +15ms
  electron-forge:project-resolver searching for project in: /Users/pixelfiend/workspace/gif-goat +20ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/pixelfiend/workspace/gif-goat/package.json +1ms
  electron-forge:hook could not find hook: generateAssets +0ms
  electron-forge:hook could not find hook: prePackage +0ms
  electron-forge:packager packaging with options { asar: false,
  overwrite: true,
  packageManager: 'npm',
  icon: './src/assets/imgs/icon-1024.png',
  afterCopy: [ [Function] ],
  afterExtract: [ [Function] ],
  afterPrune: [ [Function] ],
  dir: '/Users/pixelfiend/workspace/gif-goat',
  arch: 'x64',
  platform: 'darwin',
  out: '/Users/pixelfiend/workspace/gif-goat/out',
  electronVersion: '1.8.4',
  quiet: true } +0ms
  electron-forge:lifecycle Process Succeeded: Preparing to Package Application for arch: x64 +50s
  electron-forge:lifecycle Process Started: Compiling Application +2ms
  electron-forge:lifecycle Process Succeeded: Compiling Application +2s
  electron-forge:lifecycle Process Started: Preparing native dependencies +13s
  electron-forge:lifecycle Process Succeeded: Preparing native dependencies +737ms
  electron-forge:lifecycle Process Started: Packaging Application +1ms
  electron-forge:hook could not find hook: postPackage +1m
  electron-forge:lifecycle Process Succeeded: Packaging Application +12s
Making for the following targets:
  electron-forge:hook could not find hook: preMake +3ms
  electron-forge:lifecycle Process Started: Making for target: dmg - On platform: darwin - For arch: x64 +6ms
  electron-forge:lifecycle Process Succeeded: Making for target: dmg - On platform: darwin - For arch: x64 +22s
  electron-forge:hook could not find hook: postMake +22s
  electron-forge:project-resolver searching for project in: /Users/pixelfiend/workspace/gif-goat +2m
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/pixelfiend/workspace/gif-goat/package.json +1ms
  electron-forge:lifecycle Process Started: Resolving publish target: github +2ms
  electron-forge:require-search searching [ '../publishers/github.js',
  'electron-forge-publisher-github',
  'github',
  '/Users/pixelfiend/workspace/gif-goat/github',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/publishers/github.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/electron-forge-publisher-github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/github',
  '/Users/pixelfiend/workspace/gif-goat/github',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/publishers/github.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-publisher-github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/github',
  '/Users/pixelfiend/workspace/gif-goat/github',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/github' ] relative to /Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api +2m
  electron-forge:require-search testing ../publishers/github.js +4ms
  electron-forge:lifecycle Process Succeeded: Resolving publish target: github +262ms
  electron-forge:lifecycle Process Started: Searching for target release +3ms
DEPRECATED: protocol option is no longer supported
  electron-forge:lifecycle Process Failed: Searching for target release +116ms

An unhandled error has occurred inside Forge:
request to https://undefined/repos/positlabs/gif-goat/releases?per_page=100 failed, reason: getaddrinfo ENOTFOUND undefined undefined:443
HttpError: request to https://undefined/repos/positlabs/gif-goat/releases?per_page=100 failed, reason: getaddrinfo ENOTFOUND undefined undefined:443
    at fetch.then.then.catch.error (/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/node_modules/@octokit/rest/lib/request/request.js:88:13)
    at process._tickCallback (internal/process/next_tick.js:109:7)

What command line arguments are you passing?

electron-forge publish --target=github --platform=darwin

What does your config.forge data in package.json look like?

  "config": {
    "forge": {
      "make_targets": {
        "darwin": [
          "dmg"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "npm",
        "icon": "./src/assets/imgs/icon-1024.png"
      },
      "github_repository": {
        "owner": "positlabs",
        "name": "gif-goat"
      }
    }
  }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

https://github.com/positlabs/gif-goat

@benjtinsley
Copy link

benjtinsley commented May 2, 2018

anyone have a workaround here? this seems to have forced my development to a grinding halt

@positlabs
Copy link
Author

The workaround is to manually upload releases to github. Not the end of the world, but not ideal

@benjtinsley
Copy link

@positlabs cool. i have been doing this in the meantime. thanks!

@MarshallOfSound
Copy link
Member

@benjtinsley @positlabs If you delete your node_modules directory and re-install it does it start working ❓

@benjtinsley
Copy link

@MarshallOfSound thanks for the suggestion, unfortunately that does not fix.

@benjtinsley
Copy link

@positlabs may be onto something by suggesting that it is a problem within octokit, or possibly electron-forge using an outdated version of octokit. without having much knowledge on typescript or octokit/rest.js it looks like the use of it in the electron-forge publish package differs from the advertised api on the rest.js repo.

@malept
Copy link
Member

malept commented May 4, 2018

I found it, octokit/rest.js "deprecated" config options in a minor release: octokit/rest.js@96b9fc6

I don't think their deprecations work too well.

malept added a commit that referenced this issue May 4, 2018
This broke with @octokit/rest.js 15.2.0

ISSUES CLOSED: #493
@MarshallOfSound
Copy link
Member

@malept Should ping the folks on octokit, that's something they need to be aware of and revert till a major release

malept added a commit that referenced this issue May 4, 2018
This broke with @octokit/rest.js 15.2.0

ISSUES CLOSED: #493
@malept
Copy link
Member

malept commented May 4, 2018

@MarshallOfSound once I make the PR for master, I'll see if I can make a minimal testcase for them.

malept added a commit that referenced this issue May 4, 2018
…rams

This broke with @octokit/rest.js 15.2.0.

ISSUES CLOSED: #493
@malept
Copy link
Member

malept commented May 4, 2018

Filed an issue upstream: https://github.com/octokit/rest.js/issues/848

malept added a commit that referenced this issue May 4, 2018
…rams

This broke with @octokit/rest.js 15.2.0.

ISSUES CLOSED: #493
MarshallOfSound pushed a commit that referenced this issue May 4, 2018
…rams (#505)

This broke with @octokit/rest.js 15.2.0.

ISSUES CLOSED: #493
@malept
Copy link
Member

malept commented May 4, 2018

Reopening since the 5.x PR isn't merged yet (it's being weird in CI)

@malept malept reopened this May 4, 2018
@malept malept changed the title Publishing to github fails due to undefined Publishing to github fails due to deprecated options in @octokit/rest.js May 4, 2018
@malept
Copy link
Member

malept commented May 5, 2018

While we're waiting for 5.x CI to behave itself, you should be able to work around this by adding this to forge config:

config: {
  forge: {
    github_repository: {
      options: {
        protocol: undefined
      }
    }
  }
}

@MiYogurt
Copy link

MiYogurt commented May 5, 2018

https://github.com/octokit/rest.js/blob/2050cfd22b1479da63926e0b8e3c9bf716b2ae3e/lib/parse-client-options.js#L28

new version maybe should use baseUrl

https://github.com/octokit/rest.js/blob/2050cfd22b1479da63926e0b8e3c9bf716b2ae3e/lib/parse-client-options.js#L54

in v15.2.7 so we can set protocol and host

"github_repository": {
      "owner": "MiYogurt",
      "name": "mmmmh",
      "options": {
          protocol: 'https',
          host: 'api.github.com'
      }
 },
  • test code

https://runkit.com/gr2m/5aecb07ba3c91a00124a1be9/branches/master
https://runkit.com/miyogurt/5aeda76a7959c10012739695

  • issues

https://github.com/octokit/rest.js/issues/848

@malept
Copy link
Member

malept commented May 5, 2018

I guess I need to be clearer:

Workaround for Electron Forge 5.2.0: follow the directions in my previous comment.

  • If you use github.com: you don't need to do anything else.
  • If you use GitHub Enterprise, set config.forge.github_repository.options.baseUrl.

For Electron Forge 5.2.1 (which is not released yet due to issues with CI):

  • If you use github.com: you don't need to do anything special.
  • If you use GitHub Enterprise, set config.forge.github_repository.options.baseUrl.

@MiYogurt
Copy link

MiYogurt commented May 6, 2018

if not set protocol and host i will get undefined error。 if set protocol is undefined always get undefined error。

@malept
Copy link
Member

malept commented May 6, 2018

This is what happens when you set protocol to undefined: https://runkit.com/malept/octokit-undefined-protocol

api.github.com is the default host.

malept added a commit that referenced this issue May 6, 2018
This broke with @octokit/rest.js 15.2.0

ISSUES CLOSED: #493
@MarshallOfSound
Copy link
Member

Merged / fixed now 👍

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

5 participants