heroku-ci icon indicating copy to clipboard operation
heroku-ci copied to clipboard

$HEROKU_TEST_RUN_BRANCH not accurate when running `ci:debug`

Open jmorrell opened this issue 7 years ago • 0 comments

It appears that if I run heroku ci:debug from a non-master branch I will be dumped into a dyno with my master branch, but the $HEROKU_TEST_RUN_BRANCH will tell me that I am on the local branch.

Link to slack discussion: https://heroku.slack.com/archives/C1P0609FC/p1498764480135177

I expect HEROKU_TEST_RUN_BRANCH to be the branch that I see when I run heroku ci:debug, but that is not the branch that I see. Let me try to make it clearer: try-npm5 does not have a yarn.lock file, instead it has a package-lock.json

❯ ls
Procfile          app.json          config.js         flow-typed        node_modules      package.json
__tests__         bin               dev               lib               package-lock.json readme.md

But when I run debug I get what looks like my master branch: yarn.lock exists and package-lock.json is nowhere to be found:

❯ heroku ci:debug --pipeline nodebin
[ lots of output]
~ $ git status
fatal: Not a git repository (or any parent up to mount point /app)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
~ $ ls
Procfile  __tests__  app.json  bin  config.js  dev  flow-typed  lib  node_modules  package.json  readme.md  yarn.lock
~ $ eval $(ci env)
~ $ env
[ elided ]
HEROKU_TEST_RUN_BRANCH=try-npm5```

Link to code picking up the local branch in the CLI: https://github.com/heroku/heroku-ci/blob/master/commands/ci/debug.js#L50

jmorrell avatar Jun 29 '17 19:06 jmorrell