Skip to content

Conversation

rishabhtc
Copy link
Collaborator

…figuration as optional

if (reviewers.length === 0 && requiredPhaseIds.length > 0) {
return false
}

Copy link

Choose a reason for hiding this comment

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

The logic for checking required phases has been removed. Ensure that the removal aligns with the new requirement of making reviewer configuration optional. If the intention is to allow challenges without reviewers even when certain phases are present, this change is appropriate. Otherwise, consider implementing a new validation logic that reflects the updated requirements.

@rishabhtc rishabhtc requested a review from vas3a October 8, 2025 16:06
Copy link
Collaborator

@vas3a vas3a left a comment

Choose a reason for hiding this comment

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

based on the provided description/details, this doesn't look right. please check again. also, do we need an api update to make the reviewers optional?

Comment on lines -831 to 805
}

// Enforce coverage: if the challenge has any of the required phases,
// then there must be at least one reviewer with a scorecard for that phase.
// If any required phase exists, ensure at least one reviewer with scorecard configured for it
for (const phaseId of requiredPhaseIds) {
const hasReviewerForPhase = reviewers.some(r => {
const rPhaseId = r.phaseId
const hasScorecard = !!r.scorecardId
return rPhaseId === phaseId && hasScorecard
})
if (!hasReviewerForPhase) {
return false
}
}

return true
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm. as far as I can see, based on the description provided in slack, this is the only piece that makes sense to be removed. why the rest of the cleanup?

Here's the provided description:

Root Cause Analysis (RCA):
Previously, the system enforced reviewer configuration checks across all required phases (i.e., both Screening and Review) for design challenges. This meant that if reviewer configuration was missing in any of these phases, the system would trigger a validation error, even in cases where reviewer configuration was not necessary for a particular phase.
Solution:
To address this, I refactored the logic to make reviewer configuration optional for each phase. Now, if a user chooses not to set reviewer configuration in the Screening phase, but does so in the Review phase, the system will not display a validation error. This provides greater flexibility and aligns with the actual requirements for design challenges.
Additionally, following confirmation from Kiril, reviewer configuration is now set as optional. This change ensures that users are not forced to configure reviewers in phases where it is not needed

Comment on lines -797 to -800
// If any required phase exists and no reviewers configured, it's invalid
if (reviewers.length === 0 && requiredPhaseIds.length > 0) {
return false
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we want at least one reviewer for a challenge?

Comment on lines -628 to -638
{(!readOnly && challenge.submitTriggered) && (() => {
const missing = this.getMissingRequiredPhases()
if (missing.length > 0) {
return (
<div className={styles.error}>
{`Please configure a scorecard for: ${missing.join(', ')}`}
</div>
)
}
return null
})()}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to remove this?

@rishabhtc
Copy link
Collaborator Author

Justin is taking care of it along with reviewer assigning in config. so closing the PR

@rishabhtc rishabhtc closed this Oct 9, 2025
@rishabhtc rishabhtc deleted the PM-2363 branch October 9, 2025 10:12
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