Skip to content
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

Add additional validation when creating merge requests #20

Closed
zaquestion opened this issue Oct 5, 2017 · 4 comments
Closed

Add additional validation when creating merge requests #20

zaquestion opened this issue Oct 5, 2017 · 4 comments

Comments

@zaquestion
Copy link
Owner

zaquestion commented Oct 5, 2017

I've run into 2 cases where lab permitted creating an MR when it really shouldn't have.

  • source branch was not present on source remote (creates an MR with an unavailable branch)
  • source branch is already up to day with target
    • observed when forgetting to commit changes and starting an MR
@zaquestion zaquestion added the bug label Oct 5, 2017
@bmess
Copy link
Contributor

bmess commented Oct 9, 2017

I observed the first bullet point this evening. I don't think it's the fault of the tool, but perhaps it would provide expected behavior of it checked for the source branch to exist.

I think automatically pushing the branch could be dangerous, but maybe if it's not force pushed? I'm not sure.

Just a warning from the MR creation that source branch doesn't exist & and exit might be enough. Maybe include a flag to automatically push the branch if it doesn't exist, as long as it's up to the user to do the override from the less dangerous behavior of a push without alerting.

edit:

git version 2.13.6
lab version 0.3.1

@zaquestion
Copy link
Owner Author

Tempted to change the defaults when I fix this as well. Currently lab assumes origin/upstream if the branch doesn't point to its remote. Perhaps the forked remote should be the default which would likely reduce the chances of hitting this case entirely.

zaquestion added a commit that referenced this issue Nov 10, 2017
[#20] (mrCreate) default to forked-from branch and check for branch pushed
@zaquestion
Copy link
Owner Author

Bullet point 1 fixed in 0.5.2

@bmeneg
Copy link
Collaborator

bmeneg commented Jun 15, 2021

Bullet point 2 fixed in 0.22.0 by 4f8cc17.

@bmeneg bmeneg closed this as completed Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants