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

make loading dropdown/list attribute schema idempotent #1658

Closed
wants to merge 1 commit into from

Conversation

ajtmccarty
Copy link
Contributor

fixes #1631

given the short timeframe for this issue (1 day), I tried to take a simple approach and skip some of the refactoring I would like to do (I'd like to add a DiffBuilder class instead of the various quite large methods currently used in the Diff class)
I think my approach of deleting nodes from the Diff that do not actually include any changes is the most likely to work and least likely to break anything of the several other options I considered. Ideally, we wouldn't add nodes to the diff that do not include changes in the first place, but I did not think I had time to refactor Diff.get_nodes and I'm not sure what the test coverage looks like.

I added the JsonEqualityChecker class hoping that I could inject it into a new DiffBuilder class before I realized that I would not have time for that, but I decided to leave the class (instead of just using the are_json_equal function) in the hopes of building that DiffBuilder class some day.

also

  • split up the core/utils.py file into a few smaller files inside of the new core/utils dir

  • unit tests

@ajtmccarty ajtmccarty added the type/bug Something isn't working as expected label Dec 19, 2023
@ajtmccarty ajtmccarty added this to the Infrahub - Alpha #3 milestone Dec 19, 2023
@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Dec 19, 2023
@ogenstad ogenstad removed this from the Infrahub - Alpha #3 milestone Dec 19, 2023
@ajtmccarty
Copy link
Contributor Author

issue fixed in #1659

@ajtmccarty ajtmccarty closed this Dec 19, 2023
@ajtmccarty ajtmccarty deleted the idempotent-dropdown-schema branch May 22, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants