vishwanatharondekar / gitlab-cli Goto Github PK
View Code? Open in Web Editor NEWCreate a merge request from command line in gitlab
License: MIT License
Create a merge request from command line in gitlab
License: MIT License
Hi @vishwanatharondekar, have you considered adding option support for setting the assignee for e.g.
-a, --assignee [optional] Assignee for the merge request
As before happy to test the functionality in our environment.
Thanks,
Damian.
emmm,one day,when i push local branch to remote,this error occurred: could not read Username for 'http://xxx': Device not configured. but when i use ssh ,this error fixed,but this plugin can not work well. so , my problem is if it's true,and can you help me slove this problem.
It would be nice to print the URL to a successfully created merge request. For example:
$ lab merge-request -t upstream/master
https://gitlab.mycompany.com/my-org/my-app/merge_requests/6
I have already configured the gitlab url and gitlab token first.
Couldn't create merge request
404 - {"status":"404","error":"Not Found"}
below is the verbose log detail:
Verbose option used. Detailed logging information will be emitted.
Getting base branch information
Getting base branch name :
Argument provided : test
Base branch name obtained : test
Getting remote of branch : test
Executing git config branch.test.remote
Remote obtained : origin
Getting URL of remote : origin
Executing git config remote.origin.url
URL of remote obtained : [email protected]/tools.git
gitlab host obtained : gitlab.xxx-inc.com
Project name derived from host : xxxx/tools
Getting gitlab project info for : xxx/tools
Base project info obtained : "\r\n\r\n\r\n <meta charset="UTF-8">\r\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\r\n <script src="/home/js/jquery-1.11.3.min.js"></script>\r\n <script src="/home/js/jquery-adapter.js"></script>\r\n <script src="/home/js/common.js?11"></script>\r\n <script src="/home/js/xxxxx-face-login.js"></script>\r\n\r\n\r\n<div id="_umfp" style="width:0px;height:0px;overflow:hidden">\r\n\r\n<form method="post" id="form" action="" >\r\n <input type="hidden" name="action" value="PreLoginAction" />\r\n\t<input type="hidden" name="event_submit_do_PreLogin" value="false" />\r\n <input type="hidden" id="deviceIp" name="deviceIp" value=""/>\r\n <input type="hidden" id="trustEnvToken" name="trustEnvToken" value=""/>\r\n <input type="hidden" id="trustEnvTokenErrorInfo" name="trustEnvTokenErrorInfo" value=""/>\r\n <input type="hidden" name="caLoginKey" value=""/>\r\n <input type="hidden" name="umidTokenId" value="xxxx" >\r\n <input type="hidden" name="disableCert" value="true" >\r\n <input type="hidden" name="alipayFaceMetaInfo" id="xxxyFaceMetaInfo" value="" >\r\n \r\n\r\n<script type="text/javascript">\r\n window.ssoConfig = {\r\n 'sso_csrftoken': 'xxxx',\r\n 'intranet': 'true',\r\n 'ipAddr': 'xxxxx',\r\n }\r\n\r\n try {\r\n var metaInfo = getMetaInfo();\r\n if (metaInfo != undefined) {\r\n
Getting target branch information
Remote branch name obtained : develop
Getting remote of branch : develop
Executing git config branch.develop.remote
Remote obtained : origin
Getting URL of remote : origin
Executing git config remote.origin.url
URL of remote obtained : [email protected]/tools.git
Getting target project information
Target project info obtained : "\r\n\r\n\r\n <meta charset="UTF-8">\r\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\r\n <script src="/home/js/jquery-1.11.3.min.js"></script>\r\n <script src="/home/js/jquery-adapter.js"></script>\r\n <script src="/home/js/common.js?11"></script>\r\n <script src="/home/js/xxx-face-login.js"></script>\r\n\r\n\r\n<div id="_umfp" style="width:0px;height:0px;overflow:hidden">\r\n\r\n<form method="post" id="form" action="" >\r\n <input type="hidden" name="action" value="PreLoginAction" />\r\n\t<input type="hidden" name="event_submit_do_PreLogin" value="false" />\r\n <input type="hidden" id="deviceIp" name="deviceIp" value=""/>\r\n <input type="hidden" id="trustEnvToken" name="trustEnvToken" value=""/>\r\n <input type="hidden" id="trustEnvTokenErrorInfo" name="trustEnvTokenErrorInfo" value=""/>\r\n <input type="hidden" name="caLoginKey" value=""/>\r\n <input type="hidden" name="umidTokenId" value="xxxxx" >\r\n <input type="hidden" name="disableCert" value="true" >\r\n <input type="hidden" name="alipayFaceMetaInfo" id="alipayFaceMetaInfo" value="" >\r\n \r\n\r\n<script type="text/javascript">\r\n window.ssoConfig = {\r\n 'sso_csrftoken': 'xxxxx',\r\n 'intranet': 'true',\r\n 'ipAddr': 'xxxxx',\r\n }\r\n\r\n try {\r\n var metaInfo = getMetaInfo();\r\n if (metaInfo != undefined) {\r\n
Getting merge request title. Argument provided : merge this test branch to develop branch
Title obtained with -m option: merge this test branch to develop branch
Merge request title : merge this test branch to develop branch
Creating merge request
Couldn't create merge request
404 - {"status":"404","error":"Not Found"}
Installed using command: npm install git-lab-cli -g
How was it fixed (note that the command without --global as mentioned on your site doesn't work):
git config --global --add gitlab.url ""
git config --global --add gitlab.token ""
Opened up new terminal and tried command: lab --help
Expected Behavior:
C:\Users\sshaik>lab --help
Usage: index [options] [command]
gitlab command line utility
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
browse [options] Open current branch page in gitlab
compare [options] Open compare page between two branches
merge-request|mr [options] Create merge request on gitlab
merge-requests|mrs [options] Opens merge requests page for the repo
Actual Behavior:
C:\Users\sshaik>lab --help
'true' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:656
throw err;
^
Error: Command failed: git config --get gitlab.url || true
'true' is not recognized as an internal or external command,
operable program or batch file.
at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:653:13)
at Object.get (C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\options.js:11:16)
at C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\options.js:21:23
at Object.<anonymous> (C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\options.js:55:5)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\index.js:15:15)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
It'd be great to show open merge requests assigned to the user, or an option to list all of them currently opened.
gitlab-cli list-merge-request open
or gitlab-cli list-merge-request assigned
something like this.
What are your thoughts on it ? Happy to provide PR for this. ๐
Hi,
I tried to run the create-merge-request command but I got this error:
/usr/local/lib/node_modules/gitlab-cli/index.js:415
if (mergeRequestResponse.iid) {
^
TypeError: Cannot read property 'iid' of undefined
at /usr/local/lib/node_modules/gitlab-cli/index.js:415:47
at /usr/local/lib/node_modules/gitlab-cli/node_modules/gitlab/lib/ApiBaseHTTP.js:90:22
at _Class.wrap_response (/usr/local/lib/node_modules/gitlab-cli/node_modules/slumber/lib/API.js:192:18)
at _Class.wrap_response (/usr/local/lib/node_modules/gitlab-cli/node_modules/slumber/lib/API.js:4:59)
at Request._callback (/usr/local/lib/node_modules/gitlab-cli/node_modules/slumber/lib/API.js:265:24)
at Request.self.callback (/usr/local/lib/node_modules/gitlab-cli/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/usr/local/lib/node_modules/gitlab-cli/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
Do you know what the problem might be?
Thanks
Thanks for a great tool
Would love if this supported the release feature of GitLab.
As I see there is no way to use releases on small projects that do not already use the API. Being able to make a release directly from the command line would be very neat.
https://gitlab.au.dk/help/user/project/releases/index
https://gitlab.au.dk/help/api/releases/index.md
To extend the open-merge-requests command to take an argument.
The argument will be a remote, the command should open the merge web page of the repo associated with the remote.
For e.g. if a remote is defined called upstream([email protected]:upstream/joc.git) the command may look as below.
$ gitlab-cli open-merge-requests -r upstream
And open the webpage at
I have two repositories in my organization:
https://gitlab.com/kassellabs/videomatik
https://gitlab.com/kassellabs/videomatik-sample
When I try to open a merge request using lab merge-request
on videomatik
repository, it's opening the merge request on the videomatik-sample
repository. As it doesn't have the branch it just opens an empty merge request.
It may be related to something in the code that may use the URL prefix instead of the entire URL.
I did check if my remote is correct, and everything is correct.
The lab merge-requests
command works fine, open the merge requests of the correct repo.
I am having this issue, this runs on gitlab pipeline, it couldn't create the mr but it exits 0 ..
ORIGIN_BRANCH dev
TARGET_BRANCH staging
$ npx [email protected] merge-request --base "origin/$ORIGIN_BRANCH" --target "origin/$TARGET_BRANCH" --message "AUTOMATIC MERGE REQUEST FROM PIPELINE $ORIGIN_BRANCH > $TARGET_BRANCH" --labels "pipeline,automr,deploy,$TARGET_BRANCH" --print
npx: installed 103 in 13.781s
Couldn't create merge request
baseBranch is not defined # this is supposed to exit 1 to assume this couldn't make it
#
#
Job succeeded
lab browse
works for me without any problem.
However, when executing
lab create-merge-request -v -b "some_branch" -t "some_branch" -m 'some_message'
the output is:
Project info fetch failed : TypeError: Cannot read property 'headers' of undefined
I am using GitLab Community Edition 8.17.8 and gitlab-cli version 1.0.2.
If I change gitlab.url to some non-existing host, the result is the same.
Additionally, -v option does not print anything more (it should print request and response).
My gitlab server contains multiple projects organised in multiple groups.
gitlab.url points to the root path of the server (like "https://gitlab.yourcompany.com")
I also configured gitlab.token.
Compare option also fails:
lab compare -v -b "feature/abc" -t "develop"
Getting base branch name :
Argument provided : feature/abc
Branch name obtained : feature/abc
Base branch name obtained : feature/abcGetting remote of branch : feature/abc
Branch name obtained : feature/abc
Executing git config branch.feature/abc.remote
Remote obtained : originGetting URL of remote : origin
Executing git config remote.origin.url
URL of remote obtained : git@my_gitlab_server:some_group/some-project.gitProject info fetch failed : TypeError: Cannot read property 'headers' of undefined`
Hi! Just trying out lab
and I'm getting a cert validation error.
$ lab merge-request
Project info fetch failed : RequestError: Error: self signed certificate in certificate chain
The certs in use are signed by my company's CA, and I have the necessary certs installed to trust that CA (/etc/pki/ca-trust
). My browsers and other command line tools are honoring that, but it seems the HTTP package gitlab-cli is using is failing to trust that CA.
Any ideas? Thanks!
Oh yeah, I'm on Fedora 29.
return "Cannot read property 'green' of undefined" when i try to user commandline lab merge-request -b develop - t release
Adding an option to automatically merge to master if the merge request passes CI (it's possible on via the web interface)
Thanks
I am currently facing one problem
My git link is https://www.company.com/cool/new-project/sample.git
The expected name of the project should be cool/new-project/sample.git
but the regular expression only cut it to new-project/sample.git
Then the server return 404
Would it be possible that the project name can be passed by parameter or modify the regular expression so the project name can be used?
readlineSync asks for input gitlab url and token, but it crashes when using in gitlab pipelines.
Maybe adding a param so you don't ask for that when running on pipeline.
error is:
stty: invalid argument '-f'
/root/.npm/_npx/35/lib/node_modules/git-lab-cli/node_modules/readline-sync/lib/read.sh: line 49: can't create /dev/tty: No such device or address
When I try to do
lab merge-request
on the branch xxx I wish to merge, I get
Error occured :
Error: Command failed: git config branch.xxx.remote
2.0.7 works fine, but the latest version failed at gitlab.Projects.search, the error message is 401, not authorized.
I missed installation for global config and it's always hanging on. Yeah, it's some kinda minor issue, but seem you could make it more friendly.
Trying to run lab
and lab merge-request --help
:
0 kirby-pc 07:39:43 /d/home
โ $ lab
130 kirby-pc 08:00:37 /d/home
โ $ lab merge-request --help
130 kirby-pc 08:02:34 /d/home
โ $
Hello All,
I am getting below error while creating MR
Error occured :
{ Error: Command failed: git config branch.DisabledTest.remote
at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
killed: false,
code: 1,
signal: null,
cmd: 'git config branch.DisabledTest.remote' }
if available git config gitlab.url
& git config gitlab.token
should be used instead of env vars so that it's easy to work on projects on different gitlab instances
lab browse (this my command)
Error occured :
{ Error: Command failed: git config branch.release_vn_lua2_auto_convert_json_to_lua.remote
at ChildProcess.exithandler (child_process.js:273:12)
at ChildProcess.emit (events.js:180:13)
at maybeClose (internal/child_process.js:936:16)
at Socket.stream.socket.on (internal/child_process.js:353:11)
at Socket.emit (events.js:180:13)
at Pipe._handle.close [as _onclose] (net.js:541:12)
killed: false,
code: 1,
signal: null,
cmd: 'git config branch.release_vn_lua2_auto_convert_json_to_lua.remote' }
URL of remote obtained: my_ssh_config_alias:project/repo.git
gitlab host obtained: git.company.com
Remote at which branch_x is tracked is not a gitlab repository at git.company.com
You're copying hub, it's great, I think this should be more like it โ I tweaked my install like so:
gitlab-cli
to lab
โ either way I think dropping the cli would be better, of course it's clicreate-merge-request
to merge-request
(consistent with pull-request
)open-merge-requests
to merge-requests
(hub doesn't have this afaik)Also these would be good:
open
ing themYou might also want to consider renaming the project and emphasising the completeness / compatibility with hub more โ I went through 2 or 3 alternative gitlab-cli
or cli-gitlab
projects that didn't work before I got to this one
Great work thanks ๐ โ๏ธ
Edit: I decided to get off my ass and PR some of the above โ๏ธ
push the local branch before creating the merge request so that it works if we forgot (or are too lazy) to push it first
Add an .editorconfig
file so formatting can be standard across collaborators.
I usually have my repositories setup like this:
$ git remote -v
origin ssh://[email protected]:222/me/project.git (fetch)
origin ssh://[email protected]:222/me/project.git (push)
upstream ssh://[email protected]:222/source/project.git (fetch)
upstream ssh://[email protected]:222/source/project.git (push)
$ cat .git/config
[branch "my-branch"]
remote = upstream
merge = refs/heads/master
when I run gitlab-cli create-merge-request -v
I get an error saying:
Source project is not a fork of the target project
I have to specify both the base and the target. I have a wrapper that does this :
gitlab-cli create-merge-request -p -b origin/$(git rev-parse --abbrev-ref HEAD) -t upstream/master "@$"
is it the expected behavior ? can this be improved to automatically get the correct branch by default ? (the behavior of https://github.com/jsmits/github-cli seems sane)
I think the -p
option should be default for all commands, and there should be a flag for opening
The merge-requests
command could actually be made to work like hub issue
in that by default it uses the API to list out merge requests (on that note lab issue
would be handy too)
Afaik most tools require you do something like open $(echo 'http://example.com')
to open, i.e. they don't support it internally
Afaik this wouldn't break any BC in CI's given they'll be using the -p
flag which can still be supported even though it's default and redundant
lab merge-request -t TeP-2.0.1
Couldn't create merge request
Cannot read property 'green' of null
gitlab-cli v2.0.6
git v2.24.0
GitLab Community Edition 10.6.3
When I started writing this utility. Didn't expect it to grow like it has now. Will want to re-factor the code into smaller modules so maintenance / enhancements will not be a pain.
Have been asked by some. Will be great to have this.
that's all.thanks
You list 2 licenses, ISC in package.json and MIT in LICENSE, presumably you want one or the other
is it possible to add an options for text-based description input?
Thanks
If multiple remotes are defined on the project, the tool fails to detect the default target branch via the git config branch.master.remote
command.
This also occurs if the specific config value is not set.
Workarounds are:
-t origin/master
.The returned value remoteURL
contains a newline character in one of my projects.
When I run yarn lab mrs
, the value is like https://git.mycompany.com/me/my-project%0A/merge_requests
. There's a %0A
after the project name.
But it's OK in another project. Don't know why.
Lines 193 to 208 in 1a94539
When I try to make merge request:
$ gitlab-cli create-merge-request -b feature/GAS-1179/roundRatings -t release/1.0.0
/usr/local/lib/node_modules/gitlab-cli/index.js:358
var defaultBranch = project.default_branch;
^
TypeError: Cannot read property 'default_branch' of null
at /usr/local/lib/node_modules/gitlab-cli/index.js:358:38
at /usr/local/lib/node_modules/gitlab-cli/node_modules/gitlab/lib/Models/Projects.js:139:20
at /usr/local/lib/node_modules/gitlab-cli/node_modules/gitlab/lib/ApiBaseHTTP.js:86:22
at Function._Class.wrap_response (/usr/local/lib/node_modules/gitlab-cli/node_modules/slumber/lib/API.js:192:18)
at Function.wrap_response (/usr/local/lib/node_modules/gitlab-cli/node_modules/slumber/lib/API.js:4:59)
at Request._callback (/usr/local/lib/node_modules/gitlab-cli/node_modules/slumber/lib/API.js:215:26)
at Request.self.callback (/usr/local/lib/node_modules/gitlab-cli/node_modules/request/request.js:188:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/usr/local/lib/node_modules/gitlab-cli/node_modules/request/request.js:1171:10)
You have been updated the package but haven't updated the version in code.. if don't want to manage this, read the package.json
it is a JSON
and print the version
field.
if you do
$ npx -q git-lab-cli -V
1.0.2
$ npx -q [email protected] -V
1.0.2
$ npx -q [email protected] -V
1.0.2
$ npx -q [email protected] -V
1.0.2
I have a Gitlab repo (origin) that is forked from another Gitlab repo (upstream). Both repos have a branch called develop.
upstream/develop -> forked -> origin/develop -> cloned develop to my laptop.
I make changes in my clone and push to origin. Then I generate a merge request from origin/develop to upstream/develop.
Can the tool be used to generate a merge request for this? i.e something like
gitlab-cli create-merge-request -b origin/develop -t upstream/develop
Thanks in advance.
Damian.
I have just installed git-lab-cli with npm/ My git environment is properly set up. How can I sign up ?
thanks
Hi, good job @vishwanathd11
The problem arises because the default project name is not the one I want
lab merge-request -t equator -m aa -v
got: gitlab.com:nova_dubai/first-web.git // The first of all my projects
want: gitlab.com:nova_dubai/first.git
Thanks
Verbose option used. Detailed logging information will be emitted.
Getting base branch information
Getting base branch name :
Executing git rev-parse --abbrev-ref HEAD
Base branch name obtained : master
Getting remote of branch : master
Executing git config branch.master.remote
Remote obtained : origin
Getting URL of remote : origin
Executing git config remote.origin.url
URL of remote obtained : [email protected]:nova_dubai/first.git
gitlab host obtained : gitlab.com
Project name derived from host : nova_dubai/first
Getting gitlab project info for : nova_dubai/first
Base project info obtained : {"id":32506476,"description":"","name":"ๅทๅๅๅฐ","name_with_namespace":"nova_dubai / ๅทๅๅๅฐ","path":"first-web","path_with_namespace":"nova_dubai/first-web","created_at":"2022-01-02T13:11:59.643Z","default_branch":"main","tag_list":[],"topics":[],"ssh_url_to_repo":"[email protected]:nova_dubai/firit","http_url_to_repo":"https://gitlab.com/nova_dubai/first-web.git","web_url":"https://gitlab.com/nova_dubai/first-web","readme_url":null,"avatar_url":null,"forks_count":0,"star_count":0,"last_activity_at":"2022-01-15T23:23:36.075Z","namespace":{"id":12048031,"name":"nova_dubai","path":"nova_dubai","kind":"group","full_path":"nova_dubai","parent_id":null,"avatar_url":null,"web_url":"https://gitlab.com/groups/nova_dubai"},"container_registry_image_prefix":"registry.gitlab.com/nova_dubai/first-web","_links":{"self":"https://gitlab.com/api/v4/projects/32506476","issues":"https://gitlab.com/api/v4/projects/32506476/issues","merge_requests":"https://gitlab.com/api/v4/projects/32506476/merge_requests","repo_branches":"https://gitlab.com/api/v4/projects/32506476/repository/branches","labels":"https://gitlab.com/api/v4/projects/32506476/labels","events":"https://gitlab.com/api/v4/projects/32506476/events","members":"https://gitlab.com/api/v4/projects/32506476/members"},"packages_enabled":true,"empty_repo":true,"archived":false,"visibility":"private","resolve_outdated_diff_discussions":false,"container_expiration_policy":{"cadence":"1d","enabled":false,"keep_n":10,"older_than":"90d","name_regex":".*","name_regex_keep":null,"next_run_at":"2022-01-03T13:11:59.661Z"},"issues_enabled":true,"merge_requests_enabled":true,"wiki_enabled":true,"jobs_enabled":true,"snippets_enabled":true,"container_registry_enabled":true,"service_desk_enabled":true,"service_desk_address":"contact-project+nova-dubai-first-web-32506476-issue-@incoming.gitlab.com","can_create_merge_request_in":true,"issues_access_level":"enabled","repository_access_level":"enabled","merge_requests_access_level":"enabled","forking_access_level":"enabled","wiki_access_level":"enabled","builds_access_level":"enabled","snippets_access_level":"enabled","pages_access_level":"private","operations_access_level":"enabled","analytics_access_level":"enabled","container_registry_access_level":"enabled","emails_disabled":null,"shared_runners_enabled":true,"lfs_enabled":true,"creator_id":713145,"import_status":"none","open_issues_count":0,"ci_default_git_depth":50,"ci_forward_deployment_enabled":true,"ci_job_token_scope_enabled":false,"public_jobs":true,"build_timeout":3600,"auto_cancel_pending_pipelines":"enabled","build_coverage_regex":null,"ci_config_path":"","shared_with_groups":[],"only_allow_merge_if_pipeline_succeeds":false,"allow_merge_on_skipped_pipeline":null,"restrict_user_defined_variables":false,"request_access_enabled":true,"only_allow_merge_if_all_discussions_are_resolved":false,"remove_source_branch_after_merge":true,"printing_merge_request_link_enabled":true,"merge_method":"merge","squash_option":"default_off","suggestion_commit_message":null,"merge_commit_template":null,"squash_commit_template":null,"auto_devops_enabled":false,"auto_devops_deploy_strategy":"continuous","autoclose_referenced_issues":true,"keep_latest_artifact":true,"external_authorization_classification_label":"","requirements_enabled":false,"security_and_compliance_enabled":true,"compliance_frameworks":[],"permissions":{"project_access":null,"group_access":{"access_level":30,"notification_level":null}}}
Getting target branch information
Remote branch name obtained : equator
Getting remote of branch : equator
Executing git config branch.equator.remote
Remote obtained : origin
Getting URL of remote : origin
Executing git config remote.origin.url
URL of remote obtained : [email protected]:nova_dubai/first.git
Getting target project information
Target project info obtained : {"id":32506476,"description":"","name":"ๅทๅๅๅฐ","name_with_namespace":"nova_dubai / ๅทๅๅๅฐ","path":"first-web","path_with_namespace":"nova_dubai/first-web","created_at":"2022-01-02T13:11:59.643Z","default_branch":"main","tag_list":[],"topics":[],"ssh_url_to_repo":"[email protected]:nova_dubai/f.git","http_url_to_repo":"https://gitlab.com/nova_dubai/first-web.git","web_url":"https://gitlab.com/nova_dubai/first-web","readme_url":null,"avatar_url":null,"forks_count":0,"star_count":0,"last_activity_at":"2022-01-15T23:23:36.075Z","namespace":{"id":12048031,"name":"nova_dubai","path":"nova_dubai","kind":"group","full_path":"nova_dubai","parent_id":null,"avatar_url":null,"web_url":"https://gitlab.com/groups/nova_dubai"},"container_registry_image_prefix":"registry.gitlab.com/nova_dubai/first-web","_links":{"self":"https://gitlab.com/api/v4/projects/32506476","issues":"https://gitlab.com/api/v4/projects/32506476/issues","merge_requests":"https://gitlab.com/api/v4/projects/32506476/merge_requests","repo_branches":"https://gitlab.com/api/v4/projects/32506476/repository/branches","labels":"https://gitlab.com/api/v4/projects/32506476/labels","events":"https://gitlab.com/api/v4/projects/32506476/events","members":"https://gitlab.com/api/v4/projects/32506476/members"},"packages_enabled":true,"empty_repo":true,"archived":false,"visibility":"private","resolve_outdated_diff_discussions":false,"container_expiration_policy":{"cadence":"1d","enabled":false,"keep_n":10,"older_than":"90d","name_regex":".*","name_regex_keep":null,"next_run_at":"2022-01-03T13:11:59.661Z"},"issues_enabled":true,"merge_requests_enabled":true,"wiki_enabled":true,"jobs_enabled":true,"snippets_enabled":true,"container_registry_enabled":true,"service_desk_enabled":true,"service_desk_address":"contact-project+nova-dubai-first-web-32506476-issue-@incoming.gitlab.com","can_create_merge_request_in":true,"issues_access_level":"enabled","repository_access_level":"enabled","merge_requests_access_level":"enabled","forking_access_level":"enabled","wiki_access_level":"enabled","builds_access_level":"enabled","snippets_access_level":"enabled","pages_access_level":"private","operations_access_level":"enabled","analytics_access_level":"enabled","container_registry_access_level":"enabled","emails_disabled":null,"shared_runners_enabled":true,"lfs_enabled":true,"creator_id":713145,"import_status":"none","open_issues_count":0,"ci_default_git_depth":50,"ci_forward_deployment_enabled":true,"ci_job_token_scope_enabled":false,"public_jobs":true,"build_timeout":3600,"auto_cancel_pending_pipelines":"enabled","build_coverage_regex":null,"ci_config_path":"","shared_with_groups":[],"only_allow_merge_if_pipeline_succeeds":false,"allow_merge_on_skipped_pipeline":null,"restrict_user_defined_variables":false,"request_access_enabled":true,"only_allow_merge_if_all_discussions_are_resolved":false,"remove_source_branch_after_merge":true,"printing_merge_request_link_enabled":true,"merge_method":"merge","squash_option":"default_off","suggestion_commit_message":null,"merge_commit_template":null,"squash_commit_template":null,"auto_devops_enabled":false,"auto_devops_deploy_strategy":"continuous","autoclose_referenced_issues":true,"keep_latest_artifact":true,"external_authorization_classification_label":"","requirements_enabled":false,"security_and_compliance_enabled":true,"compliance_frameworks":[],"permissions":{"project_access":null,"group_access":{"access_level":30,"notification_level":null}}}
Getting merge request title. Argument provided : aa
Title obtained with -m option: aa
Merge request title : aa
Merge request description : undefined
Creating merge request
Merge request response:
{
id: 135356651,
iid: 3,
project_id: 32506476,
title: 'aa',
description: null,
state: 'opened',
created_at: '2022-01-15T23:53:25.458Z',
updated_at: '2022-01-15T23:53:25.458Z',
merged_by: null,
merged_at: null,
closed_by: null,
closed_at: null,
target_branch: 'equator',
source_branch: 'master',
user_notes_count: 0,
upvotes: 0,
downvotes: 0,
author: {
id: 9114706,
username: 'Naist4869',
name: 'Naist4869',
state: 'active',
avatar_url: 'https://secure.gravatar.com/avatar/0f0f86d6a5dc99ca7bc0231d78ed1cd4?s=80&d=identicon',
web_url: 'https://gitlab.com/Naist4869'
},
assignees: [],
assignee: null,
reviewers: [],
source_project_id: 32506476,
target_project_id: 32506476,
labels: [],
draft: false,
work_in_progress: false,
milestone: null,
merge_when_pipeline_succeeds: false,
merge_status: 'checking',
sha: null,
merge_commit_sha: null,
squash_commit_sha: null,
discussion_locked: null,
should_remove_source_branch: null,
force_remove_source_branch: false,
reference: '!3',
references: { short: '!3', relative: '!3', full: 'nova_dubai/first-web!3' },
web_url: 'https://gitlab.com/nova_dubai/first-web/-/merge_requests/3',
time_stats: {
time_estimate: 0,
total_time_spent: 0,
human_time_estimate: null,
human_total_time_spent: null
},
squash: false,
task_completion_status: { count: 0, completed_count: 0 },
has_conflicts: false,
blocking_discussions_resolved: true,
approvals_before_merge: null,
subscribed: true,
changes_count: null,
latest_build_started_at: null,
latest_build_finished_at: null,
first_deployed_to_production_at: null,
pipeline: null,
head_pipeline: null,
diff_refs: null,
merge_error: null,
user: { can_merge: false }
}
With reference to discussion on #38 (comment)
I contacted the owner of https://www.npmjs.com/package/gitlab-cli . He is ready to transfer the ownership if we will keep the backward compatibility.
Need to evaluate the options.
If we try to use the command in any of the sub-directories like git command.
It fails due to failure to save PULL_REQUEST_TITLE file in the editor.
One of the solution can be to get the base directory of the repo before running the command.
Another solution is to create the file at current directory and do cleanup after command is done.
Issue
$ gitlab-cli browse
/usr/local/lib/node_modules/gitlab-cli/index.js:70
logger.log('\nGetting base branch name');
^
TypeError: Cannot read property 'log' of null
at getBaseBranchName (/usr/local/lib/node_modules/gitlab-cli/index.js:70:9)
at browse (/usr/local/lib/node_modules/gitlab-cli/index.js:138:3)
at Command.<anonymous> (/usr/local/lib/node_modules/gitlab-cli/index.js:366:5)
at Command.listener (/usr/local/lib/node_modules/gitlab-cli/node_modules/commander/index.js:301:8)
at emitTwo (events.js:106:13)
at Command.emit (events.js:191:7)
at Command.parseArgs (/usr/local/lib/node_modules/gitlab-cli/node_modules/commander/index.js:615:12)
at Command.parse (/usr/local/lib/node_modules/gitlab-cli/node_modules/commander/index.js:458:21)
at Object.<anonymous> (/usr/local/lib/node_modules/gitlab-cli/index.js:385:9)
at Module._compile (module.js:571:32)
Running on OSX, installed using
$ npm install https://github.com/vishwanatharondekar/gitlab-cli.git -g
$ uname -a
Darwin doneill-mbp 15.6.0 Darwin Kernel Version 15.6.0: Wed Nov 2 20:30:56 PDT 2016; root:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64
$ git --version
git version 2.11.0
$ npm -v
4.0.5
$ node -v
v7.4.0
Both GITLAB_URL and GITLAB_TOKEN set.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.