-
Notifications
You must be signed in to change notification settings - Fork 202
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
Question - lerna ERR! ENOGIT Detached git HEAD within Gitlab CI #1157
Comments
Seems to work fine when ran locally, just not in the ci environment. hmm |
First, IDK how well auto can possibly work with GitLab since we heavily use the GitHub API. Things like looking up the pull requests, making releases, and a whole host of other things won't work as expected. As for the detached head issue: Most CI envs do not checkout your code in the same way. For Looking at your logs it seems like GitLab does a relatively full checkout, but with detached head (you aren't on a branch). Try checking out # See what branches are available
git branch -a
# Checkout master
git checkout master |
That seemed to fix that error, but now it isnt releasing due to this 😢 |
Did a quick search but i cant seem to figure out what causes that error message. |
That error comes from auto/packages/core/src/auto.ts Line 405 in adf4e85
It might be swallowing another error though. I can add a log to print in this function if you need it |
🤦 not sure how i missed that. Would it be possible to output that error if a verbose flag was set? I realized i couldn't do this locally because i cant create the error locally lol |
Is it possible the https://gitlab.com/jdalrymple/gitbeaker/-/jobs/518962749#L1391 |
Oh man 🤦 I must have deleted a |
Once this publishes it should be good https://github.com/intuit/auto/pull/1161/files |
Another problem fixed butttt hehe Any other suggestions? |
You seem to still be on an old canary |
Oops! just fixed that. Still having bad luck :( Now with Error: Command failed: git merge-base --is-ancestor 😢 |
Hmm reading over the logs again, is it possible its using the wrong remote url?
That could actually be the problem. The repo is hosted on github, but im using the gitlab ci for the pipeline. It looks like its inferring the remote to push to, but inferring incorrectly. Not sure how to change it though hmm |
So i worked a way around this error by explicitly setting the remote url. Kinda of hacky, but it would work for now. Trying to fix a weird npm error now. So close :/ |
It worked!!! Had to explicitly set some things but yay! Thanks for the help!! Quick question @hipstersmoothie , to avoid opening a new issue. Does auto handle creating new github releases? It created the tag and the release notes fine, but no github release :( |
It is supposed to create the github release also. I'll look into what you've posted. We can dm on twitter if you want quicker responses too |
Building on GitLab is probably the source of most of these problems. As you found with the remote CI services tend to make a bunch of different assumptions. That said we might be able to improve the remote logic and detect when we are on gitlab CI. Here is where you would change the code to figure out the remote https://github.com/intuit/auto/blob/master/packages/core/src/auto.ts#L556 |
Ill make a another release in about 10 min so you can see what ends up happening, but the last release that was made i had to manually add the github release notes. |
I think you need to up the |
Looking into modifying that limit now. It looks like it errors when trying to get the git log AH, it is using a tag with the prefix 'v' but my lerna config excludes the prefix?
shouldnt it be looking for commits from the tag to head, so in this case 17.0.3 to HEAD? |
This is because auto defaults to |
You could also just set |
Would that be the better way to define that configuration? Probably eh? |
The thing is you would also have to set the lerna config too I made it automatic so you should just need to upgrade auto |
You might need to edit the last tag/release to not have the |
Ill check that! thanks! |
Describe the bug
When running shipit, lerna errors out on the last step
This might be more related to lerna, as ive seen the errors reported a few times, but I was wondering if you guys had any suggestions since the lerna call is within auto?
EDIT: Testing locally returns different errors. Going to look into that further and followup!
The text was updated successfully, but these errors were encountered: