diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a4a3ce291f1..57cae297969 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,8 +8,3 @@ /bindings/nodejs/ @suyanhanx /bindings/python/ @messense @Zheaoli /bindings/ruby/ @PsiACE - -# This is a place holder for all committers who what to join the review of not owned code. -# -# More details could be found at -COMMITTERS_PLACEHOLDER @Xuanwo @Ji-Xinyou @morristai @dqhl76 @ClSlaid @Young-Flash @G-XD @oowl @silver-ymz diff --git a/.github/scripts/assign_reviewers.js b/.github/scripts/assign_reviewers.js index 15089ba9056..0d65fc5eed8 100644 --- a/.github/scripts/assign_reviewers.js +++ b/.github/scripts/assign_reviewers.js @@ -17,33 +17,31 @@ * under the License. */ +// All committers who what to join the review of not owned code. +// More details could be found at https://github.com/apache/opendal/issues/3967. +const candidates = [ + "Xuanwo", + "Ji-Xinyou", + "morristai", + "dqhl76", + "ClSlaid", + "Young-Flash", + "G-XD", + "oowl", + "silver-ymz", +]; + async function run(github, context, core, fs) { try { // Pick two reviewers from list const numberOfReviewers = 2; const repo = context.repo; - // Read CODEOWNERS - const codeownersContent = fs.readFileSync('.github/CODEOWNERS', 'utf8'); - const lines = codeownersContent.split('\n'); - - // Search COMMITTERS - const placeholderLine = lines.find(line => line.startsWith('COMMITTERS_PLACEHOLDER')); - if (!placeholderLine) { - throw new Error("No COMMITTERS found in CODEOWNERS"); - } - - // Extract committers from placeholder line - const committers = placeholderLine.match(/@[\w-]+/g).map(u => u.substring(1)); - if (committers.length === 0) { - throw new Error("No committer found in COMMITTERS_PLACEHOLDER"); - } - // Pick reviewers const selectedReviewers = []; - while (selectedReviewers.length < numberOfReviewers && committers.length > 0) { - const randomIndex = Math.floor(Math.random() * committers.length); - selectedReviewers.push(committers.splice(randomIndex, 1)[0]); + while (selectedReviewers.length < numberOfReviewers && candidates.length > 0) { + const randomIndex = Math.floor(Math.random() * candidates.length); + selectedReviewers.push(candidates.splice(randomIndex, 1)[0]); } // Assign reviewers Pull Request