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

調査:CodeClimateのCodeのSourceが出ない件 #236

Open
sunakan opened this issue Oct 5, 2022 · 19 comments
Open

調査:CodeClimateのCodeのSourceが出ない件 #236

sunakan opened this issue Oct 5, 2022 · 19 comments

Comments

@sunakan
Copy link
Collaborator

sunakan commented Oct 5, 2022

Codeタブ > 適当なktファイル > Source > なにもでない

image

こういうのが出て欲しい

Codeタブ > RealworldKotlinSpringbootJdbcApplication.kt > Source

image

Codeタブ > ArticleId.kt > Source

image

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

怪しいと思っているのは。。

./gradlew test がJUnitTestせず、レポートのディレクトリがなんかおかしいとか?

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

CodeClimateにレポートを送ってる Action を見てみる

https://github.com/paambaati/codeclimate-action

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

- name: '【mainブランチ】 make test.full && テストカバレッジレポートをCodeClimateに送る'
  if: github.ref == 'refs/heads/main'
  uses: paambaati/[email protected]
  with:
    coverageCommand: make test.full
    coverageLocations: 'build/reports/jacoco/test/jacocoTestReport.xml:jacoco'
  env:
    CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
    JACOCO_SOURCE_PATH: ${{ github.workspace }}/src/main/kotlin
    TZ: Asia/Tokyo

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

build/reports/jacoco/test/jacocoTestReport.xml

あ、これを見れば良さそう?

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

https://codebeautify.org/xmlviewer

で「Beautify」すると1万行超え、、つまりちゃんとレポートはありそう

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

たとえばComment.ktはこんな感じのxmlのclassがいくつかある。。

		<class name="com/example/realworldkotlinspringbootjdbc/openapi/generated/model/Comment" sourcefilename="Comment.kt">
			<method name="&lt;init&gt;" desc="(ILjava/time/OffsetDateTime;Ljava/time/OffsetDateTime;Ljava/lang/String;Lcom/example/realworldkotlinspringbootjdbc/openapi/generated/model/Profile;)V" line="25">
				<counter type="INSTRUCTION" missed="30" covered="0"/>
				<counter type="LINE" missed="6" covered="0"/>
				<counter type="COMPLEXITY" missed="1" covered="0"/>
				<counter type="METHOD" missed="1" covered="0"/>
			</method>
			<method name="getId" desc="()I" line="28">
				<counter type="INSTRUCTION" missed="3" covered="0"/>
				<counter type="LINE" missed="1" covered="0"/>
				<counter type="COMPLEXITY" missed="1" covered="0"/>
				<counter type="METHOD" missed="1" covered="0"/>
			</method>
			<method name="getCreatedAt" desc="()Ljava/time/OffsetDateTime;" line="31">
				<counter type="INSTRUCTION" missed="3" covered="0"/>
				<counter type="LINE" missed="1" covered="0"/>
				<counter type="COMPLEXITY" missed="1" covered="0"/>
				<counter type="METHOD" missed="1" covered="0"/>
			</method>
			<method name="getUpdatedAt" desc="()Ljava/time/OffsetDateTime;" line="34">
				<counter type="INSTRUCTION" missed="3" covered="0"/>
				<counter type="LINE" missed="1" covered="0"/>
				<counter type="COMPLEXITY" missed="1" covered="0"/>
				<counter type="METHOD" missed="1" covered="0"/>
			</method>
			<method name="getBody" desc="()Ljava/lang/String;" line="37">
				<counter type="INSTRUCTION" missed="3" covered="0"/>
				<counter type="LINE" missed="1" covered="0"/>
				<counter type="COMPLEXITY" missed="1" covered="0"/>
				<counter type="METHOD" missed="1" covered="0"/>
			</method>
			<method name="getAuthor" desc="()Lcom/example/realworldkotlinspringbootjdbc/openapi/generated/model/Profile;" line="41">
				<counter type="INSTRUCTION" missed="3" covered="0"/>
				<counter type="LINE" missed="1" covered="0"/>
				<counter type="COMPLEXITY" missed="1" covered="0"/>
				<counter type="METHOD" missed="1" covered="0"/>
			</method>
			<counter type="INSTRUCTION" missed="45" covered="0"/>
			<counter type="LINE" missed="11" covered="0"/>
			<counter type="COMPLEXITY" missed="6" covered="0"/>
			<counter type="METHOD" missed="6" covered="0"/>
			<counter type="CLASS" missed="1" covered="0"/>
		</class>

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

CodeClimateのISSUEにもコードが有るやつないやつが連動してるっぽい

image

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

普通はこんな感じで各Issue毎にコードが載る

image

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

422エラー起きてSkipしてるやつ発見
怪しい。。

