I have an ASP.NET MVC application and I added the sonar-project.properties file to the same folder as the solution file. I just wanted to add a global variable to the sonar.javascript.globals setting, but it doesn't seem have an impact. I don't have access to the machine where SonarQube runs, I am just able to see the violations in a SonarQube website. I just have the 3 settings in the sonar-project.properties
sonar.projectKey= <key>
sonar.projectName= <name>
sonar.javascript.globals= <global_variable_name>
I solved this problem by marking the JavaScript global variable to be a member of the window object. SonarQube now no longer complains the variable is undeclared.
For e.g. window.<variable>
Related
I have been trying to get the value of configuration parameter since yesterday but no luck. On the documentation I can call it using this teamcity["<property name>"] but it wont work.
Say I have a configuration parameter called "isPaid". I want to get the "isPaid" param value in my gradle. How can I do that? Shouldn't that be
System.getProperty("teamcity[isPaid]")
Tried using both getProperty and getEnv but still did not work. Any ideas? Thanks
Configuration parameters (no prefix) are not passed into the build and are only meant to share settings within a build configuration.
https://www.jetbrains.com/help/teamcity/configuring-build-parameters.html
Is there any way to set different values for sentry attributes based on the current Spring profile?
The current attributes are located in the sentry.properties file...
Unfortunately naming it like the application.properties method (application-profilename.properties) does not work. Because the changes in a sentry-profilename.properties file aren't recognised.
So ideal would be:
sentry.properties (base information)
sentry-dev.properties (environment attribute = dev)
sentry-prod.properties (environment attribute = prod)
Ok, we defined the systems variable SENTRY_ENVIRONMENT to dev or prod (based on the current deployment pipeline).
So this solved our issue and we got the wanted result in the sentry.io overview!
"You can override the location of the properties file by using either the sentry.properties.file Java System Property or the SENTRY_PROPERTIES_FILE System Environment Variable." this is from "https://docs.sentry.io/clients/java/config/#configuration"
How to configure sonar.projectKey under sonar-project.properties so that we can get apply custom permission template for new project report automatically.
Does anyone try that?
I was trying all type of combination with project key in sonarqube permission template and sonar-runner properties file. But couldn't achieve the result.
Does sonar permission template really support this from sonar-runner.
Below are screenshot attached to the link for my use case:
I have created mfg-desktop permission template and there is also present a default template provided by sonar
When I checked under project permission, I found that default permission template is getting applied in each time
There's nothing to do on the sonar-project.properties side.
As described in the docs, set up your permission template with a project key pattern regular expression. All new projects with keys that match the regex will have that permission template applied.
For example, if in the "Manufacturing Group" template I set my Project Key Pattern to:
mfg-*
and analyze a new project with a key of mfg-extrusion, then the "Manufacturing Group" template will be applied. And when I analyze front-office-billing for the first time, it will not.
Create a new permission Template and assign the regex to the Project Key Pattern.
For example:
Regex :
(prod)-\w+
It will apply the template to the new projects created with Project Key starting with 'prod-'. Sonar needs the key of the new projects to 'fully' match the regex of the permission template key. Using * might not work.
Then link the desired permissions of the users/group on the template. Also make sure the Global Permissions for the users/group are also set appropriately else permissions wont work.
Additional Info: All projects will still be visible to all users. Make your project 'Private' to make it visible only to the required group.
This works on CE v7.6
I am looking for a Sonar Property to attach the quality profile during the build. In previous versions of Sonar there was a property -Dsonar.profile which is deprecated now. Can anyone please help me to get the property to attach the quality profile at runtime.
I am using Sonar version 4.5.7. Any help is highly appreciated.
Thanks,
Sanjiv
It has been marked as deprecated with no replacement.
Quoting page http://docs.sonarqube.org/display/SONARQUBE43/Analysis+Parameters :
Note that only parameters set through the UI are stored in the
database. For example, if you override the sonar.profile parameter via
command line for a specific project, it will not be stored in the
database. Local analyses in Eclipse, for example, would still be run
against the default quality profile.
And the latest version of the same page http://docs.sonarqube.org/display/SONAR/Analysis+Parameters has link to ticket about deprecation that contains other details - https://jira.sonarsource.com/browse/SONAR-5370
In other words - profile should be configured via UI or using web services.
I am developing an application in ServiceStack and am trying to sort out deployment on AppHarbor, however for some reason my web.config transforms are not being applied.
I had originally a Web.AppHarbor.config file and changed the Environment Setting to "AppHarbor" - once this failed to work after several updates, I gave up and changed the Environment setting to "Release" and copied the desired transformations into the Web.Release.Config file.
App gets deployed OK but config settings do not reflect the values in the transform file (I verify this by login on with twitter and seeing the callback url for Twitter Auth still tries to redirect me to localhost, which is one of the settings I change in my transform file)
I have also tried the transform tester tool and all works as expected.
Manually publishing the web application to a local folder correctly applies the transformations according to the selected configuration
Does anyone have this working? Is there something obvious I'm missing?
Thanks
It sounds like the Web.Release.config file is not included in the build output. You need to set the Build Action attribute to Content to include it in the build output.
You can confirm whether the file is included in the output by downloading the build from the log page.
I stumbled across this post because I was seeing the same lack of action myself. Upon closer inspection (about 15 times that is) of my Web.Release.config I realized one of the nodes in my config file was not marked xdt:Transform="Replace". Unsurprisingly it did nothing when deployed.