-
Notifications
You must be signed in to change notification settings - Fork 51
March 2026 prod release #1736
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
March 2026 prod release #1736
Changes from all commits
ec539ec
e52ebf4
1bd68aa
59ea314
ca9a89f
6f51c86
eee18e7
7e6183b
33fd39c
285be20
82358f6
52014c7
f098fbd
ea318b7
c9f2941
05e5468
adc6f30
f5464ce
5258488
7f184be
62107fd
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 |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ const LOCAL_MEMBER_API = 'http://localhost:3003/v6' | |
| const LOCAL_RESOURCE_API = 'http://localhost:3004/v6' | ||
| const LOCAL_REVIEW_API = 'http://localhost:3005/v6' | ||
| const LOCAL_SKILLS_API_V5 = 'http://localhost:3006/v5/standardized-skills' | ||
| const LOCAL_PROJECTS_API = 'http://localhost:3008/v6/projects' | ||
|
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. [ |
||
| // Lookups API available on 3007 if needed in future | ||
| // const LOCAL_LOOKUPS_API = 'http://localhost:3007/v6' | ||
|
|
||
|
|
@@ -46,8 +47,8 @@ module.exports = { | |
| // Copilots and other apps remain on dev | ||
| COPILOTS_URL: 'https://copilots.topcoder-dev.com', | ||
|
|
||
| // Projects API: keep dev unless you run projects locally | ||
| PROJECT_API_URL: `${DEV_API_HOSTNAME}/v5/projects`, | ||
| // Projects API v6: keep dev default (switch to LOCAL_PROJECTS_API when needed) | ||
| PROJECT_API_URL: `${DEV_API_HOSTNAME}/v6/projects`, | ||
|
|
||
| // Local groups/resources/review services | ||
| GROUPS_API_URL: `${LOCAL_GROUPS_API}/groups`, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ module.exports = { | |
| CHALLENGE_PHASES_URL: `${PROD_API_HOSTNAME}/v6/challenge-phases`, | ||
| CHALLENGE_TIMELINES_URL: `${PROD_API_HOSTNAME}/v6/challenge-timelines`, | ||
| COPILOTS_URL: `https://copilots.${DOMAIN}`, | ||
| PROJECT_API_URL: `${PROD_API_HOSTNAME}/v5/projects`, | ||
| PROJECT_API_URL: `${PROD_API_HOSTNAME}/v6/projects`, | ||
|
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. [❗❗ |
||
| GROUPS_API_URL: `${PROD_API_HOSTNAME}/v6/groups`, | ||
| TERMS_API_URL: `${PROD_API_HOSTNAME}/v5/terms`, | ||
| MEMBERS_API_URL: `${PROD_API_HOSTNAME}/v5/members`, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ import { | |
| patchEngagement, | ||
| deleteEngagement as deleteEngagementAPI | ||
| } from '../services/engagements' | ||
| import { fetchProjectById } from '../services/projects' | ||
| import { fetchSkillsByIds } from '../services/skills' | ||
| import { | ||
| normalizeEngagement, | ||
|
|
@@ -34,8 +33,6 @@ import { | |
| DELETE_ENGAGEMENT_FAILURE | ||
| } from '../config/constants' | ||
|
|
||
| const projectNameCache = {} | ||
|
|
||
| const getSkillId = (skill) => { | ||
| if (!skill) { | ||
| return null | ||
|
|
@@ -96,70 +93,6 @@ const withSkillDetails = (engagement, skillsMap) => { | |
| } | ||
| } | ||
|
|
||
| const getProjectId = (engagement) => { | ||
| if (!engagement || !engagement.projectId) { | ||
| return null | ||
| } | ||
| return String(engagement.projectId) | ||
| } | ||
|
|
||
| const getProjectName = (project) => { | ||
| if (!project || typeof project !== 'object') { | ||
| return null | ||
| } | ||
| if (typeof project.name === 'string' && project.name.trim()) { | ||
| return project.name | ||
| } | ||
| if (typeof project.projectName === 'string' && project.projectName.trim()) { | ||
| return project.projectName | ||
| } | ||
| return null | ||
| } | ||
|
|
||
| const hydrateEngagementProjectNames = async (engagements = []) => { | ||
| if (!Array.isArray(engagements) || !engagements.length) { | ||
| return [] | ||
| } | ||
|
|
||
| const projectIds = Array.from(new Set( | ||
| engagements | ||
| .map(getProjectId) | ||
| .filter(Boolean) | ||
| )) | ||
|
|
||
| if (!projectIds.length) { | ||
| return engagements | ||
| } | ||
|
|
||
| const uncachedProjectIds = projectIds.filter((projectId) => !projectNameCache[projectId]) | ||
| if (uncachedProjectIds.length) { | ||
| const projectNameEntries = await Promise.all( | ||
| uncachedProjectIds.map(async (projectId) => { | ||
| try { | ||
| const project = await fetchProjectById(projectId) | ||
| return [projectId, getProjectName(project)] | ||
| } catch (error) { | ||
| return [projectId, null] | ||
| } | ||
| }) | ||
| ) | ||
|
|
||
| projectNameEntries.forEach(([projectId, projectName]) => { | ||
| if (projectName) { | ||
| projectNameCache[projectId] = projectName | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| return engagements.map((engagement) => { | ||
| const projectId = getProjectId(engagement) | ||
| return { | ||
| ...engagement, | ||
| projectName: (projectId && projectNameCache[projectId]) || engagement.projectName || null | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| const hydrateEngagementSkills = async (engagements = []) => { | ||
| if (!Array.isArray(engagements) || !engagements.length) { | ||
| return [] | ||
|
|
@@ -195,9 +128,19 @@ const hydrateEngagementSkills = async (engagements = []) => { | |
| * @param {String} status | ||
| * @param {String} filterName | ||
| * @param {Boolean} includePrivate | ||
| * @param {Array<String>} projectIds | ||
| */ | ||
| export function loadEngagements (projectId, status = 'all', filterName = '', includePrivate = false) { | ||
| export function loadEngagements (projectId, status = 'all', filterName = '', includePrivate = false, projectIds = []) { | ||
| const hasProjectIdsArg = arguments.length >= 5 | ||
|
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. [ |
||
| return async (dispatch) => { | ||
| if (hasProjectIdsArg && Array.isArray(projectIds) && !projectIds.length) { | ||
|
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. [💡 |
||
| dispatch({ | ||
| type: LOAD_ENGAGEMENTS_SUCCESS, | ||
| engagements: [] | ||
| }) | ||
| return | ||
| } | ||
|
|
||
| dispatch({ | ||
| type: LOAD_ENGAGEMENTS_PENDING | ||
| }) | ||
|
|
@@ -215,6 +158,9 @@ export function loadEngagements (projectId, status = 'all', filterName = '', inc | |
| if (includePrivate) { | ||
| filters.includePrivate = true | ||
| } | ||
| if (projectIds && projectIds.length) { | ||
| filters.projectIds = projectIds | ||
| } | ||
|
|
||
| try { | ||
| const engagements = [] | ||
|
|
@@ -273,8 +219,7 @@ export function loadEngagements (projectId, status = 'all', filterName = '', inc | |
| } while (!totalPages || page <= totalPages) | ||
|
|
||
| const hydratedEngagements = await hydrateEngagementSkills(engagements) | ||
| const engagementsWithProjectNames = await hydrateEngagementProjectNames(hydratedEngagements) | ||
| const normalizedEngagements = normalizeEngagements(engagementsWithProjectNames) | ||
| const normalizedEngagements = normalizeEngagements(hydratedEngagements) | ||
| dispatch({ | ||
| type: LOAD_ENGAGEMENTS_SUCCESS, | ||
| engagements: normalizedEngagements | ||
|
|
||
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]Ensure that all dependencies and integrations using the
PROJECT_API_URLare compatible with the new API versionv6. This change may affect other parts of the system relying on the previousv5endpoint.