diff --git a/action.yml b/action.yml index 5e80e3fa..9a588e4b 100644 --- a/action.yml +++ b/action.yml @@ -13,11 +13,11 @@ inputs: required: false description: 'Max files to summarize. Less than or equal to 0 means no limit.' - default: '60' + default: '40' max_files_to_review: required: false description: 'Max files to review. Less than or equal to 0 means no limit.' - default: '180' + default: '0' review_comment_lgtm: required: false description: 'Leave comments even if the patch is LGTM' diff --git a/dist/index.js b/dist/index.js index 7fe26d70..ef7b789c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5594,7 +5594,7 @@ class Options { openai_timeout_ms; openai_concurrency_limit; max_tokens_for_extra_content; - constructor(debug, max_files_to_summarize = '60', max_files_to_review = '180', review_comment_lgtm = false, path_filters = null, system_message = '', openai_model = 'gpt-3.5-turbo', openai_model_temperature = '0.0', openai_retries = '3', openai_timeout_ms = '60000', openai_concurrency_limit = '4') { + constructor(debug, max_files_to_summarize = '40', max_files_to_review = '0', review_comment_lgtm = false, path_filters = null, system_message = '', openai_model = 'gpt-3.5-turbo', openai_model_temperature = '0.0', openai_retries = '3', openai_timeout_ms = '60000', openai_concurrency_limit = '4') { this.debug = debug; this.max_files_to_summarize = parseInt(max_files_to_summarize); this.max_files_to_review = parseInt(max_files_to_review); @@ -6126,7 +6126,8 @@ const codeReview = async (bot, options, prompts) => { const summaryPromises = []; const skipped_files_to_summarize = []; for (const [filename, file_content, file_diff] of files_to_review) { - if (summaryPromises.length < options.max_files_to_summarize) { + if (options.max_files_to_summarize <= 0 || + summaryPromises.length < options.max_files_to_summarize) { summaryPromises.push(openai_concurrency_limit(async () => generateSummary(filename, file_content, file_diff))); } else { @@ -6288,9 +6289,6 @@ ${filter_skipped_files.length > 0 } }; // Use Promise.all to run file review processes in parallel - // rewrite this to take max_files_to_review limit into account - // const reviewPromises = files_to_review.map( - // async ([filename, file_content, file_diff, patches]) => // openai_concurrency_limit(async () => // review(filename, file_content, file_diff, patches) // ) @@ -6298,7 +6296,8 @@ ${filter_skipped_files.length > 0 const reviewPromises = []; const skipped_files_to_review = []; for (const [filename, file_content, file_diff, patches] of files_to_review) { - if (reviewPromises.length < options.max_files_to_review) { + if (options.max_files_to_review <= 0 || + reviewPromises.length < options.max_files_to_review) { reviewPromises.push(openai_concurrency_limit(async () => review(filename, file_content, file_diff, patches))); } else { diff --git a/src/options.ts b/src/options.ts index 49e0dfb7..256ac6d2 100644 --- a/src/options.ts +++ b/src/options.ts @@ -207,8 +207,8 @@ export class Options { constructor( debug: boolean, - max_files_to_summarize = '60', - max_files_to_review = '180', + max_files_to_summarize = '40', + max_files_to_review = '0', review_comment_lgtm = false, path_filters: string[] | null = null, system_message = '', diff --git a/src/review.ts b/src/review.ts index 92ec4ad8..5e14d98a 100644 --- a/src/review.ts +++ b/src/review.ts @@ -185,7 +185,10 @@ export const codeReview = async ( const summaryPromises = [] const skipped_files_to_summarize = [] for (const [filename, file_content, file_diff] of files_to_review) { - if (summaryPromises.length < options.max_files_to_summarize) { + if ( + options.max_files_to_summarize <= 0 || + summaryPromises.length < options.max_files_to_summarize + ) { summaryPromises.push( openai_concurrency_limit(async () => generateSummary(filename, file_content, file_diff) @@ -403,9 +406,6 @@ ${ } // Use Promise.all to run file review processes in parallel - // rewrite this to take max_files_to_review limit into account - // const reviewPromises = files_to_review.map( - // async ([filename, file_content, file_diff, patches]) => // openai_concurrency_limit(async () => // review(filename, file_content, file_diff, patches) // ) @@ -418,7 +418,10 @@ ${ file_diff, patches ] of files_to_review) { - if (reviewPromises.length < options.max_files_to_review) { + if ( + options.max_files_to_review <= 0 || + reviewPromises.length < options.max_files_to_review + ) { reviewPromises.push( openai_concurrency_limit(async () => review(filename, file_content, file_diff, patches)