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

Stop duplicate code comments for code review. #181

Merged
merged 1 commit into from Oct 9, 2023

Conversation

entvex
Copy link
Contributor

@entvex entvex commented Sep 27, 2023

Description

When reviewing a pull request, duplicated errors pollute the code view unnecessarily.

Example
image

When reviewing code. We just want a clean view to do it.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

We may still want to verify the docs syntax are valid?

@entvex
Copy link
Contributor Author

entvex commented Sep 27, 2023

We may still want to verify the docs syntax are valid?

Yes, I understand the intention. But there must be another way to do it, so the code reviewers don't have to see all these duplicates.

Another approach could be if we spun this code into a separate GHA that also triggers on push, like the action it is in now. But do you know if that would stop the duplicates, or would they still show up in the review?

Or we could verify the syntax when creating a release (the new GHA, which I am working on).

@entvex
Copy link
Contributor Author

entvex commented Sep 28, 2023

Today I have tried to do as I suggested and spun the docfx code away from the ci-unit.yaml and into another GHA named doc-syntax-check.yaml. But it sadly didn't fix the issue, and therefore the duplicated items are still an issue.
image

I still think we should remove the docfx from CI, so we don't see duplicates when reviewing code.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

OK.

The reason seems to be that dotnet build in the doc-tests generate annotations which should not be forcely applied. If we can disable the annotation for doc-tests suspected actions/setup-dotnet introduced it, we can keep the test (It's unreasonable we disable a test because it generates extra warning instead of fix it).

But given that the docs should be relatively stably correct and we can fix any violations later spotted, we can disable it first.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Replace dotnet build -p:TargetFramework=net7.0 with dotnet build -p:TargetFramework=net7.0 --property WarningLevel=0 should help.

Functionality checks are covered by unit-tests, we run it in doc-tests for prepare infos only.

@entvex
Copy link
Contributor Author

entvex commented Sep 30, 2023

Replace dotnet build -p:TargetFramework=net7.0 with dotnet build -p:TargetFramework=net7.0 --property WarningLevel=0 should help.

Functionality checks are covered by unit-tests, we run it in doc-tests for prepare infos only.

Okay. So I tried to use the code in your comment, here in my test repo https://github.com/entvex/pulsar-dotpulsar/pull/2/files. And it looks like the normal unit test will make errors if there are any doc XML syntax errors.

Therefor, I really think we only need to run doc test, when we do a release. And therefore it does not need to be part of the CI unit test pipeline.

image
Does it make sense ?

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Although the docfx docs/api/docfx.json should run more test than dotnet build and a per PR test should prevent us to postpone all potential issues until releases, I don't insist to block this patch and approve its merge.

@entvex entvex force-pushed the unit-test-pipe-line-clean-up branch from 9eb5b38 to c6dc46f Compare October 9, 2023 11:20
When reviewing a pull request, duplicated errors pollute the code view unnecessarily.
@entvex entvex force-pushed the unit-test-pipe-line-clean-up branch from c6dc46f to 01e4c6c Compare October 9, 2023 11:20
@blankensteiner blankensteiner merged commit 197b5cc into apache:master Oct 9, 2023
@entvex entvex deleted the unit-test-pipe-line-clean-up branch October 14, 2023 12:25
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.

None yet

3 participants