Skip to content

Conversation

@bhalsey
Copy link
Contributor

@bhalsey bhalsey commented Apr 18, 2025

Issue:

Problem:

Every time we touch domain objects, the go and typescript clients get generated in a different order. This makes it impossible to determine what changed in client PRs. Furthermore, the order for a pegged version can vary from one developer to another.

This is a result of the domain objects getting loaded in from directory lists. The client generating freemarker then uses code like [#list domain as d] to iterate over them.

Solution:

Sort the domain objects by their "class" name (the last real name in a file like io.fusionauth.domain.Tenant.json

Linked PR:

I believe the openapi file issue was resolved in the linked Linear issue.

Reviewer Notes:

I tested this locally with an integration build by stepping through fusionauth-app commits making domain changes.

@bhalsey bhalsey requested a review from wied03 April 18, 2025 17:38

if (settings.domainDirectory.toFile().exists()) {
settings.domainDirectory.eachFile(FileType.FILES) { f ->
def domainFiles = []
Copy link
Contributor

Choose a reason for hiding this comment

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

since we may have to live w/ this library for a little bit longer, can we replicate the problem with the tests this project has, to go with the fix?

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 was afraid someone would ask for that. But yeah, it should be tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a test

@wied03
Copy link
Contributor

wied03 commented Apr 21, 2025

Also @bhalsey if you can approve #4 that should allow the GHA build to run

@bhalsey bhalsey requested a review from wied03 April 22, 2025 00:02
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