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): main interface for create review on a pull request #114

Merged
merged 4 commits into from Sep 11, 2020

Conversation

TomKristie
Copy link
Contributor

Main interface for frame-work core, documentation + review comments:

  1. renamin comment to reviewPullRequest
  2. more tests!

PR commit for #105

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

codecov bot commented Sep 10, 2020

Codecov Report

Merging #114 into comment-pr will increase coverage by 6.63%.
The diff coverage is 99.18%.

Impacted file tree graph

@@              Coverage Diff               @@
##           comment-pr     #114      +/-   ##
==============================================
+ Coverage       85.44%   92.08%   +6.63%     
==============================================
  Files              26       26              
  Lines            2213     2325     +112     
  Branches          151      182      +31     
==============================================
+ Hits             1891     2141     +250     
+ Misses            321      183     -138     
  Partials            1        1              
Impacted Files Coverage Δ
src/github-handler/index.ts 94.73% <0.00%> (+0.29%) ⬆️
src/default-options-handler.ts 100.00% <100.00%> (ø)
...er/comment-handler/get-hunk-scope-handler/index.ts 100.00% <100.00%> (+100.00%) ⬆️
src/github-handler/comment-handler/index.ts 100.00% <100.00%> (+100.00%) ⬆️
...ndler/comment-handler/valid-patch-handler/index.ts 100.00% <100.00%> (+100.00%) ⬆️
...ler/valid-patch-handler/upload-comments-handler.ts 97.39% <100.00%> (ø)
src/index.ts 99.54% <100.00%> (+0.15%) ⬆️
src/types/index.ts 100.00% <100.00%> (ø)
... and 2 more

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 2d05034...5c58e79. Read the comment docs.

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

Thanks Kristie!

* @param options The user's options input for review comments
* @returns the formatted version of user input for pull request review comments
*/
export function addRevuewCommentsDefaults(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function addRevuewCommentsDefaults(
export function addReviewCommentsDefaults(

src/index.ts Outdated
repo: gitHubConfigs.repo,
};
logger.info(
`Successfully created a review on pull requestt: ${gitHubConfigs.pullNumber}.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`Successfully created a review on pull requestt: ${gitHubConfigs.pullNumber}.`
`Successfully created a review on pull request: ${gitHubConfigs.pullNumber}.`

Comment on lines 62 to 73
) {
const reviewCommentSettings: CreateReviewComment = {
repo: options.repo,
owner: options.owner,
pullNumber: options.pullNumber,
// if zero set as 0
pageSize:
options.pageSize === null || options.pageSize === undefined
? DEFAULT_PAGE_SIZE
: options.pageSize,
};
return reviewCommentSettings;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's declare the return type in the signature and then we can return the object directly.

src/index.ts Outdated
);
return;
}
const gitHubConfigs = addRevuewCommentsDefaults(options);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name this createReviewComment as it's a CreateReviewComment type?

Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

This is looking solid to me once @chingor13's typo and naming nits are addressed.

@chingor13 chingor13 merged commit e759059 into googleapis:comment-pr Sep 11, 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