Assign a Group Variable to a Project Variable in the GitLab UI - gitlab

I have a GitLab Project that belongs to a Group. I've defined a number of common variables in the group that I would like to reuse in my projects. I know these variables are inherited by the project, but I would like to be able to re-assign the target group variables from the project as needed.
Is there way to target a group variable from a project? I suspect not, because using the $VAR_NAME syntax results in a warning stating the variable cannot be masked (due to the $).

"Masking" in GitLab means that it would replace the value with asterisks. I.e. *******. Which, if it is not able to, like on your screenshot, GitLab warns about.
According to the warning the variable will get expanded if such a group level variable exists; means it would do what you expect it to. Though you need to be aware, that your variables values may be in plaintext in the job log.
How it behaves depends on how you configured the group level variable in this case:
If the group level variable is set to be masked, then it will be masked in the expanded project level variable as well.
But you can not mask the expanded variable at the project level, if you did not set the group level variable to be masked in the first place.
A way to work around this uncertainty would be, to directly use the group level variable. Though I can see that this might not always be possible depending on for example differing frameworks used in the projects of a group.

Related

In Terraform, is it possible to change the casing of values?

I have an ID of a resource and the ID states that the value is known as "/Subscriptions/xxxxxxx-xxxxxx-xxxxxx-xxxxx/" and when leveraging the data resource, "azurerm_subscription "current" ", to get the current subscription data, I get the output of "/subscriptions/xxxxxxx-xxxxxx-xxxxxx-xxxxx/".
You will notice that the only difference between the two values is the Upper case S in the word "Subscriptions". When making terraform changes to use "azurerm_subscription.current.id", instead of hardcoding the Subscription ID value in other resources, it fails to acknowledge the syntax is the same and is telling me that I need to replace the resource I am working with (in this situation I am working with a data disk on a vm). I do not want to destroy the disk and recreate it using just a different casing of the word subscription.
Is this task possible? Am I able to place anything into the main.tf file I am working with to change this casing? I have tried "title(data.azurerm_subscription.current.id)" and it does work in changing the s to an upper case S, however, it also makes all other "first words" that start with an alphabet letter upper case as well (not desired result). I just want to upper case the very first word.
Kind of a loaded question, but any thoughts on this?

Define what Stages to run in a Jenkins Pipeline based on View Tab

I have a Jenkinsfile that lets me decide what GitHub branch to build on as a 'Build with Parameters' build step. The variable is defined in the Jenkinsfile.
What I need is a way to also decide what environment to build in i.e Dev, Staging, PreProd, Prod, where environment is selected based on the 'view' the job is in. Only certain build Stages will run based on that 'view'
Is this possible via a Jenkinsfile?
Views can include projects, but from inside the project there's no concept of a view.
A common approach is to add a parameter to your project that specifies the build target environment. With that, you might be able to recreate your views with something like the View Job Filters Plugin.
Filter by Job Parameterization
Use Regular Expressions to include or exclude parameterized jobs based on their build parameters.
Match the parameter name, build value, or description. Alternately, you may opt to depend on the default configured value.
For the name, value, and description - a blank indicates you do not care about that field - it behaves as if you had assigned it the regular expression ".*".
This filter works with String, Boolean, File, Choice, and Validating String parameter types.

Need clarification on creating Tasks in Asana

The documentation for tasks seems to imply that the POST method uses name/value pairs as the data payload (I'm assuming for a content type of application/x-www-form-urlencoded). Can it accept JSON instead, using the same format as the data returned from a GET call for tasks?
Also, the Memberships field is supposed to contain an array of projects and sections. There's already a Projects field for a task - do those projects need to be duplicated in the list of projects for Memberships or can just the sections be included?
Yep, it's totally possible to use a JSON payload (with the correct Content-Type: application/json) - in fact, in a number of scenarios - like this one - it's considerably easier.
I don't recall off of the top of my head the right way to get this going with form data (if I recall, we might have an outstanding bug filed about it :) ), but with JSON, you should be fine if you specify the project in both locations. I don't think you can get away with not specifying any values in projects (unless you specify a workspace, which might work).
I don't think you can specify only the section. Finally, I think if you specify a different project in each location, it will put it into both: into projects in the "no section" area for whichever ones are in the projects property and put it in the specified sections for those specified in memberships

Shopware 5 accessing controller variables (Template Variables) on frontend

The technical term given in many articles for this is Template Variables. I am trying to understand how we can find the variable name given in the controller for a specific field of Shopware 5 front end (ex. Product Name)
For example, I can see the template variable for article name has been given as $sArticle.articleName. I found this when I checked the source code manually.
Let’s say I want to find the discount value given for particular product, How can I print this on my theme? What variable I should use and what is the easy way to find it.
I can assign values from back end for all the variables but my question is how I can access them on my theme file when I update my theme when it comes to technical development side.
Please Note: I am trying to understand the shopware5 technical side.
Using the {debug} function will usually give you a list of all assigned variables. This list should also include a variable $Controller which will give you a hint to the currently related Controller.
Unfortunately you are not able to identify where the assigned variables come from. Due to the event driven architecture of Shopware the variables can be assigned to the view after the request has been dispatched to the related Controller. This means that variables might he assigned through third party plugins as well as specific event listeners and store front decorators (in Shopware 5).
Kind regards!
If you want to use your variables inside the template you have to write a plugin and assign your controller-variables to the view.
Check out Globale Variablen im Template verwenden in the shopware documentation.
If you want to use see which variables are allready assigned, you can use {debug} in the template. Also {$sArticle|var_dump} is really helpful, if you want to debug a specific variable ($sArticle} in this example).
You have to known that shopware assigns the members of an object to the view.

set environment variable by condition in installshield

In my project, I use installshield to insert an environment variable during installation.
PEAK_LIMIT = 1000
However, if I change the value to say - 1500, then during re-installation with higher versions causes the value to be reset to 1000. Is there a way to preserve the current value 1500 instead of resetting?
Thanks
It sounds like you have a hard coded value in your Environment table. Substitute it out with a property that equals that value. Then use a custom action during the install to assign the current value to the property if it has a value. This way when MSI rewrites the environment variable it'll keep the value it read.
Another approach would be to create a second environment variable (PEAK_LIMIT_OVERRIDE) that has higher priority in your application. This way the installer can set the default value to what it thinks is correct and keep that apart from user controlled data.

Resources