-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -772,32 +772,6 @@ class ChallengeEditor extends Component { | |
isValidReviewers () { | ||
const { challenge } = this.state | ||
const reviewers = challenge.reviewers || [] | ||
const requiredPhaseNames = [ | ||
'Screening', | ||
'Review', | ||
'Post-mortem', | ||
'Approval', | ||
'Checkpoint Screening', | ||
'Iterative Review' | ||
] | ||
const normalize = (name) => (name || '') | ||
.toString() | ||
.toLowerCase() | ||
.replace(/[-\s]/g, '') | ||
const requiredNormalized = new Set(requiredPhaseNames.map(normalize)) | ||
const challengePhases = Array.isArray(challenge.phases) ? challenge.phases : [] | ||
const requiredPhaseIds = [] | ||
for (const phase of challengePhases) { | ||
const phaseNameNorm = normalize(phase.name) | ||
if (requiredNormalized.has(phaseNameNorm)) { | ||
requiredPhaseIds.push(phase.phaseId || phase.id) | ||
} | ||
} | ||
|
||
// If any required phase exists and no reviewers configured, it's invalid | ||
if (reviewers.length === 0 && requiredPhaseIds.length > 0) { | ||
return false | ||
} | ||
Comment on lines
-797
to
-800
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we want at least one reviewer for a challenge? |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
// Validate each reviewer | ||
for (const reviewer of reviewers) { | ||
|
@@ -827,21 +801,6 @@ class ChallengeEditor extends Component { | |
return false | ||
} | ||
} | ||
|
||
// 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 | ||
} | ||
Comment on lines
-831
to
805
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
|
||
|
||
|
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?