- Notifications
You must be signed in to change notification settings - Fork6
Additional checks for reviewer setup before allowing activation (PM-3…#55
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
19eb10d intodevelopUh oh!
There was an error while loading.Please reload this page.
| RESOURCE_ROLES_API_URL: | ||
| process.env.RESOURCE_ROLES_API_URL||"http://api.topcoder-dev.com/v5/resource-roles", | ||
| GROUPS_API_URL:process.env.GROUPS_API_URL||"http://localhost:4000/v5/groups", | ||
| GROUPS_API_URL:process.env.GROUPS_API_URL||"http://localhost:4000/v6/groups", |
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.
[❗❗correctness]
The change from/v5/groups to/v6/groups in theGROUPS_API_URL suggests an API version update. Ensure that the new version is backward compatible or that all necessary changes are made to accommodate any breaking changes in the new API version.
| describe('update challenge tests',()=>{ | ||
| constensureSkipTimelineTemplate=async()=>{ | ||
| consttemplateId=config.SKIP_PROJECT_ID_BY_TIMLINE_TEMPLATE_ID |
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.
[correctness]
The variabletemplateId is assigned usingconfig.SKIP_PROJECT_ID_BY_TIMLINE_TEMPLATE_ID. Ensure that this configuration value is correctly set and validated before use to prevent potential runtime errors.
| constexistingPhases=awaitprisma.timelineTemplatePhase.findMany({ | ||
| where:{timelineTemplateId:templateId} | ||
| }) | ||
| constexistingPhaseIds=newSet(existingPhases.map(p=>p.phaseId)) |
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.
[correctness]
The use ofnew Set(existingPhases.map(p => p.phaseId)) is efficient for checking existence, but ensure thatdata.phase.id anddata.phase2.id are defined and valid before this check to avoid potential errors.
| } | ||
| constcreateChallengeWithRequiredReviewPhases=async()=>{ | ||
| awaitensureSkipTimelineTemplate() |
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.
[correctness]
The functioncreateChallengeWithRequiredReviewPhases assumes thatdata.challenge.typeId anddata.challenge.trackId are available. Ensure these values are properly initialized and validated to prevent potential issues.
| } | ||
| } | ||
| constcreateActivationChallenge=async(status=ChallengeStatusEnum.NEW)=>{ |
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.
[correctness]
The functioncreateActivationChallenge usesdata.challenge.typeId anddata.challenge.trackId. Ensure these values are initialized and validated to prevent potential issues.
| status:ChallengeStatusEnum.ACTIVE | ||
| }) | ||
| }catch(e){ | ||
| should.equal(e.message.indexOf('reviewer configured')>=0,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.
[maintainability]
The error message checke.message.indexOf('reviewer configured') >= 0 is fragile and could break if the error message changes. Consider using a more robust error handling strategy.
| } | ||
| ) | ||
| }catch(e){ | ||
| should.equal(e.message.indexOf('missing reviewers for phase(s): Review')>=0,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.
[maintainability]
The error message checke.message.indexOf('missing reviewers for phase(s): Review') >= 0 is fragile and could break if the error message changes. Consider using a more robust error handling strategy.
PM-3062