Skip to content

Commit

Permalink
Merge branch 'jihuayu:unstable' into test1
Browse files Browse the repository at this point in the history
  • Loading branch information
jihuayu authored Mar 13, 2024
2 parents 508aa4f + b588563 commit 585915e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,29 @@ jobs:
run: |
./x.py build -j$(nproc) --compiler gcc --skip-build
- name: Run sonar-scanner
- name: Run sonar-scanner(PUSH)
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: |
PR_NUMBER=$(jq -r '.number | select (.!=null)' sonarcloud-data/github-event.json)
HEAD_REF=$(jq -r '.pull_request.head.ref | select (.!=null)' sonarcloud-data/github-event.json)
BASE_REF=$(jq -r '.pull_request.base.ref | select (.!=null)' sonarcloud-data/github-event.json)
REF=$(jq -r '.ref | select (.!=null)' sonarcloud-data/github-event.json)
echo "The PR number is $PR_NUMBER, ref is $REF, head ref is $HEAD_REF, base ref is $BASE_REF"
sonar-scanner \
--define sonar.cfamily.build-wrapper-output="sonarcloud-data" \
--define sonar.coverageReportPaths=sonarcloud-data/coverage.xml \
--define sonar.projectKey=jihuayu_kvrocks-test \
--define sonar.organization=jihuayu \
--define sonar.scm.revision=${{ github.event.workflow_run.head_sha }}
- name: Run sonar-scanner(PR)
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
Expand All @@ -87,5 +109,4 @@ jobs:
--define sonar.scm.revision=${{ github.event.workflow_run.head_sha }} \
--define sonar.pullrequest.key=$PR_NUMBER \
--define sonar.pullrequest.branch=$HEAD_REF \
--define sonar.pullrequest.base=$BASE_REF \
--define sonar.newCode.referenceBranch=2.7
--define sonar.pullrequest.base=upstream/unstable
2 changes: 1 addition & 1 deletion src/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void Config::initFieldCallback() {
}
if (!previous_backup.empty() && srv != nullptr && !srv->IsLoading()) {
// LOG(INFO) should be called after log is initialized and server is loaded.
LOG(INFO) << "change backup dir from " << previous_backup << " to " << v;
LOG(INFO) << "change backup dir from from " << previous_backup << " to " << v;
}
return Status::OK();
}},
Expand Down

0 comments on commit 585915e

Please sign in to comment.