Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Run sonarqube daily #173961

Merged
merged 14 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash

if [[ "$BUILDKITE_AGENT_NAME" =~ ^bk-agent ]]; then
echo "Pipeline file triggered from outside the kibana executors, skipping pre_command"
echo "Pipeline file triggered from outside the kibana executors, skipping .buildkite/scripts/lifecycle/pre_command.sh"
export SONAR_LOGIN=$(vault read -field=token secret/ci/elastic-kibana/sonarqube)
else
source .buildkite/scripts/lifecycle/pre_command.sh
fi
9 changes: 5 additions & 4 deletions .buildkite/pipelines/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

steps:
- label: Placeholder
command: echo "Hello!"
- label: ":sonarqube: Continuous Code Inspection"
agents:
image: docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest
memory: 16G
command: /scan-source-code.sh
7 changes: 6 additions & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
github.com/project-slug: elastic/kibana
github.com/team-slug: elastic/kibana-tech-leads
buildkite.com/project-slug: elastic/kibana
sonarqube.org/project-key: elastic_kibana_AYvOkAHeQZlFqhqWIr9

tags:
- typescript
Expand Down Expand Up @@ -200,11 +201,15 @@ spec:
apiVersion: buildkite.elastic.dev/v1
kind: Pipeline
metadata:
name: kibana-bot / sonarqube
name: kibana / sonarqube
spec:
repository: elastic/kibana
provider_settings:
trigger_mode: none
schedules:
daily:
branch: main
cronline: "@daily"
pipeline_file: ".buildkite/pipelines/sonarqube.yml"
teams:
kibana-operations:
Expand Down
52 changes: 52 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
sonar.projectKey=elastic_kibana_AYvOkAHeQZlFqhqWIr9Y
sonar.projectName=Kibana
sonar.host.url=https://sonar.elastic.dev

sonar.sources=\
packages, \
plugins, \
src, \
x-pack/packages, \
x-pack/plugins
sonar.exclusions=\
**/*.mock.*, \
**/*.mocks.*, \
**/*.spec.*, \
**/*.stories.js, \
**/*.stories.ts, \
**/*.story.js, \
**/*.story.ts, \
**/*.test.*, \
**/*.test.mocks.*, \
**/.storybook/**/*, \
**/__fixtures__/**/*, \
**/__jest__/**/*, \
**/__mocks__/**/*, \
**/__snapshots__/**/*, \
**/__stories__/**/*, \
**/__tests__/**/*, \
**/cypress/**/*, \
**/dev_docs/**/*, \
**/docs/**/*, \
**/e2e/**/*, \
**/fixtures/**/*, \
**/ftr_e2e/**/*, \
**/integration_tests/**/*, \
**/jest*, \
**/manual_tests/**/*, \
**/mock_responses/**/*, \
**/mocks/**/*, \
**/node_modules/**/*, \
**/packages/**/*, \
**/public/**/*, \
**/scripts/**/*, \
**/storybook/**/*, \
**/stubs.ts, \
**/test/**/*, \
**/test_data/**/*, \
**/test_mocks.ts, \
**/test_resources/**/*, \
**/tests/**/*, \
src/dev/**/*

sonar.javascript.node.maxspace=8192
1 change: 1 addition & 0 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
export const IGNORE_FILE_GLOBS = [
'.node-version',
'sonar-project.properties',
'.github/**/*',
'docs/**/*',
'**/bin/**/*',
Expand Down