how to get top level group name in project pipeline? - gitlab

Currently, I'm working on Gitlab. As part of my task I need to display group id, projectid, runas, job id and job name etc.. in gitlab ci pipeline. I was able to display all required values except group id. searched in google to identify default variables for parent ( top-level-groups) but no luck. Can anyone help me with this?
Please don't mind that I'm not posting my pipeline link.
looking for suggestions .. please help me.
Note: Not looking API based suggestions
Thanks in Advance

$CI_PROJECT_NAMESPACE should be either the group, or the user name if it is a private project. GitLab uses the name namespace for this both in the variables and through the API, but it makes it a bit harder to find if you are looking for group.
Here are all pre-defined variables in GitLab:
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html

Related

how to export all projects inside a group in gitlab

we are migrating from self hosted gitlab to gitlab.com subscription. We have parent 28 group and under these groups there are multiple subgroups and projects.
I know I can export one group and it will export all the subgroups under it and then I can import it.
but documentation says to export/import single project at a time. I have almost 3000+ Projects and doing this things 3000+ time is not possible.
Can you please suggest me How can I export/import all the projects under a group regardless it is in a group or under someother subgroup in hierarchy ?
or is there any other way ?
You will need to write scripts that interact with the GitLab API to perform the migration of groups/orgs, projects, branches, and merge requests. See the following post on GitLab's forum for guidance.

Can not create agent in dialogflow

I can not create a new agent. When I am clicking on create then it is cancelled
It could be that you are trying to use a GCP Project that already has an agent (only one agent is allowed per GCP project). Try to choose another GCP Project and see if that works.
Followed this quickstart and did not find any problem. Please, make sure that you have followed the previous steps required to create an agent: the setup and the basis.
Also, as it was commented before, each project can have at most, one agent per region.
If this path does not help, please provide me with more details about your particular situation with this agent, just bear in mind to suppress all kinds of sensitive information regarding your project and your data.

Azure Devops - YAML Release Pipelines - How to select a specific artefact from a build pipeline using a dropdown list

So, recently I set about migrating our Azure Devops Classic Release pipeline to a YAML based one.
What I'm struggling to reproduce is the ability you have with a Classic Release pipeline to select a specific artefact from an associated build pipeline using a dropdown list.
The only way I've found to allow a user to specify a specific artefact is via a parameter, but the definition of dropdown lists is only possible if you know all of the values that will be in the list.
This link is the closest thing I've found that resolves the issue, but even this doesn't allow the specification of a dropdown: https://www.huuhka.net/runtime-artifact-selection-in-azure-pipelines-yaml/
Anyone know how to do this, or even if it is possible?
Ok, so I didn't quite answer the question I posed, but I found an answer that solves the issue I have.
The problem I had is that I want a user to be able to select a specific build at release time.
This is poorly documented and it was a surprise when I saw it working.
In your release pipeline specify a resource:
resources:
pipelines:
- pipeline: YourBuildPipelineReference
source: "Your Build Pipeline Name"
Now when you come to run your pipeline you see the following:
Click Resources and you are now taken to list where you can select a specific build.
Didn't see this before, but I figure lots of people will need this.

Probot App throwing "Resource Not Accessible By Integration" when trying to merge PRs

I have been trying to create a simple Probot app that amongst other things will merge PRs on certain criteria being met. (I am aware prebuilt solutions are available, however not only do they not quite fit my needs, I won't learn anything).
Using context.github.pulls.merge(context.issue()) returns: ERROR probot: Resource not accessible by integration
I have tried replacing context.issue() with the object the docs suggest its looking for.
Googling although difficult to find similar issues, suggest its a permission issue, I have double checked the permissions and at one stage given the app every permission.
Things worth noting:
There are no github actions setup on this repo
The repo belongs to a testing org, the bot app has access to all repos in the org
The repo was initially private, but have also tested in public
Any nudge in the right direction will be greatly appreciated.
Thanks
I see it has been quite a while since you posted this question.
You should not be using context.github.pulls.merge(context.issue()) in the first place. This will never work given the signature of the actual merge method(). You said you have tried following the doc's suggestion.
Is this the doc you are referring to?
The doc clearly suggests to provide owner, repo and pull_number to context.github.pulls.merge().
Did you try that? Please dod share your findings.

How to share group repository in GitLab 6.0.0

I just installed GitLab 6.0.0 and I am now trying to create a group in order to share a common repository with other users. So I created the group and then added the users I want as owners of this group.
The problem is that the group members don't seem to be able to choose the corresponding namespace when they creating a new project.
Is this a bug? or am I missing something?
Any help is welcomed, thanks.
Best regards,
Michael Pinheiro
It looks like this bug: issue 4900
workarounds:
I should also mention that if User B now creates a Group Y, he is now able to create projects for Group X and Y. (which is a simple workaround)
The other work-around is to have the user create the project in their personal namespace first, then when the repo is created go to settings -> dangerous settings -> change namespace option.
A patch should be proposed soon to fix that bug, which seems to be related to app/models/user.rb (lines 293-295 and lines 331-333)

Resources