Class: CleoQualityReview::StickyCommentPublisher
- Inherits:
-
Object
- Object
- CleoQualityReview::StickyCommentPublisher
- Defined in:
- lib/cleo_quality_review/sticky_comment_publisher.rb
Overview
Publishes quality review findings as a single sticky pull request comment, editing it in place on every run rather than posting a new one
Constant Summary collapse
- COMMENTS_PER_PAGE =
100- MAX_COMMENT_PAGES =
20
Instance Method Summary collapse
-
#initialize(run:, rendered_review:, env: ENV, client: nil) ⇒ StickyCommentPublisher
constructor
A new instance of StickyCommentPublisher.
-
#publish ⇒ String
Publish the sticky comment, or skip when there is no PR context/findings.
Constructor Details
#initialize(run:, rendered_review:, env: ENV, client: nil) ⇒ StickyCommentPublisher
Returns a new instance of StickyCommentPublisher.
22 23 24 25 26 27 |
# File 'lib/cleo_quality_review/sticky_comment_publisher.rb', line 22 def initialize(run:, rendered_review:, env: ENV, client: nil) @run = run @env = env @client = client @builder = StickyCommentBuilder.new(rendered_review: rendered_review) end |
Instance Method Details
#publish ⇒ String
Publish the sticky comment, or skip when there is no PR context/findings
32 33 34 35 36 37 |
# File 'lib/cleo_quality_review/sticky_comment_publisher.rb', line 32 def publish skip_reason = publication_skip_reason return skip_reason if skip_reason existing_comment_id ? update_comment : create_comment end |