Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
separate config for max files to summarize and review (#83)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by openai -->
### Summary by OpenAI

Chore: Add separate configuration options for maximum files to summarize
and review. This pull request updates the `Options` object and class
with two new properties, `max_files_to_summarize` and
`max_files_to_review`, and renames the existing `max_files` property to
`max_files_to_summarize`. It also updates `tsconfig.json` by removing
some options and adding others, including setting the target and module
to "ESNext" and enabling strict mode.
<!-- end of auto-generated comment: release notes by openai -->
  • Loading branch information
harjotgill authored Mar 24, 2023
1 parent 9b41bcf commit 009542a
Show file tree
Hide file tree
Showing 6 changed files with 297 additions and 205 deletions.
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ inputs:
required: false
description: 'Enable debug mode'
default: 'false'
max_files:
max_files_to_summarize:
required: false
description:
'Max files to summarize. Less than or equal to 0 means no limit.'
default: '60'
max_files_to_review:
required: false
description: 'Max files to review. Less than or equal to 0 means no limit.'
default: '50'
default: '180'
review_comment_lgtm:
required: false
description: 'Leave comments even if the patch is LGTM'
Expand Down
103 changes: 71 additions & 32 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {codeReview} from './review.js'
async function run(): Promise<void> {
const options: Options = new Options(
core.getBooleanInput('debug'),
core.getInput('max_files'),
core.getInput('max_files_to_summarize'),
core.getInput('max_files_to_review'),
core.getBooleanInput('review_comment_lgtm'),
core.getMultilineInput('path_filters'),
core.getInput('system_message'),
Expand Down
9 changes: 6 additions & 3 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ export class Inputs {

export class Options {
debug: boolean
max_files: number
max_files_to_summarize: number
max_files_to_review: number
review_comment_lgtm: boolean
path_filters: PathFilter
system_message: string
Expand All @@ -206,7 +207,8 @@ export class Options {

constructor(
debug: boolean,
max_files = '60',
max_files_to_summarize = '60',
max_files_to_review = '180',
review_comment_lgtm = false,
path_filters: string[] | null = null,
system_message = '',
Expand All @@ -217,7 +219,8 @@ export class Options {
openai_concurrency_limit = '4'
) {
this.debug = debug
this.max_files = parseInt(max_files)
this.max_files_to_summarize = parseInt(max_files_to_summarize)
this.max_files_to_review = parseInt(max_files_to_review)
this.review_comment_lgtm = review_comment_lgtm
this.path_filters = new PathFilter(path_filters)
this.system_message = system_message
Expand Down
Loading

0 comments on commit 009542a

Please sign in to comment.