From 8e4f4d5b8ee2cf3dbffd4f2a4a3b822de45b37ae Mon Sep 17 00:00:00 2001 From: Evgenii Morozov Date: Wed, 12 Mar 2025 15:04:52 +0100 Subject: [PATCH 1/6] Test commit for the test branch --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7b9bd5f..5846069 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ ``` ruby pr-review.rb https://github.com/evmorov/pr-review-prompt/pulls/1 ``` + +Hello From 5f0f869a41bf093fff25417f3189058bcf30e06a Mon Sep 17 00:00:00 2001 From: Evgenii Morozov Date: Wed, 18 Jun 2025 22:07:14 +0200 Subject: [PATCH 2/6] More changes --- .rspec_status | 4 +++ pr-review.rb | 89 --------------------------------------------------- 2 files changed, 4 insertions(+), 89 deletions(-) create mode 100644 .rspec_status delete mode 100644 pr-review.rb diff --git a/.rspec_status b/.rspec_status new file mode 100644 index 0000000..d9ab524 --- /dev/null +++ b/.rspec_status @@ -0,0 +1,4 @@ +example_id | status | run_time | +------------------------------ | ------ | --------------- | +./spec/prreview_spec.rb[1:1] | passed | 0.00059 seconds | +./spec/prreview_spec.rb[2:1:1] | passed | 0.01083 seconds | diff --git a/pr-review.rb b/pr-review.rb deleted file mode 100644 index cd3af11..0000000 --- a/pr-review.rb +++ /dev/null @@ -1,89 +0,0 @@ -require 'open3' - -class PrReview - def initialize - @pr_url = ARGV[0] - raise "No Github URL is provided" if @pr_url.nil? || @pr_url.empty? - end - - def run - prompt = [] - - prompt << @pr_url - - readme = request_gh("gh repo view #{repo_url}") - prompt << wrap_content('README.md', remove_markdown(readme)) - - details_with_comments = request_gh("gh pr view --comments #{@pr_url}") - prompt << wrap_content('PR description and comments', remove_markdown(details_with_comments)) - - commits = request_gh(%{gh pr view --json commits #{@pr_url} | jq -r '.commits[] | "\\(.authors[0].name) (\\(.authors[0].login)) – \\(.messageHeadline)"'}) - prompt << wrap_content('PR commits', commits) - - prompt << files - - diff = request_gh("gh pr diff #{@pr_url}") - prompt << wrap_content('PR diff', diff) - - task = "Check the PR. Do you see any problems there?" - prompt << wrap_content('Your task', task) - - IO.popen('pbcopy', 'w') { |io| io.puts(prompt) } - end - - private - - def files - result = [] - file_paths = request_gh("gh pr diff --name-only #{@pr_url}") - - file_paths.split("\n").each do |file_path| - content = request_gh("gh api #{api_contents_path}/#{file_path}?ref=#{branch} | jq -r '.content' | base64 --decode") - next unless content - - result << wrap_content(file_path, content) - end - - result - end - - def api_contents_path - @api_contents_path ||= "repos/#{repo_url.split('github.com/')[1]}/contents" - end - - def repo_url - @repo_url ||= @pr_url.split('/pull')[0] - end - - def branch - @branch ||= request_gh("gh pr view #{@pr_url} --json headRefName -q .headRefName").strip - end - - def wrap_content(file_name, content) - r = [] - r << "\n" - r << "## #{file_name}" - r << "\n" - r << "```" - r << content - r << "```" - end - - def request_gh(cmd) - puts cmd - stdout, stderr, status = Open3.capture3(cmd) - - unless stderr.empty? - puts stderr - return - end - - stdout - end - - def remove_markdown(content) - content.delete("`").delete("#") - end -end - -PrReview.new.run From 2cb20b594cb94bc7ef58bad6afaa9b5bc41d80bc Mon Sep 17 00:00:00 2001 From: Evgenii Morozov Date: Wed, 18 Jun 2025 22:11:12 +0200 Subject: [PATCH 3/6] Another change --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 05db8dc..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,5 +0,0 @@ -``` -ruby pr-review.rb https://github.com/evmorov/pr-review-prompt/pull/2 -``` - -Hello From f19f67330eb5c008069e265babdc19ed3353d9f0 Mon Sep 17 00:00:00 2001 From: Evgenii Morozov Date: Thu, 19 Jun 2025 09:45:43 +0200 Subject: [PATCH 4/6] Add binary --- icon.png | Bin 0 -> 5599 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 icon.png diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f3b5abcbde91cf6d7a6a26e514eb7e30f476f950 GIT binary patch literal 5599 zcmeHL-D}fO6hCR_taXJlzs3}~RuB=Iujyo=i*=1|1FN%E=zNfMTjru|Q<6v{J{U!C zBEE}?j6I3sz>fzN!6}L_BKjcuASk~1;Dg|U_@d{g?V8mM`~#9U+>>*Ezw>c(PjYWA z4(;!cgge6k5E&d$G5`S-0}!Ik>CV(0Y#1}s-v_gAHhja2=W1?nBAte9D2HG<(+)uj z!5=W4u*{VKMw#{V@^NNs4TClr!FAA%ID-*gc{R%CFKEzG<6gm*9s_uy)oMGW*=nJf zw{(Mau|2FHfXIv6C0@Wk5k)F=3jo1srV-C{pl&k&)4_&JjYrnbJiul}d0^NCSh(#7h=F;3{|>EU>h z6U8_p;^wK6mAB(1b92>5-HxJ~V}@3?G`&Qq-TbJ2(&~-HsH6F#8mFaAG(45eT3VPO zM|(Jd<+;UZs;w>0Qw}0>D%{~r{uo_Fl5_Bo3ABWi zWo^j^_T3dxG6J6fH8X)$a^%TJ#PU!=LxF=#Fd9EvKx_x>q<(KY%+y-08?kN9dXjXK z**Q=yt-FTU*13ouhCdqq-0&;Ke{T3sQU9IdzhV9LhQIpq*P{N)+}|Mh+a-VV=x?R} c>%+pvTcMWshj-umO}|qP?%A)*_KlqT3uEqhU;qFB literal 0 HcmV?d00001 From f2093509771bb7f9cf89099fde44043e26395bb2 Mon Sep 17 00:00:00 2001 From: Evgenii Morozov Date: Tue, 1 Jul 2025 22:21:19 +0200 Subject: [PATCH 5/6] Other changes --- pr-review.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 pr-review.rb diff --git a/pr-review.rb b/pr-review.rb new file mode 100644 index 0000000..3cede79 --- /dev/null +++ b/pr-review.rb @@ -0,0 +1,8 @@ +require 'open3' + +class PrReview + def initialize + @pr_url = ARGV[0] + raise "No Github URL is provided" if @pr_url.nil? || @pr_url.empty? + end +end From 54ca3787aa971eab11288b69576bacabac4010f5 Mon Sep 17 00:00:00 2001 From: Evgenii Morozov Date: Tue, 26 Aug 2025 12:05:31 +0200 Subject: [PATCH 6/6] Add svg --- sample.svg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sample.svg diff --git a/sample.svg b/sample.svg new file mode 100644 index 0000000..4ade7a8 --- /dev/null +++ b/sample.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file