-
Notifications
You must be signed in to change notification settings - Fork 72
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
lockfile updates failing to push when using the amend option #174
Comments
it looks like the push limits to just the should the |
@finnp sorry to ping you directly, but since you've given feedback on this feature along the way, i'm hoping you have a few thoughts you could provide. i'd really like to help move this forward toward a fix, but i'm not quite sure what to try since the error above doesn't give much info. even if i fork and depend on a version with my own guesses, i'd have to wait for a greenkeeper PR to be sent to the project that i updated to even get feedback of whether i'm on the right track. i've been generating several new projects with this option set, so i'm wondering if waiting to help fix this is the next move i need to make or if i need to start disabling this option on those projects for now |
Since we are adding a new remote here, I wonder if we'd have to fetch the new remote locally before using |
Assuming that is actually the problem, I wonder if something like this would give us the protection of git push${process.env.GK_LOCK_COMMIT_AMEND ? ` --force-with-lease=${info.branchName}:origin/${info.branchName}` : ''} gk-origin HEAD:${info.branchName} |
I have the same problem on this CircleCI build. IMO
|
i tried forking and making an update to leverage the suggestion from @richardson-trevor above. it does enable successful pushing of the amended commit, so thanks a ton for that info @richardson-trevor! however, this results in looping of the builds because i'll go ahead and send a PR the change that enables the push, but we really need to get the looping behavior solved as well before the amend feature is actually usable. |
it looks like the to get the check to work with amends, it could possibly confirm that it has the commit made by the greenkeeper bot, but has both the |
Thanks for merging @janl :) I've been a bit busy since my last reply, so i haven't looked further into updating the checks in |
@travi parsing by commit message was the simplest thing I could get to work, but if you manage to parse any other identifier, like the committer, we could match for that easily too |
I'll try to take a look when i get a chance, but I'm worried that having the amend option enabled without that part fixed will now result in a build lol that will never stop. I probably have a few projects or there where i haven't disabled yet, so this would cause some trouble in it's current state. just wondering if a fix for this might need some additional attention before i can get back to it. |
just to clarify the issue that remains after that PR was merged, i want to keep this piece visible:
|
i havent verified that this solves the problem yet, but its looking like if we change greenkeeper-lockfile/lib/git-helpers.js Line 44 in e3dc688
exec(`git show --oneline --name-only origin/${info.branchName}...${defaultBranch} | grep package-lock.json`) it should get us pretty close to what we're after |
This looks fine! |
Correction, we also have to grep for |
Amend commits might obscure the commit message, which we were using previously to determine whether greenkeeer-lockfile has run before. This commit changes the detection to looking at the files changed for the list of commits that are on the current branch. It stops the run, if it includes at least one of these lockfiles: - package-lock.json - npm-shrinkwrap.json - yarn.lock Part of #174
Amend commits might obscure the commit message, which we were using previously to determine whether greenkeeer-lockfile has run before. This commit changes the detection to looking at the files changed for the list of commits that are on the current branch. It stops the run, if it includes at least one of these lockfiles: - package-lock.json - npm-shrinkwrap.json - yarn.lock Part of #174
Amend commits might obscure the commit message, which we were using previously to determine whether greenkeeer-lockfile has run before. This commit changes the detection to looking at the files changed for the list of commits that are on the current branch. It stops the run, if it includes at least one of these lockfiles: - package-lock.json - npm-shrinkwrap.json - yarn.lock Part of #174
Amend commits might obscure the commit message, which we were using previously to determine whether greenkeeer-lockfile has run before. This commit changes the detection to looking at the files changed for the list of commits that are on the current branch. It stops the run, if it includes at least one of these lockfiles: - package-lock.json - npm-shrinkwrap.json - yarn.lock Part of #174
🎉 This issue has been resolved in version 2.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
thanks so much for taking this over the finish line, @janl i'll get it pulled into a few projects to confirm there are no other surprises, but i think this should be the last of them |
Thanks @travi ^5 |
unfortunately, with
seems unrelated to the changes for amend, but its preventing me from confirming that our changes fully get this working. this was from a private repo, but if i see it come up for one that is public, i'll post a link in case it provides any more context. |
@janl since these fixes got merged into what is being released as |
Fair enough. Thanks for keeping it moving along. I'll give it another shot today with the latest changes |
sorry for not following up before now, but i've been distracted with other things after running into what i thought were still unrelated (to the amend related changes) issues with notice that there is only 1 commit, but two changed files (including the lockfile), in this PR |
@janl any interest in reconsidering pulling this change over to the |
i've been noticing that my lockfiles are not up to date on several projects lately, but didnt pay close attention since random churn isn't uncommon with the lockfiles quite yet. however, now that i've finally looked into it, i do see failures like this one in several projects.
it appears to be related to the force push failing for some reason on projects where i've enabled the option to amend rather than adding an additional commit by setting
GK_LOCK_COMMIT_AMEND
. i thought i've seen that working after my PR to force push was accepted, but i'm having trouble finding any supporting evidence. i must have just accepted the removal of the second commit to mean it was working.since the output doesn't give much to go on, would you maybe have any suggestions to debug this further? i am really surprised that the
--force-with-lease
was not the appropriate fix in this case.The text was updated successfully, but these errors were encountered: