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

MF-859 - Channels metadata search #867

Merged
merged 40 commits into from
Oct 1, 2019
Merged

Conversation

mteodor
Copy link
Contributor

@mteodor mteodor commented Sep 19, 2019

What does this do?

add retrieve channels my metadata criteria

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

Put here Resolves #XXX to auto-close the issue that your PR fixes (if such)
Resolves #859

List any changes that modify/break current functionality

Have you included tests for your changes?

Did you document any new/modified functionality?

Notes

scripts/run.sh Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Sep 25, 2019

Codecov Report

Merging #867 into master will increase coverage by 0.07%.
The diff coverage is 83.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #867      +/-   ##
==========================================
+ Coverage    84.7%   84.77%   +0.07%     
==========================================
  Files          72       72              
  Lines        4811     4834      +23     
==========================================
+ Hits         4075     4098      +23     
- Misses        496      497       +1     
+ Partials      240      239       -1
Impacted Files Coverage Δ
things/redis/streams.go 90.47% <100%> (ø) ⬆️
things/postgres/init.go 93.44% <100%> (+0.85%) ⬆️
things/api/things/http/endpoint.go 98.23% <100%> (ø) ⬆️
things/service.go 88.02% <100%> (ø) ⬆️
things/postgres/channels.go 82.2% <80%> (+1.64%) ⬆️
things/postgres/things.go 80.88% <81.81%> (-0.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92a640f...57b2547. Read the comment docs.

scripts/run.sh Outdated Show resolved Hide resolved
scripts/run.sh Outdated Show resolved Hide resolved
scripts/run.sh Outdated Show resolved Hide resolved
@chombium
Copy link
Collaborator

@drasko 10 seconds is the maximum time which we wait until natsd is started. It's a timeout when we give up.
It is checked if a connection can be made on the port 4222 and if that's not possible, the script sleeps for half a second and tries again. In a case where natsd starts before the timeout is fired(within 10 seconds), the maximum extra time which the user waits is half a second.

@drasko
Copy link
Contributor

drasko commented Sep 25, 2019

@chombium I know, but I think there is no need to wait 10 seconds. If NATS does not start in 3-5 sec - there is probably something wrong beyond repair, better break out.

I can accept this, but never the less I think it is not needed...

things/postgres/channels.go Outdated Show resolved Hide resolved
things/postgres/channels.go Outdated Show resolved Hide resolved
@chombium
Copy link
Collaborator

@drasko I agree with you. If we are sure that 3-5 seconds are enough than we can lower the timeout

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
users/api/http/requests.go Outdated Show resolved Hide resolved
@mteodor
Copy link
Contributor Author

mteodor commented Sep 28, 2019

I think yes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
manuio
manuio previously approved these changes Sep 30, 2019
Copy link
Contributor

@manuio manuio left a comment

Choose a reason for hiding this comment

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

LGTM

drasko
drasko previously approved these changes Sep 30, 2019
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

b, ok := value.([]byte)
if !ok {
m = &dbMetadata{}
return users.ErrScanMetadata
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why users.ErrScanMetadata?

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
@mteodor mteodor dismissed stale reviews from drasko and manuio via df2f878 September 30, 2019 16:46
things/things.go Show resolved Hide resolved
things/postgres/channels.go Outdated Show resolved Hide resolved
things/postgres/channels.go Outdated Show resolved Hide resolved
users/users.go Outdated Show resolved Hide resolved
things/postgres/channels.go Outdated Show resolved Hide resolved
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Copy link
Contributor

@anovakovic01 anovakovic01 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@drasko drasko merged commit ecc15b6 into absmach:master Oct 1, 2019
manuio pushed a commit that referenced this pull request Oct 12, 2020
* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* run.sh

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pause

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retype from string to []byte

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add wait logic for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix waiting for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix waiting for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix waiting for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* changes to wait gnatsd logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* changes to wait gnatsd logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* testing query

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix query

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix query

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* Update requests.go

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* Delete pwdrecovery.go

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small change in comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused struct

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@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.

7 participants