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

feat(framework-core): return review number and variable renaming #117

Merged
merged 2 commits into from Sep 24, 2020

Conversation

TomKristie
Copy link
Contributor

Renamed user input for text file content of 'diffs' rawChanges to diffContents.
Renamed variable name references to this user diff file contents as well, i.e. testRawContents -> testDiffContents
Renamed RawContents object to FileDiffContents

Changed return type from void to returning the review number, or null if there was no exception but a review was not created. More succinctly, the return type is number and null. null was chosen since it clearly indicates the "lack-of-existance" of a review.

Moved the logging of successful review into the callee since the reviewPullRequest caller method does not always return a number. Having the successful log directly after the corresponding async call was made rather than in the caller allows for better logging control. Now the callee handles the logging of when there are no reviews to be made and when there is a successful review.

Towards #105

@TomKristie TomKristie requested a review from a team September 24, 2020 05:14
@TomKristie TomKristie requested a review from a team as a code owner September 24, 2020 05:14
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 24, 2020
@codecov
Copy link

codecov bot commented Sep 24, 2020

Codecov Report

Merging #117 into comment-pr will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           comment-pr     #117      +/-   ##
==============================================
+ Coverage       91.87%   91.89%   +0.01%     
==============================================
  Files              25       25              
  Lines            2290     2295       +5     
  Branches          161      164       +3     
==============================================
+ Hits             2104     2109       +5     
  Misses            185      185              
  Partials            1        1              
Impacted Files Coverage Δ
src/github-handler/comment-handler/index.ts 100.00% <100.00%> (ø)
...ler/make-review-handler/upload-comments-handler.ts 99.20% <100.00%> (+0.02%) ⬆️
...handler/raw-patch-handler/hunk-to-patch-handler.ts 100.00% <100.00%> (ø)
...andler/raw-patch-handler/in-scope-hunks-handler.ts 100.00% <100.00%> (ø)
...handler/comment-handler/raw-patch-handler/index.ts 100.00% <100.00%> (ø)
...ment-handler/raw-patch-handler/raw-hunk-handler.ts 100.00% <100.00%> (ø)
src/index.ts 99.54% <100.00%> (-0.01%) ⬇️
src/types/index.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a398706...1f4b0d9. Read the comment docs.

@chingor13 chingor13 merged commit 1795930 into googleapis:comment-pr Sep 24, 2020
chingor13 added a commit that referenced this pull request Sep 25, 2020
…n pull requests (#105)

* feat(patch text to hunk bounds): support regex for patch texts (#83)

* fix(patch text to hunk bounds): support regex for patch texts

* more comments and more tests

* fix(framework-core): core-library get remote patch ranges (#84)

* fix(framework-core): given files old content and new content, compute the valid hunks (#86)

* fix(framework-core): parse raw changes to ranges

* refactor(framework-core): rename modules, functions, & re-org project structure (#89)

* fix(framework-core): hunk to patch object (#91)

* feat: build failure message from invalid hunks (#90)

* test: add failing stub and test for building the failure message

* fix: implement message building

* fix: use original line numbers in error message

* docs: add docstring

* docs: add note about empty input returning empty string

* feat(framework-core): comment on prs given suggestions (#93)

* feat(framework-core): main interface for create review on a pull request (#114)

* feat(framework-core): main interface for create review on a pull request

* docs: fix typo

* nits and typos...

* gts lint warning fix

* fix(framework-core): combine review comments (#116)

* fix(framework-core): collapsing timeline and inline comments into single review

* test: fixed imports

* added case when there are out of scope suggestions and no valid suggestions

* feat(framework-core): return review number and variable renaming (#117)

* feat(framework-core): return review number and variable renaming

* lint

Co-authored-by: Jeff Ching <chingor@google.com>
Co-authored-by: Justin Beckwith <justin.beckwith@gmail.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants