Skip to content

Allow runs without HEROKU_API_KEY when no app is being deployed #155

@schneems

Description

@schneems

Right now if you Heroku::Runner.new() it will look for a HEROKU_API_KEY or shell out to heroku token even if you never plan on deploying.

====>> Hatchet setup
  #!/bin/bash -eo pipefail
bundle exec hatchet ci:setup

Traceback (most recent call last):
	3: from /home/circleci/project/vendor/bundle/ruby/2.7.0/gems/heroku_hatchet-7.3.3/etc/ci_setup.rb:16:in `<main>'
	2: from /home/circleci/project/vendor/bundle/ruby/2.7.0/gems/heroku_hatchet-7.3.3/etc/ci_setup.rb:16:in `open'
	1: from /home/circleci/project/vendor/bundle/ruby/2.7.0/gems/heroku_hatchet-7.3.3/etc/ci_setup.rb:19:in `block in <main>'
/home/circleci/project/vendor/bundle/ruby/2.7.0/gems/heroku_hatchet-7.3.3/etc/ci_setup.rb:19:in `fetch': key not found: "HEROKU_API_USER" (KeyError)
bundler: failed to load command: hatchet (/home/circleci/project/vendor/bundle/ruby/2.7.0/bin/hatchet)
RuntimeError: Command /home/circleci/project/vendor/bundle/ruby/2.7.0/gems/heroku_hatchet-7.3.3/etc/ci_setup.rb failed:
== Setting Up CI ==

This is an issue for people who are using hatchet locally and never need to deploy (if they're using in_directory_fork for example).

The issue is that the reaper needs the API token, and the reaper is created in the initialize method.

Ideas to fix:

  • Introduce a Hatchet::Local that only has a very limited set of hatchet features and does not depend on the reaper
  • Refactor the reaper relationship in App to be lazilly initialized when it's called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions