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

[#889] Optimize cases listview #336

Merged
merged 4 commits into from
Nov 21, 2022

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Nov 18, 2022

Further optimization can be done when we solve the problem with parallel requests in tests.

  • Only required case types are fetched (we were retrieving all of them)
  • Cache is used for case types, status types and current statuses

@vaszig vaszig marked this pull request as draft November 18, 2022 08:11
@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2022

Codecov Report

Merging #336 (9efb177) into develop (d5c38f5) will increase coverage by 0.01%.
The diff coverage is 94.91%.

@@             Coverage Diff             @@
##           develop     #336      +/-   ##
===========================================
+ Coverage    96.41%   96.43%   +0.01%     
===========================================
  Files          433      433              
  Lines        13131    13278     +147     
===========================================
+ Hits         12660    12804     +144     
- Misses         471      474       +3     
Impacted Files Coverage Δ
src/open_inwoner/openzaak/cases.py 67.85% <53.84%> (-4.53%) ⬇️
src/open_inwoner/openzaak/utils.py 92.59% <91.17%> (-2.41%) ⬇️
src/open_inwoner/accounts/views/cases.py 99.30% <100.00%> (+0.04%) ⬆️
src/open_inwoner/openzaak/catalog.py 61.81% <100.00%> (+4.24%) ⬆️
src/open_inwoner/openzaak/tests/test_cases.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@vaszig vaszig marked this pull request as ready for review November 18, 2022 09:03
@vaszig vaszig force-pushed the task-889-optimize-zaaktypes-cases-listview branch from 26dd5fc to 56b2b2b Compare November 18, 2022 14:26
@Bartvaderkin
Copy link
Contributor

Nice cache function with the custom key.

One generic feedback I have left is maybe we should move the cached cases retrieval code in a function or a method because it is growing and taking over the get_context_data() method a bit.

@vaszig
Copy link
Contributor Author

vaszig commented Nov 21, 2022

As discussed during our meeting I am going to update the code according to Bart's comments and I will add some explanation to the cache decorator as well. So, I am sorry Anna but I will need some more time before being able to merge this!

src/open_inwoner/accounts/views/cases.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/cases.py Show resolved Hide resolved
src/open_inwoner/openzaak/catalog.py Outdated Show resolved Hide resolved
@vaszig vaszig force-pushed the task-889-optimize-zaaktypes-cases-listview branch from 302efb8 to 9efb177 Compare November 21, 2022 12:24
@vaszig vaszig requested a review from annashamray November 21, 2022 12:39
Copy link
Contributor

@annashamray annashamray left a comment

Choose a reason for hiding this comment

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

Looks nice and neat!

@alextreme
Copy link
Member

🙈

@alextreme alextreme merged commit 746c54d into develop Nov 21, 2022
@alextreme alextreme deleted the task-889-optimize-zaaktypes-cases-listview branch November 21, 2022 15:15
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.

5 participants