Skip to content
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

Feat migrate from storyblok id to storyblok UUID #786

Conversation

strawHat121
Copy link
Contributor

Resolves #781

What changes did you make and why did you make them?

  • Removed all occurences of storyblokId and replaced it with storyblokUuid
  • Updated the unit test cases.

Did you run tests? Share screenshot of results:

Screenshot 2025-02-25 at 5 32 40 PM

How did you find us? (GitHub, Google search, social media, etc.):

Github

@strawHat121
Copy link
Contributor Author

Hi @kyleecodes

So I tried my best to make all the changes and I think I have covered them all here. I also updated the test cases wherever it was required.

Since this required making changes in test cases also, I am not sure about whatever I have done is correct or not. So if possible can you please take a look at my PR?

if it looks ok, then I will start making changes in the frontend repo and will run the full unit tests as well as e2e tests there using playwright.

@kyleecodes kyleecodes self-assigned this Mar 1, 2025
@ApiProperty({ type: Number })
story_id: number;
@ApiProperty({ type: String })
story_uuid: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in contact with Storyblok support because I checked the webhook and realised they only send story_id at the moment. I'm wondering whether its a config change on our side or whether they just haven't migrated their webhook functionality to use storyblokUuid yet! Will keep you posted.

@eleanorreem
Copy link
Contributor

Hey thanks for this! After an initial look, most of it looks great. I realised that I hadn't checked the changes in the webhook to see what storyblok was sending instead of story_id. It seems like they haven't changed to sending the uuid ryet in the body of the webhook. I am going to follow up with support and let you know what they say and then I'll finish my review after I get the answer from them. Hope thats okay!

@eleanorreem
Copy link
Contributor

Just had a message back from storyblok:
Screenshot 2025-03-14 at 14 27 45
My suggestion would be keep the webhook as it was and we can migrate the webhook to just using the uuid at a later date. Apologies for that!

@strawHat121
Copy link
Contributor Author

Thanks for the review.

I'll update this PR to revert the webhook to use the story_id in sometime.

@strawHat121
Copy link
Contributor Author

strawHat121 commented Mar 15, 2025

Hi @eleanorreem , I have a doubt regarding keeping the storyblokId in the webhook.

From my understanding, what I can see is that in the functionhandleStoryUpdated in the webhook.service.ts file, we won't have access to the uuid.

So whatever actions we are performing in that file, we need to use storyblokId instead of storyblokUuid.

But in the functions in that service, we make calls to sessionRepository, courseRepository etc. where I replaced storyblokId with storyblokUuid in their entities. So should I keep both uuid and id those entities or just keep storyblokId as of now?

@eleanorreem
Copy link
Contributor

eleanorreem commented Mar 17, 2025

Hi @strawHat121 I wasn't clear apologies. I agree with you. Keep both for now in the webhook and use storyblokUuid elsewhere! And then when they fully migrate away from the legacy storyblokId, we can remove it from our code base.

@strawHat121
Copy link
Contributor Author

Hi @eleanorreem

I have reverted the changes in the webhook service and I have kept both storyblokId and storyblokUuid in the entities that are being called in webhook.

I have made changes in the tests as well.

But few tests are failing (and these are also failing in develop) because the ISbStoryData that is used to define the type of data in updateOrCreateStoryData doesn't contain any id field. Seems like the interface that they provide doesn't have any id field in it which seems weird. But I am not sure what to do about that.

Apart from this I tried my best to make the changes.

Let me know if any more changes are required.

@eleanorreem eleanorreem merged commit 88f862f into chaynHQ:develop Mar 20, 2025
1 check passed
@eleanorreem
Copy link
Contributor

Thanks @strawHat121 all merged ⭐

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.

Migrate backend code to use storyblokUuid
3 participants