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

SonarScanでbuild-sln.batを使う #1963

Merged

Conversation

berryzplus
Copy link
Contributor

@berryzplus berryzplus commented Jul 13, 2024

SonarCloudのビルド工程の前にbuild-sln.batの実行を挟む。
この変更により、ビルド前の準備ステップをbuild-sln.batに集約できる。

PR対象

  • ビルド手順/CI

カテゴリ

  • 改善

PR の背景

CIプロセスの改善PRなので、issueは作成しません。
#1958 の検証ビルドが最後まで成功しなかった原因に対処する内容になります。

仕様・動作説明

静的解析にビルド前処理を挟めるようにします。

環境 説明
修正前 SonarQubeのビルドラッパーを使い、sakura.slnをリビルドします。
修正後 先にbuild-sln.batでsakura.slnをビルドします。その後、SonarQubeのビルドラッパーを使い、sakura.slnをリビルドします。

この変更により、sakura.slnのビルド前処理がsonarscanタスクで実行されない問題を回避できます。

代償としてsonarscanで行われるsakura.slnのビルド回数が2回になります。

PR の影響範囲

テスト内容

CIプロセスの変更であるため、行っていません。

PRの段階ではCIに変更が反映されないため、目視以外で検証する方法はありません。

関連 issue, PR

参考資料

SonarCloudのビルド工程の前にbuild-sln.batの実行を挟む。
この変更により、ビルド前の準備ステップをbuild-sln.batに集約できる。
Copy link

sonarcloud bot commented Jul 13, 2024

@berryzplus
Copy link
Contributor Author

@sakura-editor/sakura-developers
レビューお願いします。

Copy link
Contributor

@beru beru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sonar Scan は成功しているし問題無いと思います。

@beru
Copy link
Contributor

beru commented Sep 7, 2024

https://github.com/sakura-editor/sakura/pull/1958/checks でBuild-Wrapperが失敗したのはエラーメッセージを見るとvcpkg.propsファイルが見つからなかったからのようですが、SonarQubeの仕様がよくわからないですがこのPRの説明に「sakura.slnのビルド前処理がsonarscanタスクで実行されない問題」と書かれているのでまぁなんかそういうもんなんですかね。。

@berryzplus
Copy link
Contributor Author

前提がうまく伝わってなかったみたいなので補足します。

ビルド種類 ビルド方法
普通のビルド(build-sakura.yml) build-sln.bat経由で msbuild.exe を実行。
sonarscanビルド(sonarscan.yml) build-wrapperを使うために msbuild.exe を直接実行。

vcpkgの導入を検討する場合、msbuild.exeの実行前に処理を挟む必要がありそうです。

このPull Requestは、vcpkgを導入するかは置いておいて「共通の前処理をはさめるようにしよう」が目的です。

@beru
Copy link
Contributor

beru commented Sep 7, 2024

@berryzplus 解説ありがとうございます。

説明に「PRの段階ではCIに変更が反映されないため、目視以外で検証する方法はありません。」と書かれている通り、https://github.com/sakura-editor/sakura/pull/1963/checks にはまだ Run the normal MSBuild process jobは登場していないですね。

.github/workflows/sonarscan.yml ファイル中で build-wrapper (build-wrapper-win-x86-64.exe) で MsBuild.exe を実行する方法だと https://github.com/sakura-editor/sakura/pull/1958/checks で出ているようなエラーがどうして起きるのか分かっていませんが、build-sln.bat ファイルに記述されているコマンド で実行するやり方であれば問題を回避できるのであれば良いんじゃないかと思います。

@berryzplus
Copy link
Contributor Author

あ、すみません。approve頂いていたのですね。
ありがとうございます。マージしてしまいます。

@berryzplus berryzplus merged commit 53ea30b into sakura-editor:master Sep 13, 2024
7 checks passed
@berryzplus berryzplus deleted the feature/use_build-sln_in_sonarscan branch September 13, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants