Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

The schedule-review workflow failed to create spaced repetition review schedules when PRs contained both solution and test files (e.g., problem.ts + problem.test.ts). It only worked with a single .ts file.

Changes

  • Added explicit test file exclusion to LeetCode file matching logic
  • Aligns with existing GreatFrontEnd pattern that already excludes .test files

Technical Detail

The workflow iterates through changed files to find the main solution file. Without explicit exclusion, the logic relied on implicit string mismatch (add-two-numbers.testadd-two-numbers). Adding an explicit check makes the intent clear and eliminates any potential edge cases:

# Before
if [[ "$FILE_NAME" == "$PROBLEM_SLUG" ]]; then

# After  
if [[ "$FILE_NAME" == "$PROBLEM_SLUG" ]] && [[ ! "$FILE_NAME" =~ \.test$ ]]; then

The workflow now correctly identifies the main solution file regardless of file ordering or count.

Original prompt

Right now I am not able to add unit tests to a pull request labelled coding-challenge because a scheduled review GitHub workflow action will not be created. If there is no test.ts file and only the .ts file for the code, the schedule review is created. Fix the workflow that is causing reviews not to be setup when there is more than 1 .ts file.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the automated code review scheduling workflow to correctly exclude test files from being selected as the primary solution file. The workflow now accurately differentiates between test files and solution files when assigning reviews, ensuring that code reviews are directed to the appropriate solution files and improving the overall accuracy and efficiency of the automated review assignment process.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

A GitHub Actions workflow file is updated to add a guard condition that excludes test files when determining the main solution file. The condition now verifies that the file name matches the problem slug and does not end with .test, preventing test files from being selected as the main file for both LeetCode and GreatFrontend challenges.

Changes

Cohort / File(s) Summary
Workflow guard condition
\.github/workflows/schedule-review.yml
Adds condition to exclude test files (those ending with .test) from being selected as the main solution file; applies to both leetcode and greatfrontend file selection logic

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5-10 minutes

  • Verify the guard condition logic correctly filters out .test files across both LeetCode and GreatFrontend code paths
  • Confirm the condition syntax is valid and uses proper YAML/bash expression syntax

Possibly related PRs

  • Set up GitHub Actions workflows for AI #22: Modifies the same GitHub Actions workflow file (schedule-review.yml) for handling LeetCode solution file selection, indicating parallel or dependent work on the same workflow logic.

Poem

🐰 Bouncing through workflows with glee,
Test files hop elsewhere, wild and free,
Main solutions sorted clean and neat,
Guard conditions make the logic complete!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: Exclude test files from schedule-review workflow matching' directly and concisely describes the main change: adding explicit exclusion of test files to the workflow's file-matching logic for the schedule-review workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Fix workflow to create scheduled reviews for multiple ts files Fix: Exclude test files from schedule-review workflow matching Dec 22, 2025
Copilot AI requested a review from pertrai1 December 22, 2025 13:37
@pertrai1
Copy link
Owner

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@pertrai1 pertrai1 marked this pull request as ready for review December 22, 2025 14:19
@pertrai1 pertrai1 merged commit 7c20408 into main Dec 22, 2025
5 of 6 checks passed
@pertrai1 pertrai1 deleted the copilot/fix-workflow-for-reviews branch December 22, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants