Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

fix(DataMapper): Cannot resolve metadata once route ID is changed #240

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

igarashitm
Copy link
Collaborator

Fixes: KaotoIO/kaoto#1702

Just use 32bit pseudo random instead of UUID

Copy link
Collaborator

@lordrip lordrip 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 good to me, I tried it locally and the previous ID format is preserved as well.

For completeness, this is how the new ID looks like: kaoto-datamapper-4a9490ba.

That being said, could it be possible to add a simple test checking that when using the getHexaDecimalRandomId function, we get a string with the given format? I'm not sure whether we have the real implementation during the tests though.

@lordrip
Copy link
Collaborator

lordrip commented Nov 26, 2024

Ok, I checked and it looks like we don't have the real implementation available, but we can see the existing tests and apply them to the new function, mostly to document what's the intended format.

As an example, we could add this test for the getCamelRandomId function that we were missing.

  it('should fulfill the format', () => {
    expect(getCamelRandomId('route')).toMatch(/route-\d{4}/);
  });

@igarashitm igarashitm merged commit d8e252b into kaoto-archive:main Nov 26, 2024
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.

Route not displayed when coming back from datamapper after route renamed
2 participants