Panel | ||||
---|---|---|---|---|
| ||||
Table of Contents
|
개요
| OverviewA quality gate is the best way to enforce a quality policy in your organization. It's there to answer ONE question : can I deliver my project to production today or not ?
In order to answer this question, you define a set of Boolean conditions based on measure thresholds against which projects are measured. For example:
- No new blocker issues
- Code coverage on new code greater than 80%
- Etc.
Ideally, all projects will be verified against the same quality gate, but that's not always practical. For instance, you may find that:
- Technological implementation differs from one application to another (you might not require the same code coverage on new code for Web or Java applications).
- You want to ensure stronger requirements on some of your applications (internal frameworks for example).
- Etc.
Which is why you can define as many quality gates as you wish. Quality Gates are defined and managed in the Quality Gates page found in the top menu.
Use the Best Quality Gate Configuration
The quality gate "SonarQube way" is provided by SonarSource and activated by default. It represents our view of the best way to implement the Fixing the Water Leak concept. At each SonarQube release, we adjust this default quality gate according to SonarQube's capabilities.
With SonarQube 6.2 comes three new metrics allowing you to enforce a given Rating of Reliability, Security and Maintainability, not just overall but also on new code. These new metrics are now recommended and come as part of the default quality gate. We strongly advise you to adjust your own quality gates to use them to make feedback more clear to your developers looking at their quality gate on their project page.
Don't forget also that quality gate conditions must use differential values. There is no point for example to check an absolute value such as : Number of Lines of Code is greater than 1000.
Recommended Quality Gate
Quality Gate Status
The current status is displayed prominently at the top of the Project Page :
Getting Notified When a Quality Gate Fails
Thanks to the notification mechanism, users can be notified when a quality gate fails. To do so, subscribe to the New quality gate status notification either for all projects or a set of projects you're interested in.
Security
Quality Gates can be accessed by any user (even anonymous users). All users can view every aspect of a quality gate.
To make changes (create, edit or delete) users must be granted the Administer Quality Profiles and Gates permission.
A project administrator can choose which quality gates his/her project is associated with. See Project Settings for more.
Defining Quality Gates
To manage quality gates, go to Quality Gates (top menu bar).
Each Quality Gate condition is a combination of품질 게이트(Quality Gate)는 조직 관점에서 품질 정책을 적용하는 최적의 방법입니다. 품질 게이트를 사용해 다음의 질문에 답할 수 있습니다:
- 이 프로젝트를 오늘 릴리즈 할 수 있는가?
이 질문에 답하기 위해, 프로젝트의 지표들을 기준으로 일련의 참/거짓 조건을 정의합니다. 예를 들면:
- 새로운 blocker 이슈 없음
- 신규 코드에 대한 code coverage가 80% 이상
- 기타
이상적인 경우, 모든 프로젝트의 품질 게이트가 동일하겠지만 현실적으로는 그렇지 않을 수 있습니다:
- 각 프로젝트의 기술적인 구현이 다른 경우(웹 어플리케이션, 자바 어플리케이션의 신규 코드의 코드 커버리지 요구가 동일하지 않을 수 있습니다)
- 특정 프로젝트에 보다 강력한 품질 요구사항을 적용하는 경우(예를 들면, 내부 프레임워크 등)
- 기타
탑 메뉴의 Quality Gates 페이지로 이동해, 원하는 만큼의 품질 게이트를 자유롭게 생성/사용/관리할 수 있습니다.
최고의 품질 게이트 설정을 사용하십시오
"SonarQube way" 품질 게이트는 SonarSource가 제공하며, 기본값으로 설정됩니다. 해당 품질 게이트는 Fixing the Water Leak 컨셉에 최적화되어 있습니다. 모든 SaonrQube 릴리즈에는 기본 품질 게이트를 수정하여 적용합니다.
SonarQube 6.2부터 전체 코드 및 신규 코드를 기준으로 신뢰성(Reliability), 보안성(Security) 및 유지보수성(Maintainability) 지표를 적용할 수 있게 되었습니다. 이 새로운 지표들을 기본 품질 게이트의 기준으로 설정되어 있습니다. 기본 품질 게이트를 활용해 여러분의 품질 게이트를 생성하고, 개발자들에게 보다 명확한 피드백을 제공할 것을 권장합니다.
또한 품질 게이트의 조건(condition)은 '차이값'을 사용한다는 것을 명심하십시오. 예를 들면, '라인 수가 100 초과인 경우'와 같은 절대적인 값을 확인할 수는 없습니다.
권장 품질 게이트
품질 게이트 상태
Project Page의 최상단에 품질 게이트의 현재 상태를 표시합니다:
품질 게이트 통과 실패 시 알림 받기
notification mechanism을 사용해 품질 게이트를 통과하지 못하는 경우 사용자들에게 알림을 전송할 수 있습니다. 알림을 받기 원하는 프로젝트에서 New quality gate status 알림 설정을 구독할 수 있습니다.
보안
품질 게이트는 모든 사용자(임의 사용자 포함)가 접근할 수 있습니다. 모든 사용자는 품질 게이트의 각 항목을 확인할 수 있습니다.
품질 게이트를 생성, 편집, 삭제하려면 Administer Quality Profiles and Gates 권한을 가진 계정으로 로그인해야 합니다.
Project administrator 계정의 사용자는 관리 가능한 프로젝의 품질 게이트를 선택할 수 있습니다(프로젝트 설정 페이지 참조).
품질 게이트 정의하기
품질 게이트를 관리하려면, Quality Gates(상단 메뉴 바)를 사용합니다.
각 품질 게이트는 다음 요소의 조합으로 구성합니다:
- measure
- period: Value (to date날짜) or 혹은 Leak (differential value over the Leak period 기간 동안의 차이값)
- comparison operator
- warning value (optional선택)
- error value (optional선택)
For instance, a condition might be예를 들어, 아래와 같이 구성할 수 있습니다:
- measure: Blocker issue
- period: Value
- comparison operator: >
- error value: 0
Which can be stated as: 이는 "No blocker issues. Issues"라고 명칭할 수도 있습니다.