-
Notifications
You must be signed in to change notification settings - Fork 51
Removed reviewer config for every required phase and Set Reviewer con… #1686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…figuration as optional
if (reviewers.length === 0 && requiredPhaseIds.length > 0) { | ||
return false | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this 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?
} | ||
|
||
// 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 | ||
} |
There was a problem hiding this comment.
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
// If any required phase exists and no reviewers configured, it's invalid | ||
if (reviewers.length === 0 && requiredPhaseIds.length > 0) { | ||
return false | ||
} |
There was a problem hiding this comment.
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?
{(!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 | ||
})()} |
There was a problem hiding this comment.
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?
Justin is taking care of it along with reviewer assigning in config. so closing the PR |
…figuration as optional