I would like to create a list of projects within a "group" using the terminal in my machine. The group is private and I'm assuming I need a personal access token to reach it.
I saw in Gitlab API I should use POST command for this: https://docs.gitlab.com/ee/api/projects.html#create-project. But I don't see how to specify the group I want to create it into. Using this question: How do you create a project in a specific group via GitLab API?, I could write the command:
curl --header "PRIVATE-TOKEN: my-personal-access token" -X POST "https://gitlab.com/api/v4/projects?name=mylaboratory%2Fgroupname%2Fproject name"
After that I'm getting:
{"message":{"name":["can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'."],"path":["can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'"]}}
Here is my example url:
https://gitlab.eth.ch/api/v4/projects?path=lasec%2Fstudent-repos-cs372-2021%2Fgroup31
Is there a way to specify these new projects should disable rewriting commit history?
Try 1
Fixed changing .com to the relevant extension.
Try 2
From another computer the error curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) goes away, this may be related to the connection as pointed in the comments.
Try 3
The attribute you're looking for in the API is the namespace_id, and should be the ID of the group that you'd like to create the project within. If you wanted to create a nested group structure, each group you create can accept a parent_id which should be the ID of its parent.
Related
I'm wondering if you can use wildcard characters with tags to get all tagged scenarios/features that match a certain pattern.
For example, I've used 17 unique tags on many scenarios throughout many of my feature files. The pattern is "#jira=CIS-" followed by 4 numbers, like #jira=CIS-1234 and #jira=CIS-5678.
I'm hoping I can use a wildcard character or something that will find all of the matches for me.
I want to be able to exclude them from being run, when I run all of my features/scenarios.
I've tried the follow:
--tags ~#jira
--tags ~#jira*
--tags ~#jira=*
--tags ~#jira=
Unfortunately none have given my the results I wanted. I was only able to exclude them when I used the exact tag, ex. ~#jira=CIS-1234. It's not a good solution to have to add each single one (of the 17 different tags) to the command line. These tags can change frequently, with new ones being added and old ones being removed, plus it would make for one real long command.
Yes. First read this - there is this un-documented expression-language (based on JS) for advanced tag selction based on the #key=val1,val2 form: https://stackoverflow.com/a/67219165/143475
So you should be able to do this:
valuesFor('#jira').isPresent
And even (here s will be a string, on which you can even do JS regex if you know how):
valuesFor('#jira').isEach(s => s.startsWith('CIS-'))
Would be great to get your confirmation and then this thread itself can help others and we can add it to the docs at some point.
My team is working to integrate an infrastructure-as-code scanning solution into our build pipelines and we've discovered that the string "GCP" is being replaced with three asterisks when tasks are being executed in our build pipelines. This isn't unique to one task either whereas I created a bash script to execute and list our our repository and all directories that start with "GCP" are replaced by the three asterisks. The only variable set using the "GCP" value is the "system.teamProject" variable and we are not using any secret values that I know of and there are no variable groups used.
Any help would be greatly appreciated. Thanks!
Bash Asterisk Output "ls -a"
IaC Scanning Asterisk Task Failure
If you have set any secret variables in your pipeline, or have linked any variable groups that contain secret variables (include the secrets from the connected external and remote services services), generally the values of these secrets will be masked as asterisks.
When you try to print the values of the secrets to the output logs, the values will display as asterisks in the logs. If you try to output the values into a text file, the values will still display as asterisks in the file.
In addition, if a string that is not set as secret but its substrings are the values of some existing secrets in the pipeline, these substring parts may be masked as asterisks when trying to output this string.
If you do not set any secrets, for us to investigate this issue further, would you like to share us with the actual value that was masked as asterisks in the the logs? We well investigate and evaluate whether this string contains some special or sensitive characters that may be automatically identified as secrets by Azure DevOps.
I am using DevOps pipeline to build and deploy to different environments
For one environment I am encountering this issue where i am using a Pipeline Variable with $$ in the value
For Example:
Password pipeline variable with value = $omeCla$$Password
When i deploy it fails and when i check the logs the password is displayed as $omeCla$Password. So basically when $$ are together it drops one $
For all variable i am using regex __VaraibleValue__ and its working fine
I have tried:
$omeCla$\$Password to try and escape and it displays as $omeCla$\$Password . So basically \ doesn't work.
I tried '$omeCla$$Password' to try and escape and it displays as '$omeCla$Password'
I want to keep this value as a normal pipeline variable before review
So basically how can I escape this?
Or should I add a Secret Token here in the replace token task (see screenshot below)? and then make the pipeline variable secret? If so, what should I set for Secret Token? Also, in app.config in my repo what should I use instead of the regex __VariableName__ that I use for normal variables?
The solution was to use 4 $. So if you have $$ together you need to add $$$$
Example: $someCla$$$$Password
#JaneMa-MSFT as requested
https://developercommunity.visualstudio.com/content/problem/1296808/azure-pipeline-how-to-escape-special-characters-in.html
I have 3 work spaces in Agile Central(rally). i want to pull all the projects from the 2 work spaces out of these 3.
I am using pyral python package.
Below is the code snippet:
from pyral import Rally
return Rally(server='rally1.rallydev.com', apikey=decoded_key, workspace=['Test-WORKSPACE-1', 'Test-Workspace-2'], projectScopeDown=False,verify_ssl_cert=False)
The above code throws error.
pyral.context.RallyRESTAPIError: Multiple workspaces (3) found with the same name of '['Test-WORKSPACE-1', 'Test-Workspace-2']'. You must specify a workspace with a unique name.
My system account has read access on all the 3 work spaces and all the projects within these 3 works spaces.
Can i specify multiple workspaces when query rally API? Am i doing something wrong here. Thank you so much for all your help here in advance.
Github API allows us to search users by different parameters, and one of those parameters is location. Running the following query will give all the users living in Pakistan:
curl https://api.github.com/search/users?q=location:pakistan
Now, I would like to get all the users that either live in Pakistan or in India, but it seems that Github doesn't define a way for having an or between Pakistan & India.
I have tried the following queries, but these aren't working:
curl https://api.github.com/search/users?q=location:pakistan&location:india
curl https://api.github.com/search/users?q=location:(pakistan|india)
Your first attempt is close, but doesn't work because location isn't its own HTTP GET argument. The entire string location:pakistan is the value to the q parameter.
When you do ?q=location:pakistan&location:india you are actually submitting something like
q has the value location:pakistan
location:india is a key, but has no value
Instead, join multiple location keys with + or %20:
curl https://api.github.com/search/users?q=location:pakistan+location:india
Now the entire location:pakistan+location:india string is passed as the value to the q key.
A literal space can work too, but then you have to escape it or wrap the arguments in quotes.