Teamcity build trigger exclude all but some - teamcity

I'm using teamcity to perform my builds.
within my repository there are multiple projects that uses different folders. e.g. like this:
└root
├project1
│ └files
├project2
│ └files
└project3
└files
I have 3 lanes that should all here just on there own folder.
The current trigger configuration for project2 looks like this:
-:*/project1/*
-:*/project3/*
+:*/project2/*
but I don't want to explicit add all projects to the trigger configuration of every project. therefore I would like to say s.th. like
-:IGNORE_EVERYTHING
+:*/project2/*
which means I just want to list the folder that SHOULD get monitored but not exclude all others. When I just use the last line of the above the two other folders gets monitored as well.
How do I do that?

According to documentation Configuring VCS Triggers:
When entering rules, please note that as soon as you enter any "+" rule, TeamCity will remove the default "include all" setting. To include all the files, use "+:." rule.
You don't need any exclusion rule. Just insert:
+:*/project2/*
in Trigger Rules and you should be good.

Related

SonarQube API search issues with componentKeys by directory

In the SonarQube docs it says that componentKeys can be the following:
Comma-separated list of component keys. Retrieve issues associated to a specific list of components (and all its descendants). A component can be a portfolio, project, module, directory or file.
I want to get all the issues from components of a specific directory. I have tried to use the * wildcard like this:
http://localhost:9000/api/issues/search?componentKeys=projectkey:src/testcases/*
or
http://localhost:9000/api/issues/search?componentKeys=src/testcases/*
This doesn't seem to work, how can you search issues by a directory?
You can pass your projectKey name as ComponentKeys and pull all the issues from the project.
http://localhost:9000/api/issues/search?componentKeys=testproject

Google Cloud Build - Github Trigger - Filter Files Don't Work

When Github Trigger is set to listen a tag the files filter is ignored and the trigger is set on every push
I have tried different settings on multiple triggers and nothing works
I've tried using a path like this packages/backend-node/src/* and didn't work either
I noticed something similar but found the following in the docs:
If you push a change to a newly created branch, then Cloud Build
treats all the files in the repository as changed files.
So pushing a new branch to your repo will always trigger your build and ignore the file filters.
Source: https://cloud.google.com/build/docs/automating-builds/create-manage-triggers#build_trigger (the link no longer includes the quote from above)
Open bug report in google's issue tracker: https://issuetracker.google.com/issues/217776771

How to delete an issue from SonarQube interface

I have a web app project where the quality is measured under sonarqube.
As i'm dealing with an external code within my project files
Recently i have had some issues appearing due to that exetrnal code and which i'm not focusing on its quality :
So i wanna just delete the issue to appear from my sonar dashboard (which looks like the following):
The solutions that i have had where not really usefull , as :
i was suggested to change the level of the rule itself from "issue" to "info" :
And of course that seems to be not usefful because , i won't affect the rule itself
the second suggestion was to use the :
#SuppressWarnings decorator in my blocks of code where the issues appeared ; : for example use it under classes or methods or even fields
-> this method results in adding some code to my extarnal code and that won't be also good as i'm not even having the permission to do it.
I wanna just the simpliest solution to delete the issue from the sonar dashboard , just suppress it from the SonarQube interface , strangely it seems that there is no a direct way to do it :
Any better ideas ??
The easiest way is excluding external code from the report with narrowing the focus feature.
Just add to your sonar-project.properties file path pattern to exclusion, for example
# Exclude all classes ending by "Bean"
# Matches org/sonar.api/MyBean.java, org/sonar/util/MyOtherBean.java, org/sonar/util/MyDTO.java, etc.
sonar.exclusions=**/*Bean.java,**/*DTO.java
# Exclude all classes in the "src/main/java/org/sonar" directory
# Matches src/main/java/org/sonar/MyClass.java, src/main/java/org/sonar/MyOtherClass.java
# But does not match src/main/java/org/sonar/util/MyClassUtil.java
sonar.exclusions=src/main/java/org/sonar/*
If you're not interested some issues because it's not your code, then you should not have SonarQube analyze that code. According to the SonarQube documention:
We recommend that you exclude generated code, source code from
libraries, etc.
You should check in particular the following settings in the same documentation page:
sonar.sources
sonar.exclusions
These settings will be taken into account the next time you run an analysis.

How can I use team city rest api to show only one build per branch for all branches in project?

I have multiple branches that are being tested under a single project and I'm currently using following command to show build statuses:
"/guestAuth/app/rest/builds?locator=project:<Project_Name>,running:any,branch:branched:any,count:20
Can limit the rest api to show just one build per branch?
Can you please be more specific? If you give us some example (e.g. "I have build configuration with builds A(steps a,b,c), B(steps d,e) , C(step f). A is from branch branch_A, B from branch_B" and so on so we have some clue how your setup looks like and what do you want to achieve.
You can check a permalinks for "latest successful build".
You can also ask for specific build status, not a whole project.

Extend configuration from server in Plugin

We have a SonarQube-Server and locally in my Eclipse I have installed SonarQube-Plugin.
In my (local) Project I have a package, which I want to exclude from SonarQube-Analyze.
Therefore I added to the "Preview Analysis Proberties" in Eclipse the "sonar.exlusions"-Property.
This works well, BUT setting this property overrides the property set on the SonarQube-Server.
I do not want to overwrite it, I just want to extend it.
For example, the rule on the SonarQube-Server is "**/aUselessPackage/**/*" and my local rule is "**/myPackage/**/*". When I set this rule, "aUselessPackage" will be analyzed, because I overwrite the Server-property, but I want to exclude "**/aUselessPackage/**/*,**/myPackage/**/*".

Resources