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

Add clippy checks to continuous integration #659

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

Luni-4
Copy link
Collaborator

@Luni-4 Luni-4 commented Aug 17, 2023

Pull Request Template

Checklist

  • Confirm that run-checks script has been executed.

Changes

This PR adds clippy checks on Linux directly on CI and uses actions to better show in PR clippy warnings. It updates #552

@Luni-4 Luni-4 marked this pull request as draft August 17, 2023 14:14
@Luni-4 Luni-4 marked this pull request as ready for review August 18, 2023 17:07
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Aug 18, 2023

@antimora and @nathanielsimard I think I've finished, so this PR is read to be reviewed

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

If I understand correctly, the primary goal of this PR is to separate the clippy and formatting into individual jobs, much like we did with typos. If so, I'm on board with this idea. However, to maintain consistency and ease of maintenance, we should continue to execute these tasks within the run-checks script, as we've done with typos. This approach ensures that any changes to configuration or versions will be uniform. Using GitHub's clippy/formatting might lead to different outcomes compared to running the same script, which was the key reason for integrating the CI jobs with the script in the first place.

Should we need to improve the reporting of fmt/clippy outputs, the changes should be made within the script itself.

If we can agree on this, I've provided additional feedback on the implementation.

.github/workflows/format.yml Outdated Show resolved Hide resolved
.github/workflows/format.yml Outdated Show resolved Hide resolved
.github/workflows/format.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Aug 18, 2023

The goal of this PR consists of providing a way to better visualize clippy lints as annotations inside each PR without having to look for the problems within CI output. It's a PR oriented to help newcomers in detecting clippy lints in a simpler way since they are shown directly in their PRs. But if there is no agreement on this aspect, this PR does not make sense at all. Separating clippy and format for optimizations reasons is quite useless since they are not computational heavy at all. I had already described this part in #552

Providing a better clippy and format output directly in the script is just a waste of time, we can simply use the output provided by the two binaries in that case.

Personally I think CI should be superior than scripts because a CI is the last "judge" to evaluate a PR since:

  • Anyone can see the outcome, so it's not important if a developer has run locally the scripts. We can catch the issues related to the considered PR immediately.
  • You can have comments in it that helps you to fix some aspects such as code coverage or clippy lints annotations
  • You cannot do some things locally with scripts without forcing a developer to set his/her own machine according to our specifications. CI allows a more degree of freedom.

But I also understand that an action can be quickly unmaintained and not conform to the new GitHub Actions APIs. So using only the necessary ones can be a valid point.

Unfortunately I do not see a tradeoff for this PR, we can leave as it is now and create a new PR for the INFRASTRUCTURE books.

@antimora
Copy link
Collaborator

I couldn't understand initially what better output you were telling us about. So I dug in briefly about this clippy action. It appears from my limited research this action uses clippy and forwards output (or formats) to reviewdog service (that is why it requires git hub token in the code), which actually talks to the originating PR via comments. So it's clippy + clippy-action + reviewdog.

Potentially we could enhance our PR workflow with the automated review tools like reviewdog, and I am open to this. I know little about current trend, so it'd be interesting to explore.

With this new information, I am not exact sure why you had to modify the current run-checks if you added action/clippy. Does the action take the output?

@Luni-4 Luni-4 changed the title Add format and clippy checks to continuous integration [WIP] Add format and clippy checks to continuous integration Aug 19, 2023
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Aug 19, 2023

Waiting for upstream giraffate/clippy-action#82

@Luni-4 Luni-4 marked this pull request as draft August 19, 2023 14:18
@Luni-4 Luni-4 changed the title [WIP] Add format and clippy checks to continuous integration Add clippy checks to continuous integration Sep 12, 2023
@Luni-4 Luni-4 marked this pull request as ready for review September 12, 2023 10:25
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Sep 12, 2023

@antimora

I have found another way to show clippy lints within PRs, which is simpler than before, so this PR is no more blocked

@Luni-4 Luni-4 requested a review from antimora September 12, 2023 10:26
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Oct 5, 2023

@antimora and @nathanielsimard

I rebased this PR on top of main

@nathanielsimard nathanielsimard merged commit d912f5c into tracel-ai:main Oct 13, 2023
@Luni-4 Luni-4 deleted the clippy branch October 13, 2023 14:33
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.

3 participants