no feedback when a push fails
Closed this issue · 15 comments
Pushing an .env of the format
export VAR_1="..."
export VAR_2="..."
export VAR_3="..."
...
using $> heroku config:push
and then checking the resulting config shows zero change, without the command having said anything at all. No errors, no warnings, no notices.
👍
This is a dealbreaker for me, since the tool is essentially broken.
It seems we aren't the only ones encountering this: http://stackoverflow.com/questions/27899517/heroku-configpush-not-adding-environment-variables
I no longer use Heroku day to day so I am no longer going to be maintaining this plugin. If you'd like to submit a pull request that solves the issue I would be happy to take a look and merge..
does heroku know? (they kind of expressly link to this repo in their dev docs =x)
The issue here is the export
-- this is not a valid format for Foreman or Heroku. I've added an error (and exit) if the format is incorrect. This will warn on this issue, as well as the one in the SO post (spaces around =
's)
👍
Although if it can throw an error, it can probably also just do a trivial rewrite to the necessary form for pushing into heroku: export
is relatively common for env files and easily replaced with an s/^\s*export\s*//
(case sensitive, of course), and the spacing issue can be trivially solved with an s/\s*=\s*/=/
, since it's a non-semantic replacement.
@Pomax Agreed. That's the route I took at first ... however, it then creates other problems for config:pull
since it will then need to know what format to write your vars in. Much easier to stick to the correct format than make this plugin overly complicated.
--with-export
for a leading export
? Stripping spacing shouldn't matter all that much, since they're completely irrelevant for env parsing purposes.
The .env
file that heroku-config knows how to work with does not contain export
statements. I don't want to cruft it up with a ton of options if possible.
The code for these plugins are fairly simple and since you can install them easily from a git url I think it makes more sense for you to fork it to add the export
handling.
to be fair: if you don't really maintain this package anymore, I'm not sure I see the benefit of creating a fork over simply landing @jmccartie's PR so that the rest of the world gets a better heroku-config for free instead of having to find a fork that's likely not going to show up on google or npmjs
Because the changes are not as straightforward as they seem. Perhaps someone has comments in their .env
which would start throwing errors with this pull request.
good point.
One way or another, with parsing options or without them, shouldn't this fix be landed? At the moment the tool is broken because it gives no feedback on failure or even an indication that failure occurred. Throwing errors on comments is at least more honest about the formatting expectations, makes the tool usable and might compel people to fork it as you suggest if they want to improve the behaviour.
I don't know ruby so I'm not positioned to help out with the coding, but if there's anything else I can do to help push this through let me know.
I have proposed an alternate change over on the pull request to allow for checking for valid contents in an .env
file. Given that this plugin has not seen significant changes in almost 2.5 years I'm going to err on the conservative side and reject the change to the existing workflow.
PR updated