Description
Describe the Bug
My git repo for module install is called gitlab.com.some.thing
and because of that when running bolt module install
the url is malformed when gitlab.rb
is envoked, producing something like gitlab.com/gitlab.com.example.domain
. This is obviously wrong and causes a resolving error.
Expected Behavior
When presented with an url that includes gitlab.com as part of the domain name, I would like gitlab.rb
to handle the domain ensuring the produced result remains gitlab.com.example.domain
.
Steps to Reproduce
Steps to reproduce the behavior:
- Initiate a bolt project
- Add a custom module to your
bolt-project.yaml
file, ensuregit:
is set togitlab.com.some.thing/team/project.git
(for example). - run
bolt module install
Environment
- Version: debian package puppet-bolt 3.30.0-1jammy amd64
- Platform: Ubuntu 22.04
Additional Context
I have a temporary work-around that bypasses this issue, but I'm statically defining the target gitlab url (in a few places), which is clearly wrong. I'm no coder though so not submitting an MR, just for notes.
In this file /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.30.0/lib/bolt/module_installer/specs/id/gitlab.rb
I changed these lines:
26 private_class_method def self.parse_repo(git)
27 domain = 'gitlab.com.some.thing'
28
29 if git.start_with?("git@#{domain}:")
30 git.split("git@#{domain}:").last.split('.git').first
31 elsif git.start_with?("https://#{domain}")
32 git.split("https://#{domain}/").last.split('.git').first
33 end
34 end
43 metadata_url = "https://gitlab.com.some.thing/#{repo}/-/raw/#{ref}/metadata.json"
65 url = "https://gitlab.com.some.thing/api/v4/projects/#{CGI.escape(repo)}/repository/commits/#{ref}"