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

SMQ-2706 - Add domain route to message topic #2765

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

felixgateru
Copy link
Contributor

@felixgateru felixgateru commented Mar 20, 2025

What type of PR is this?

This is a feature because it adds domain route to message topic.

What does this do?

  • Adds domain route to message topic.
  • Updates tests for the above change
  • Adds check for domain status on channel authorization.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, tests have been updated.

Did you document any new/modified feature?

Yes, in code documentation has been updated.

Notes

None

@felixgateru felixgateru requested a review from a team as a code owner March 20, 2025 07:59
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 44.24779% with 189 lines in your changes missing coverage. Please review.

Project coverage is 30.56%. Comparing base (a1e4b51) to head (ff19935).

Files with missing lines Patch % Lines
domains/mocks/domains_client.go 0.00% 46 Missing ⚠️
domains/private/mocks/service.go 0.00% 34 Missing ⚠️
coap/adapter.go 0.00% 27 Missing ⚠️
ws/handler.go 0.00% 14 Missing ⚠️
channels/private/service.go 0.00% 10 Missing ⚠️
pkg/sdk/mocks/sdk.go 0.00% 9 Missing ⚠️
coap/api/logging.go 0.00% 7 Missing ⚠️
coap/tracing/adapter.go 0.00% 7 Missing ⚠️
domains/private/service.go 0.00% 6 Missing ⚠️
pkg/messaging/message.pb.go 0.00% 5 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2765      +/-   ##
==========================================
+ Coverage   27.54%   30.56%   +3.02%     
==========================================
  Files         351      207     -144     
  Lines       55347    37371   -17976     
==========================================
- Hits        15243    11424    -3819     
+ Misses      39346    25328   -14018     
+ Partials      758      619     -139     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

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

All looks good, except i have one comment which need testing, I will create issue for this comment

Comment on lines 42 to 47
d, err := svc.domains.RetrieveEntity(ctx, req.DomainID)
if err != nil {
return errors.Wrap(svcerr.ErrAuthorization, err)
}
if d.Status != dom.EnabledStatus {
return errors.Wrap(svcerr.ErrAuthorization, errDisabledDomain)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If req.ClientType is policies.UserType, then we might need to check user is present in domain or not.
I'm not sure about this , but i need to test this case.
Steps to replicate :

  • We need to add member to domain role
  • Add access to channel
  • Remove member from domain role
  • then test reading value of message via reader.

On removal of member from domain role and if member is not removed from other entities and removed only from domains, then even after removal of member will still have access to channels.

User removal PR will solve this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have created ticket here #2767

arvindh123
arvindh123 previously approved these changes Mar 20, 2025
@felixgateru felixgateru force-pushed the smq2706-domain branch 2 times, most recently from 81565c6 to 45d192d Compare March 26, 2025 11:40
@felixgateru felixgateru force-pushed the smq2706-domain branch 3 times, most recently from a5d6ec4 to 4160a8f Compare April 7, 2025 04:44
@felixgateru felixgateru changed the title SMQ-2706 - Add domain id to message topic SMQ-2706 - Add domain route to message topic Apr 7, 2025
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
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.

Add Domain ID to message topic
2 participants