Skip to content

Conversation

@dhamariT
Copy link
Contributor

@dhamariT dhamariT commented Oct 1, 2025

No description provided.

@dhamariT dhamariT requested a review from Copilot October 1, 2025 15:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the ship reviewer payout feature to improve consistency and maintainability by consolidating the feature launch date into a constant and updating references throughout the codebase.

  • Extracted hardcoded feature launch date into a named constant FEATURE_LAUNCH_DATE
  • Replaced duplicate date definitions with references to the centralized constant
  • Removed a condition from the reviewer leaderboard query

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/services/ship_reviewer_payout_service.rb Added FEATURE_LAUNCH_DATE constant and updated query to use it
app/controllers/admin/ship_certifications_controller.rb Updated to reference the service constant and removed a query condition

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.where.not(reviewer_id: nil)
.where("ship_certifications.updated_at > ship_certifications.created_at")
.where.not(judgement: :pending)
.where(projects: { is_deleted: false })
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The removal of the condition .where("ship_certifications.updated_at > ship_certifications.created_at") from the reviewer leaderboard query changes the behavior significantly. This condition was filtering for decisions that were actually made (updated after creation), and its removal may include certifications that were never reviewed. Consider whether this behavioral change is intentional, and if so, ensure it aligns with the business logic for the leaderboard.

Suggested change
.where(projects: { is_deleted: false })
.where(projects: { is_deleted: false })
.where("ship_certifications.updated_at > ship_certifications.created_at")

Copilot uses AI. Check for mistakes.
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.

1 participant