-
Notifications
You must be signed in to change notification settings - Fork 23
Update release scripts and configuration for Gitlab release #326
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
base: master
Are you sure you want to change the base?
Conversation
|
Right, so if you wanted this generically, you'd need to make this a parameter or something (ideally defaulting to the regular ManageIQ namespace) |
|
Our main goal in moving to a self-hosted GitLab environment is to manage and release certain custom developments and integrations that extend ManageIQ for our internal use cases. For example, we are integrating external platforms (such as Radware APIs) to enable managing SLB and WAF resources directly from within ManageIQ UI. To support these kinds of enhancements, we maintain our own repositories in our GitLab instance and handle releases independently. Therefore, in our setup, we intend to use our GitLab repository URLs for the release process instead of the standard ManageIQ GitHub repositories. |
bin/release_branch
Outdated
| # Ensure we move core to the source branch so that the symlinks from the | ||
| # other repos are correct | ||
| core_repo = MultiRepo::Repo.new("ManageIQ/manageiq") | ||
| core_repo = MultiRepo::Repo.new("xaasio-cmp/xaasio-cmp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this one of the opts in the Optimist.options block above?
Thinking:
opt :organization, "The organization name", :default => "ManageIQ"
opt :repo_prefix", "The prefix for repositories", :default => "manageiq"
then you can do
| core_repo = MultiRepo::Repo.new("xaasio-cmp/xaasio-cmp") | |
| core_repo = MultiRepo::Repo.new("#{opts[:organization]}/#{opts[:repo_prefix]}") |
bin/release_branch
Outdated
| contents.gsub!(/(github\.com.+?branch=)#{source_branch}\b/, "\\1#{branch}") | ||
| contents.gsub!(/(github\.com.+?\.svg)\)/, "\\1?branch=#{branch})") | ||
| contents.gsub!(/(coveralls\.io.+?branch=)#{source_branch}\b/, "\\1#{branch}") | ||
| contents.gsub!(/(gitlab\.xaasio\.com.+?branch=)#{source_branch}\b/, "\\1#{branch}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to proceed with this @agrare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it's worth changing this - unless your host has something like a github actions badge, it will be meaningless anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah @Fryguy
bin/release_tag
Outdated
| # depends on all of the other repos running their rake release scripts first. | ||
| repos = MultiRepo::CLI.repos_for(**opts) | ||
| repos = repos.partition { |r| r.name != "ManageIQ/manageiq" }.flatten | ||
| repos = repos.partition { |r| r.name != "xaasio-cmp/xaasio-cmp" }.flatten |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need the options here.
config/repos.sets.yml
Outdated
| xaasio-cmp/xaasio-providers-redfish: | ||
| xaasio-cmp/xaasio-providers-terraform_enterprise: | ||
| xaasio-cmp/xaasio-providers-vmware: | ||
| xaasio-cmp/xaasio-providers-workflows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to modify this file. This is for the bot when we do cross-repo-tests.
However, you might need to have your own set for other purposes. What you can do there is create your own repo set file like repos.xassio-cmp.yml, and have these alternative repos in it. Then when you call release_branch or release_tag, you can pass --repo-set xassio-cmp and it will use your list instead of the default list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that there's also an option in the set for each repo where you can specify a clone_source:
For example you could do
ManageIQ/manageiq-providers-workflows:
clone_source: [email protected]:xaasio-cmp/xaasio-providers-workflowsmultirepo would still clone into the ManageIQ/manageiq-providers-workflows directory, but it would use your clone_source as the origin.
This might not be enough for your purposes, but thought I'd mention the option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay @Fryguy , so I wasn’t able to achieve what I needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still mirror, you just don't override this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Fryguy, if I modify the multi-repo to use our internal GitLab, it will clone our repositories, right? Please correct me if I’m wrong.
config/settings.yml
Outdated
| :productization_name: manageiq | ||
| :productization_name: xaasio-cmp | ||
| :remotes: | ||
| :upstream: git@github.com:ManageIQ | ||
| :upstream: https://gitlab.xaasio.com/xaasio-cmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values should not be changed. If you need to override anything from this file you can create your own override settings.xassio-cmp.yml file, which I thikn will get automatically pulled in and override anything in the base settings.yml.
config/settings.yml
Outdated
| :productization_name: xaasio-cmp | ||
| :remotes: | ||
| :upstream: git@github.com:ManageIQ | ||
| :upstream: https://gitlab.xaasio.com/xaasio-cmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mirror section below not be changed because this is the source of the mirroring - if you need to change the destination of the mirroring, you can add in a downstream: key here and that will be used as the destination for the mirror. productization_name will be used as the repo prefix for the mirroring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @Fryguy ! Since I’m not fully familiar with the purpose of some of these files and configurations, I’m not confident about making the changes correctly. So only I requested a call, so in that we can discuss and do the things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mirror section here is for the git_mirror capability, so you can mirror all the upstream repos into a downstream location, optionally providing a productization_name prefix in case the target repo names are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Fryguy, So I need to do the mirroring in my Gitlab instance?
I already imported all the core and provider repos there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git_mirror tool is designed to be run on a schedule and it will continually mirror from upstream to downstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but if I change something in a file and during mirroring there is a change in that same file there will be conflict right?
|
Hi @agrare, now where should i configure, to use my GitLab repos instead of GitHub for cloning and creating release branches? |
|
@dhamo-ror you would create a settings file that contains your gitlab and list of repos like @Fryguy mentioned above |
|
@agrare, I made the changes based on the comments and pushed them, but they are not showing in this PR. Could you please take a look at this commit:- dhamo-ror@a4e0567 |
|
@dhamo-ror you wouldn't want to commit your settings files, they are specific to you |
I'm not sure on how to do this, so requesting your review on this Adam! |
|
you would keep an internal private repo with the override files. They can either be a branch that you keep up to date with this repository as it updates, or you could have a completely separate repo with the various configuration files. The only things that should be in this PR are the things that can be implemented generically such that anyone could use it. |
| repo.chdir do | ||
| # Ensure that spec/manageiq is symlinked | ||
| FileUtils.ln_sf(repo.path.join("../manageiq").expand_path, repo.path.join("spec/manageiq")) | ||
| FileUtils.ln_sf(repo.path.join("../xaasio-cmp").expand_path, repo.path.join("spec/manageiq")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| FileUtils.ln_sf(repo.path.join("../xaasio-cmp").expand_path, repo.path.join("spec/manageiq")) | |
| FileUtils.ln_sf(repo.path.join("../#{opts[:repo_prefix]}").expand_path, repo.path.join("spec/manageiq")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this particuilar file is the one that should be private to your org
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as well as this one.
Yeah @Fryguy, that’s exactly what I was trying to convey yesterday. I imported the manageiq-release repository into our GitLab instance as a separate repo and have been using that for internal release management, making changes there. Then you suggested creating a PR by adding the GitHub repo as a remote, so I created this PR accordingly. I’m seeking guidance on that internal release setup, and once that’s clarified, I’ll proceed with implementing the generic changes. |
|
Sorry - I guess I wasn't clear - I was suggesting that any code change you had to make could be pushed upstream in a generic way, so you don't have to maintain those. That is, as we make changes to the code in this repo, it's hard to carry patches locally, so if you can commit them in a generic way, they should just work in the future for you. I didn't meant to imply that any data-specific changes should also go to the PR, as the data is specific to you and not the ManageIQ project. |
Yes @Fryguy, So that only I asked a call and discuss the doubts instead of a PR! |
Hi @agrare, @Fryguy, @bdunne
As discussed created this PR, kindly review it and provide your recommendations, Thank You.