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

batch mode for forked project #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bigc2000
Copy link

When source project is not the same main project, such as forked project, It cannot merged in batch mode when git merge command executes.
I tested on 0.9.4 version in gitlab before. I hope this may help someone.
The errors in stderr as follows,

2021-02-09 23:35:12,133 INFO Running git -C /tmp69xfoh8v/tmpq_9azzie merge origin/ark_region_fix --ff --ff-only
2021-02-09 23:35:12,142 WARNING git returned 1
2021-02-09 23:35:12,142 WARNING stdout: b''
2021-02-09 23:35:12,142 WARNING stderr: b'merge: origin/ark_region_fix - not something we can merge\n'
2021-02-09 23:35:12,142 WARNING merge failed, doing an --abort
2021-02-09 23:35:12,142 INFO Running git -C /tmp69xfoh8v/tmpq_9azzie merge --abort
2021-02-09 23:35:12,146 WARNING git returned 128
2021-02-09 23:35:12,146 WARNING stdout: b''
2021-02-09 23:35:12,146 WARNING stderr: b'fatal: There is no merge to abort (MERGE_HEAD missing).\n'
2021-02-09 23:35:12,146 ERROR BatchMergeJob failed: Command '[b'git', b'-C', b'/tmp69xfoh8v/tmpq_9azzie', b'merge', b'--abort']' returned non-zero exit status 128.
Traceback (most recent call last):
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 185, in git
    return _run(*command, env=env, check=True, timeout=timeout_seconds)
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 211, in _run
    retcode, process.args, output=stdout, stderr=stderr,
subprocess.CalledProcessError: Command '[b'git', b'-C', b'/tmp69xfoh8v/tmpq_9azzie', b'merge', b'origin/ark_region_fix', b'--ff', b'--ff-only']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 120, in _fuse_branch
    self.git(strategy, target, *fuse_args)
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 190, in git
    raise GitError(err)
marge.git.GitError: Command '[b'git', b'-C', b'/tmp69xfoh8v/tmpq_9azzie', b'merge', b'origin/ark_region_fix', b'--ff', b'--ff-only']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 185, in git
    return _run(*command, env=env, check=True, timeout=timeout_seconds)
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 211, in _run
    retcode, process.args, output=stdout, stderr=stderr,
subprocess.CalledProcessError: Command '[b'git', b'-C', b'/tmp69xfoh8v/tmpq_9azzie', b'merge', b'--abort']' returned non-zero exit status 128.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/bot.py", line 160, in _process_merge_requests
    batch_merge_job.execute()
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/batch_job.py", line 321, in execute
    source_repo_url=source_repo_url,
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/batch_job.py", line 179, in accept_mr
    self._options.use_no_ff_batches,
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/batch_job.py", line 123, in merge_batch
    self.git(strategy, '--abort')
  File "/nix/store/vn94z48nxysnirpx7pkqacygmkgr1q18-python3.6-marge-0.9.4/lib/python3.6/site-packages/marge/git.py", line 190, in git
    raise GitError(err)
marge.git.GitError: Command '[b'git', b'-C', b'/tmp69xfoh8v/tmpq_9azzie', b'merge', b'--abort']' returned non-zero exit status 128.

@@ -177,6 +180,8 @@ def accept_mr(
merge_request.target_branch,
merge_request.source_branch,
self._options.use_no_ff_batches,
source_repo_url,
merge_request.source_project_id == merge_request.source_project_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
merge_request.source_project_id == merge_request.source_project_id
merge_request.target_project_id == merge_request.source_project_id

@qqshfox qqshfox changed the title bug fix,add batch mode for forked project batch mode for forked project May 11, 2021
@qqshfox
Copy link
Contributor

qqshfox commented May 11, 2021

Thank you @bigc2000 for contributing this PR. Might need some help from the community to verity this since internally we don't use fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batching Merge Requests doesn't work for forking workflow
2 participants