https://codeclimate.com/github/sunakan/realworld-kotlin-springboot-jdbc/builds/490

image

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2022-10-05T12:18:41.743749 #1]  WARN -- : Skipping ./src/main/kotlin/com/example/realworldkotlinspringbootjdbc/usecase/user_and_authentication/UpdateUserUseCase.kt due to CC::Parser::Client::HTTPError
W, [2022-10-05T12:18:41.744071 #1]  WARN -- : Response status: 422
W, [2022-10-05T12:18:41.840206 #1]  WARN -- : Skipping ./src/main/kotlin/com/example/realworldkotlinspringbootjdbc/usecase/comment/DeleteCommentUseCase.kt due to CC::Parser::Client::HTTPError
W, [2022-10-05T12:18:41.840608 #1]  WARN -- : Response status: 422

なんか向こう側のトラブルな気がしてきた

SaaS側のDockerimageがおかしい気がする

2022年9月19日〜

Can’t override default code climate template

にてGitlab環境でcodeclimate使おうとしたら

D, [2022-09-19T16:37:36.018628 #1] DEBUG -- : engine stderr: Parser process id: 13
D, [2022-09-19T16:37:36.018895 #1] DEBUG -- : engine stderr: codeclimate-parser socket not present
D, [2022-09-19T16:37:36.018967 #1] DEBUG -- : engine stderr: waiting 1s...
I, [2022-09-19T16:37:37.962539 #1]  INFO -- : finished engine structure
I, [2022-09-19T16:37:37.962689 #1]  INFO -- : starting engine duplication

みたいなエラーが出てるっぽいし

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

ただ、まだissueには上がっていなさそう。。

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

Openなやつは3つあるけど、どれも違いそう。。

https://github.com/search?q=org%3Acodeclimate+codeclimate-parser+socket+not+present&type=issues

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

codeclimateコマンドがあるらしい

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

Code Climate を Mac で動かす

sudo docker run \
--interactive --tty --rm \
--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
--volume /code/node_modules \
codeclimate/codeclimate analyze -f html > output.html
sudo docker run \
--interactive --tty --rm \
--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
--volume /code/node_modules \
codeclimate/codeclimate analyze -f html > output.html

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 5, 2022

2つは500なので422の可能性は上っぽい

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 7, 2022

2022年10月5日にサポートへ連絡

Permission granted to log in to my account, if necessary: Yes.

Related URL: https://codeclimate.com/github/sunakan/realworld-kotlin-springboot-jdbc/src/main/kotlin/com/example/realworldkotlinspringbootjdbc/domain/Comment.kt/source

Hello, my name is sunkan.

## Problem

I am getting error 422 on the build and the file loading is skipped.
I don't know if this is the cause, but I am having trouble seeing some of the SourceCode in the CodeClimate Dashboard!

How can I fix this problem?

### It is working.

https://codeclimate.com/github/sunakan/realworld-kotlin-springboot-jdbc/src/main/kotlin/com/example/realworldkotlinspringbootjdbc/domain/OtherUser.kt/source

### It does not work.

https://codeclimate.com/github/sunakan/realworld-kotlin-springboot-jdbc/src/main/kotlin/com/example/realworldkotlinspringbootjdbc/domain/Comment.kt/source

### build page

https://codeclimate.com/github/sunakan/realworld-kotlin-springboot-jdbc/builds/492

### Logs

Not local, I used code climate service.

\```
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2022-10-05T23:28:46.118168 [#1](https://codeclimate.zendesk.com/hc/requests/1)] WARN -- : Skipping src/main/kotlin/com/example/realworldkotlinspringbootjdbc/usecase/user_and_authentication/UpdateUserUseCase.kt due to CC::Parser::Client::HTTPError
W, [2022-10-05T23:28:46.118222 [#1](https://codeclimate.zendesk.com/hc/requests/1)] WARN -- : Response status: 422
....
...
\```

Translated with [www.DeepL.com/Translator](http://www.deepl.com/Translator) (free version)

## My configuration
- no configuration file
スクリーンショット 2022-10-06 8.42.56.png

Attachment(s)
スクリーンショット 2022-10-06 8.42.56.png

@sunakan
Copy link
Collaborator Author

sunakan commented Oct 7, 2022

なんか同じ文面が2回来てる(2回めはサポートのミスな気がするけど)

Your request (48513) has been updated. To add additional comments, reply to this email.

Hi Sunakan,
 
Thanks for reaching out.

We'll need a little more time to take a look at your request, but we'll reach back as soon as we have an update. Thanks so much for your patience, and we'll talk to you soon.
 
Dave
Dave Henton, Senior Support Specialist

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

No branches or pull requests

1 participant