Skip to content

Miq-Bot's Pronto Formatter #424

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

Closed
wants to merge 7 commits into from
Closed

Miq-Bot's Pronto Formatter #424

wants to merge 7 commits into from

Conversation

europ
Copy link
Member

@europ europ commented Apr 26, 2018

Dependency #406

The RubocopChecker worker will be universal for all linters - launching all linters via pronto and posting a comment to the pull request with the related offences. The fact that this worker is universal is related to the issue #245 where is a request for a change of class name of this worker to ProntoWorker or LinterWorker.

The RubocopChecker worker will run the Pronto Runners obtaining their result as an array of Pronto::Message objects which are parsed by Miq-Bot's Formatter which creates a human readable pull request comment. This comment with an appropriate header describing the linter versions and runner version is posted to the pull request as an pull request comment.

The Miq-Bot's Formatter is a function whose input is always an array of Pronto::Message objects which does not matter on the linter or runner type. The array contain unified results of launched linters via runners which is passed to the formatting function. The results of launched linters inside of this function are converted into a plain text in a human readable format describing the detected offences in the pull request.

The hyperlinks in the comment refers to the last commit with the related file or related line in file.

Examples

  • Everything looks fine.

    formatter8

  • Some offences have been detected.

    formatter7

\cc
@skateman
@Fryguy

@miq-bot miq-bot added the wip label Apr 26, 2018
@europ europ force-pushed the Formatter branch 29 times, most recently from 603e8f2 to ad3f49a Compare April 29, 2018 20:23
GithubService.replace_comments(fq_repo_name, pr_number, rubocop_comments) do |old_comment|
rubocop_comment?(old_comment)
def versions
[
Copy link
Member

Choose a reason for hiding this comment

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

You may want to memoize this, otherwise, this will basically shell out for yamllint on every execution.

@europ europ force-pushed the Formatter branch 4 times, most recently from b47fa42 to 9bb0d9e Compare May 16, 2018 14:55
@miq-bot
Copy link
Member

miq-bot commented Mar 20, 2019

This pull request is not mergeable. Please rebase and repush.

europ added 7 commits March 21, 2019 08:47
Integration of pronto required to add few new gems and to update some of the gems. The old method which provided the linter launching was reworked to launch pronto which provide the linter launching. The output of pronto is the result of all linters. The pronto result is transformed into a structure which match the original one. This integration required to change few tests and add new ones.

Closes ManageIQ#192
Request in ManageIQ#406 to remove addition "column" information about the offence
Request in ManageIQ#406 to remove files in lib/linter/ which are not used
Variable "inspected_file_count" in the result of the linters has been removed due to missing use. It was not used in the pull request comment describing the offenses detected by linters in the source code.
Pronto runners (linters) expected to run will be automatically required in the CodeAnalysisMixin based on Gemfile specifications for pronto runners (linters).
Pronto is finally integrated into RubocopChecker worker. This RubocopChecker worker launchs pronto and pass the pronto output to a formatter whose result is posted as github pull request comment.
@miq-bot
Copy link
Member

miq-bot commented Mar 21, 2019

Checked commits europ/miq_bot@23a0369~...8c37984 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
10 files checked, 6 offenses detected

app/workers/commit_monitor_handlers/commit_range/rubocop_checker.rb

app/workers/concerns/code_analysis_mixin.rb

spec/support/rubocop_spec_helper.rb

spec/workers/commit_monitor_handlers/commit_range/rubocop_checker_spec.rb

@europ
Copy link
Member Author

europ commented Mar 21, 2019

@miq-bot remove_label unmergeable

@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2020

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s)

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.

@NickLaMuro
Copy link
Member

NickLaMuro commented Oct 26, 2020

Closing as we have some newer efforts for this, and also might not be going this direction since pronto has some incompatibilities with our current rugged workflow.

Edit: Err... guess I don't have the permissions to close... but we probably should.

@Fryguy Fryguy closed this Oct 26, 2020
@europ europ deleted the Formatter branch October 26, 2020 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants