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/nats improvements #171

Merged
merged 17 commits into from
May 8, 2024
Merged

Feat/nats improvements #171

merged 17 commits into from
May 8, 2024

Conversation

lfbrehm
Copy link
Member

@lfbrehm lfbrehm commented May 7, 2024

Summary

Adds missing event messages for server to server sync, additional bug fixes and improvements.

Changes

  • Additional server only events for updating cached rules
  • Missing emission of data proxy events in user_db_handler, workspace_db_handler and service_accounts_db_handler
  • Fixed hook status in hook_handler
  • Waiting for acknowledgement of specific proxies in workspace_db_handler and hooks_handler
  • A lot of clippy suggestions

@lfbrehm lfbrehm requested review from das-Abroxas and St4NNi May 7, 2024 10:53
Copy link

codecov bot commented May 7, 2024

Codecov Report

Attention: Patch coverage is 18.84615% with 422 lines in your changes are missing coverage. Please review.

Project coverage is 31.08%. Comparing base (7861bc2) to head (165955a).
Report is 60 commits behind head on main.

❗ Current head 165955a differs from pull request most recent head f2704f5. Consider uploading reports for the commit f2704f5 to get more accurate results

Files Patch % Lines
...ts/server/src/middlelayer/presigned_url_handler.rs 0.00% 73 Missing ⚠️
...nents/data_proxy/src/caching/grpc_query_handler.rs 0.00% 67 Missing ⚠️
...onents/server/src/caching/notifications_handler.rs 0.00% 40 Missing ⚠️
components/server/src/hooks/hook_handler.rs 0.00% 35 Missing ⚠️
...ver/src/middlelayer/service_accounts_db_handler.rs 0.00% 34 Missing ⚠️
...mponents/server/src/notification/natsio_handler.rs 47.36% 20 Missing ⚠️
...omponents/data_proxy/src/grpc_api/proxy_service.rs 0.00% 19 Missing ⚠️
components/data_proxy/src/database/persistence.rs 0.00% 16 Missing ⚠️
components/data_proxy/src/structs.rs 0.00% 13 Missing ⚠️
components/server/src/database/dsls/rule_dsl.rs 7.14% 13 Missing ⚠️
... and 22 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   30.72%   31.08%   +0.35%     
==========================================
  Files         127      127              
  Lines       24139    23854     -285     
==========================================
- Hits         7416     7414       -2     
+ Misses      16723    16440     -283     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lfbrehm
Copy link
Member Author

lfbrehm commented May 7, 2024

I tried to address the failing tests situation. Object::batch_create was the culprit, but I do not know why. Maybe this is related to this issue

das-Abroxas
das-Abroxas previously approved these changes May 8, 2024
Copy link
Contributor

@das-Abroxas das-Abroxas left a comment

Choose a reason for hiding this comment

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

Still a little too much input for a proper review but I haven't seen anything that is obviously broken.

But it's great that you've also fixed the problem with the “randomly” failing tests 🙌

@lfbrehm
Copy link
Member Author

lfbrehm commented May 8, 2024

I refactored the slightly ugly solution to skip the inner loops in Object::batch_create and InternalRelation::batch_create, as suggested by @St4NNi. I'm not quite happy with removing the COPY FROM queries, because they are suggested by the tokio_postgres maintainer as a performance optimized solution.
In the long run, this should be debugged, replacing this temporary solution.

Copy link
Member

@St4NNi St4NNi left a comment

Choose a reason for hiding this comment

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

Agree with @das-Abroxas too much to properly review. We should include refactoring only changes to separate PRs in the future.

Otherwise im fine with that. LGTM!

@lfbrehm lfbrehm merged commit 91f0293 into main May 8, 2024
5 checks passed
@lfbrehm lfbrehm deleted the feat/nats_improvements branch May 8, 2024 09:50
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