Skip to content

feat: add user flags, profile experiences and autocomplete for profile interim#2944

Merged
ilasw merged 39 commits intomainfrom
MI-953-profile-interim
Aug 1, 2025
Merged

feat: add user flags, profile experiences and autocomplete for profile interim#2944
ilasw merged 39 commits intomainfrom
MI-953-profile-interim

Conversation

@ilasw
Copy link
Contributor

@ilasw ilasw commented Jul 23, 2025

Added user profile user experiences, skills, flags, job preferences, and a new autocomplete endopoint.

Jira ticket

MI-953

@pulumi
Copy link

pulumi bot commented Jul 23, 2025

🍹 The Update (preview) for dailydotdev/api/prod (at 35ff63b) was successful.

Resource Changes

    Name                                            Type                           Operation
~   vpc-native-validate-active-users-cron           kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-update-current-streak-cron           kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron       kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment       kubernetes:apps/v1:Deployment  update
~   vpc-native-hourly-notification-cron             kubernetes:batch/v1:CronJob    update
+   vpc-native-api-migration-14d5c9f5               kubernetes:batch/v1:Job        create
~   vpc-native-bg-deployment                        kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-user-companies-cron     kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-stale-user-transactions-cron   kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-recommendations-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron           kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                        kubernetes:apps/v1:Deployment  update
-   vpc-native-api-migration-c7950645               kubernetes:batch/v1:Job        delete
~   vpc-native-update-tags-str-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                  kubernetes:apps/v1:Deployment  update
~   vpc-native-update-highlighted-views-cron        kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                   kubernetes:apps/v1:Deployment  update
~   vpc-native-update-source-public-threshold-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-tag-view-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron             kubernetes:batch/v1:CronJob    update

@ilasw ilasw changed the title feat: profile interim feat: add user flags, profile experiences and autocomplete for profile iterim Jul 29, 2025
@ilasw ilasw requested a review from Copilot July 29, 2025 10:03

This comment was marked as outdated.

@ilasw ilasw changed the title feat: add user flags, profile experiences and autocomplete for profile iterim feat: add user flags, profile experiences and autocomplete for profile interim Jul 29, 2025
@ilasw ilasw requested a review from Copilot July 29, 2025 10:44

This comment was marked as outdated.

@ilasw ilasw requested a review from Copilot July 29, 2025 11:11

This comment was marked as outdated.

@ilasw ilasw requested a review from Copilot July 29, 2025 13:44

This comment was marked as outdated.

@ilasw ilasw requested review from capJavert and Copilot July 30, 2025 10:15

This comment was marked as outdated.

@dailydotdev dailydotdev deleted a comment from Copilot AI Jul 30, 2025
@ilasw ilasw requested a review from Copilot July 30, 2025 14:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a comprehensive user profile system with experience tracking and autocomplete functionality. It adds user experience entities for work, education, certifications, awards, publications, courses, and projects, along with job preferences and skills management. A new GraphQL autocomplete endpoint enables searching across various profile fields like job titles, companies, skills, and educational institutions.

  • Introduces multiple user experience entity types with a hierarchical structure using TypeORM table inheritance
  • Adds user job preferences with compensation tracking and work location preferences
  • Implements a flexible autocomplete system supporting 10 different search types with proper validation

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/schema/profileAutocomplete.ts Core autocomplete implementation with GraphQL schema, resolvers, and query mapping
src/graphql.ts Registers the new autocomplete schema and resolvers with the GraphQL server
src/entity/user/experiences/*.ts Defines experience entity hierarchy with base UserExperience and specialized child entities
src/entity/user/UserSkill.ts User skills entity with auto-generated slug and many-to-many relationship to experiences
src/entity/user/UserJobPreferences.ts Job preferences including compensation, location type, and role preferences
src/entity/user/User.ts Extends User entity with new relationships and location flags
src/entity/Company.ts Adds company type enum to distinguish between businesses and schools
tests/profileAutocomplete.ts Comprehensive test suite covering validation, skills, job titles, and company autocomplete
Comments suppressed due to low confidence (1)

src/entity/user/UserJobPreferences.ts:39

  • The TODO comment references a different ticket (MI-958) than the one mentioned in the PR description (MI-953). This could cause confusion about which ticket handles the sensitive data protection.
  // todo: never send this field to FE while implementing MI-953

queryRunner.manager
.getRepository(entity)
.createQueryBuilder('entity')
.select(select ?? ['id', propertyName])
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The select clause uses propertyName directly which may not work correctly with TypeORM's select method. TypeORM expects column names prefixed with the alias. This should be entity.${propertyName} to match the query builder pattern.

Suggested change
.select(select ?? ['id', propertyName])
.select(select ?? [`entity.id`, `entity.${propertyName}`])

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

[AutocompleteType.CertificationName]: UserCertificationExperience;
[AutocompleteType.CertificationIssuer]: Company;
[AutocompleteType.AwardName]: UserAwardExperience;
[AutocompleteType.AwardIssuer]: UserAwardExperience;
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The mapping for AwardIssuer points to UserAwardExperience but queries the 'issuer' field which is a string property, not a company entity. This is inconsistent with other issuer types like CertificationIssuer which correctly map to Company entity.

Suggested change
[AutocompleteType.AwardIssuer]: UserAwardExperience;
[AutocompleteType.AwardIssuer]: Company;

Copilot uses AI. Check for mistakes.
default: ExperienceStatus.Draft,
})
status: ExperienceStatus;

Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The flags field lacks documentation explaining its purpose, expected structure, or usage patterns. Given its generic type, documentation would help developers understand what kind of flags can be stored.

Suggested change
/**
* A JSON object to store additional metadata or flags related to the user experience.
*
* This field is flexible and can store various key-value pairs. Examples of possible keys:
* - "isFeatured": A boolean indicating if the experience is featured.
* - "priority": A number representing the priority level of the experience.
* - "tags": An array of strings for categorization or tagging.
*
* Developers should ensure that the keys and values stored in this field are consistent
* with the application's requirements and properly validated before use.
*/

Copilot uses AI. Check for mistakes.
@dailydotdev dailydotdev deleted a comment from Copilot AI Jul 30, 2025
Copy link
Contributor

@capJavert capJavert left a comment

Choose a reason for hiding this comment

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

Should be good to go once comments are addressed 👌

queryRunner.manager
.getRepository(entity)
.createQueryBuilder('entity')
.select(select ?? ['id', propertyName])
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

query,
limit,
hits: hits.map((hit) => ({
__typename: typeNameByEntity[entity.name],
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need __typename?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added one endpoint for Company, UserSkill and UserExperience.
GQL requires to add the typename in order to understand what I'm returning, I don't know how to avoid it (also linked to #2944 (comment) )

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm this is weird, lets take a look tomorrow, I don't think we do this anywhere (at least not manually like this), I see __typename in some old parts of code but just on types not actual returns.

@ilasw ilasw requested a review from capJavert July 30, 2025 15:54
@ilasw ilasw merged commit 0913cef into main Aug 1, 2025
9 checks passed
@ilasw ilasw deleted the MI-953-profile-interim branch August 1, 2025 12: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.

3 participants