Auto: Git failure when releasing (but unsure what it failed on)

Created on 21 Oct 2019  ·  12Comments  ·  Source: intuit/auto

Describe the bug

After several false starts I finally got relay-compiler-language-typescript releasing again. Pushing from travis was a challenge to figure out.

Here's the successful build: https://travis-ci.org/relay-tools/relay-compiler-language-typescript/builds/600830491

My coworker merged a PR after that and it resulted in a new failure

ℹ  info      Getting commits from v9.0.0 to HEAD

fatal: ambiguous argument 'v9.0.0..HEAD': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git <command> [<revision>...] -- [<file>...]'

Looking through the results of the build it's not immediately clear _what_ failed.

The only thing that it didn't do was console.log the version at the end (because it failed)... but the logs lead me to believe it should've failed way before doing all the other stuff.

I'm kind of stumped, ha. Any thoughts?

documentation question

All 12 comments

I just went through this today. ambiguous argument 'v9.0.0..HEAD' should be fixed by git fetch --tags so that env has all the tags it needs to find diffs

Thanks for the heads up @strass. I feel like we have an opportunity here to check for things we expect and try to grab them if they don't exist.

but the logs lead me to believe it should've failed way before doing all the other stuff.

I'm not sure we are looking at the correct logs. They end way before anything happens

I figured out what happened:

  1. https://github.com/relay-tools/relay-compiler-language-typescript/pull/147 merged 9:32am (Build 1)
  2. https://github.com/relay-tools/relay-compiler-language-typescript/pull/139 merged 9:33am (Build 2)
  3. Build 1 runs git checkout master && git pull origin && git branch --set-upstream-to origin/master master which includes commit in Build 2
  4. Build 1 makes a major release for build 2's changes even though Build 1 was a "skip released"
  5. Build 2 tries to release it's changes but Build 1 already did. So the CI fails

Seems like the issue is that travis isn't on master when running the build for the merge commit so you have to do some git fu. Here is how I handle this for actions (note lack of git checkout master && git pull origin)

https://github.com/hipstersmoothie/create-check/blob/master/.github/workflows/push.yml#L41

@zephraph Could you add a page to the docs explaining a good travis setup?

I just went through this today. ambiguous argument 'v9.0.0..HEAD' should be fixed by git fetch --tags so that env has all the tags it needs to find diffs

I have addressed this in https://github.com/intuit/auto/pull/626. Feel free to review and improve upon the messaging @strass

@hipstersmoothie I also wonder how much of this auto should try to do for the user? Like, in that case, just trying to fetch the tags automatically.

Sent with GitHawk

I open to make auto to do a little more of this work, I just don't know how it would play out in practice. Like you your case adding this feature would create an "empty" release since everything was already released. In my mind the better experience is to error (maybe with a better message) when the code has been released from another branch.

I also don't know how everything would behave if you're running shipit on a branch that is behind the latest tag

I'm going to close this now that #626 has shipped.

Will add some docs on travis config.

Was this page helpful?
0 / 5 - 0 ratings