Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

skill & skillsProvider removal #126

Open
wants to merge 5 commits into
base: feature/removing_skill_model
Choose a base branch
from

Conversation

Sande3p
Copy link

@Sande3p Sande3p commented Oct 5, 2021

No description provided.

@vikasrohit
Copy link

@Sande3p I don't see any unit test updated in change files in response to the code updated? Do the unit tests not exist for the various files we modified e.g. userSkillService etc.
Another thing is that how did the reviewers verified this submission? I mean did they ran all endpoints to verify how it was working before and after the changes?

Also adding @maxceem and @nkumar-topcoder for more thorough reviews.

@vikasrohit
Copy link

@SathyaJayabal @drasticdpk @lakshmiathreya this PR might cause some disruption in taas application as taas-apis are using ubahn-apis. So, it would be great if we can identify the possible areas which could be impacted after this merge. My major expectation is the skill search where organizationId is provided as filter. Do we have any real world use case where we are using organizationId as filter for skills?

Copy link

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

It looks for me that the way migrations are changed would not work for DEV/PROD image. When we run migrations during local setup, the DB is created from scratch and then migrations are applied to the empty DB.

But in real DEV/PRDO environment we already have DB with data and these migrations has been already applied. So when we would run npm run migrations up nothing would happen.

Instead of editing existent migration files, a new migration file suppose to be created and that migration file should make all the changes in the DB, so when we run npm run migrations up on DEV / PROD it would adjust existent DB according to new changes while keeping the existent data.

@vikasrohit
Copy link

vikasrohit commented Oct 7, 2021

It looks for me that the way migrations are changed would not work for DEV/PROD

Totally agreed with @maxceem. @Sande3p please get it fixed as @maxceem outlined.

@Sande3p
Copy link
Author

Sande3p commented Oct 8, 2021

It looks for me that the way migrations are changed would not work for DEV/PROD

Totally agreed with @maxceem. @Sande3p please get it fixed as @maxceem outlined.

sure

@Sande3p
Copy link
Author

Sande3p commented Oct 8, 2021

at how did the reviewers verified this submissio

Yes, that's what I mentioned the challenge spec.

@Sande3p
Copy link
Author

Sande3p commented Oct 8, 2021

Two things are in progress

  1. Updating the migration script.
  2. Updating the unit tests

@vikasrohit
Copy link

@Sande3p are review changes implemented?


return results.hits.hits.map(hit => hit._source)
}

async function setUserSearchClausesToEsQuery (boolClause, keyword) {

Choose a reason for hiding this comment

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

@Sande3p I don't see any update in the code where setUserSearchClausesToEsQuery is used. I mean if we have removed searching skills in this method's implementation, we must be doing that where this function is being called, right? Am I missing something here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, I don't think we need to do anything in searchUsers, the keyword be used to match user records. since we remove skill model, we just remove the matching skill name and reserve other matchings.

Choose a reason for hiding this comment

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

What I meant is searchUsers method would not support searching by skills name now, if we don't add some other way to provide filtering for user based on skills names. I want to be sure that we are not removing any feature from the calling code. We need to remove skills model but we should not remove any feature from the calling code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed


module.exports = {
up: async (query) => {
await query.removeColumn('UsersSkills', 'skillId')

Choose a reason for hiding this comment

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

@Sande3p this would cause all the existing data to be lost, I guess. How can we handle that?

Choose a reason for hiding this comment

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

@maxceem do you have idea how can handle this without loosing data?

Copy link

@maxceem maxceem Oct 12, 2021

Choose a reason for hiding this comment

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

Good catch @vikasrohit. I don't think these columns should be removed as we this script adds them back after removing which looks like doesn't make sense. I guess these columns should be left as it is without any changes. The only thing which has to be changed - references from other tables to these columns have to be removed and that's it.

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

Choose a reason for hiding this comment

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

@xxcxy @Sande3p any of you verified the migration script for preventing data loss on your local? I want to make sure before I run it on dev.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it will drop table Skills and SkillsProviders.
If you mean preventing other table's data loss, then yes, i tried.

Choose a reason for hiding this comment

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

If you mean preventing other table's data loss, then yes, i tried.

Yes, that is what I was worried about. If the data is not lost in any tables excepts the two we want to get rid of.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants