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

User preferences support #1317

Merged
merged 1 commit into from
Apr 24, 2023
Merged

Conversation

laurentiuNiculae
Copy link
Contributor

@laurentiuNiculae laurentiuNiculae commented Mar 29, 2023

What type of PR is this?

Which issue does this PR fix:
Closes #592
Closes #662
Closes #746

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@laurentiuNiculae laurentiuNiculae force-pushed the userdb-support branch 5 times, most recently from 9fbf9b9 to 6bdf70b Compare March 30, 2023 08:43
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #1317 (de78ebc) into main (ef51fd6) will increase coverage by 0.13%.
The diff coverage is 92.32%.

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

@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
+ Coverage   90.52%   90.66%   +0.13%     
==========================================
  Files          98      100       +2     
  Lines       21480    22217     +737     
==========================================
+ Hits        19445    20143     +698     
- Misses       1521     1544      +23     
- Partials      514      530      +16     
Impacted Files Coverage Δ
pkg/meta/dynamo/parameters.go 80.00% <ø> (ø)
pkg/extensions/extension_user_preferences.go 83.60% <83.60%> (ø)
pkg/meta/repodb/boltdb-wrapper/boltdb_wrapper.go 88.68% <89.83%> (-0.81%) ⬇️
pkg/meta/repodb/dynamodb-wrapper/dynamo_wrapper.go 93.30% <93.05%> (+0.21%) ⬆️
pkg/api/authz.go 95.83% <100.00%> (ø)
pkg/api/routes.go 94.48% <100.00%> (+<0.01%) ⬆️
pkg/common/common.go 93.14% <100.00%> (+0.59%) ⬆️
.../extensions/extension_user_preferences_disabled.go 100.00% <100.00%> (ø)
pkg/extensions/search/convert/repodb.go 97.59% <100.00%> (+<0.01%) ⬆️
pkg/extensions/search/resolver.go 99.15% <100.00%> (+2.75%) ⬆️
... and 7 more

... and 1 file with indirect coverage changes

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

@laurentiuNiculae laurentiuNiculae force-pushed the userdb-support branch 10 times, most recently from d1a5411 to 1c7eeaf Compare April 5, 2023 08:11
@laurentiuNiculae laurentiuNiculae marked this pull request as ready for review April 5, 2023 12:31
test/blackbox/metadata.bats Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
pkg/extensions/extension_user_preferences.go Outdated Show resolved Hide resolved
pkg/extensions/search/common/common_test.go Outdated Show resolved Hide resolved
pkg/extensions/search/common/common_test.go Outdated Show resolved Hide resolved
pkg/meta/common/common.go Outdated Show resolved Hide resolved
pkg/meta/common/common.go Outdated Show resolved Hide resolved
pkg/meta/repodb/repodb_test.go Outdated Show resolved Hide resolved
pkg/extensions/search/resolver.go Outdated Show resolved Hide resolved
pkg/extensions/search/resolver.go Outdated Show resolved Hide resolved
@laurentiuNiculae laurentiuNiculae force-pushed the userdb-support branch 3 times, most recently from d937585 to 82aa1ff Compare April 10, 2023 13:50
andaaron
andaaron previously approved these changes Apr 19, 2023
@andaaron andaaron changed the title Userdb support User preferences support Apr 19, 2023
@laurentiuNiculae laurentiuNiculae force-pushed the userdb-support branch 2 times, most recently from de78ebc to c130160 Compare April 20, 2023 10:03
andaaron
andaaron previously approved these changes Apr 20, 2023
pkg/api/authz.go Outdated Show resolved Hide resolved
pkg/api/authz.go Outdated Show resolved Hide resolved
pkg/api/authz.go Outdated Show resolved Hide resolved
pkg/api/constants/extensions.go Show resolved Hide resolved
Copy link
Contributor

@andaaron andaaron left a comment

Choose a reason for hiding this comment

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

Please fix my last comment, and the linter.
Otherwise it looks good from my side.

pkg/api/authz.go Outdated Show resolved Hide resolved
Initial code was contributed by Bogdan BIVOLARU <104334+bogdanbiv@users.noreply.github.com>
Moved implementation from a separate db to repodb by Andrei Aaron <aaaron@luxoft.com>

Not done yet:
- run/test dynamodb implementation, only boltdb was tested
- add additional coverage for existing functionality
- add web-based APIs to toggle the stars/bookmarks on/off

Initially graphql mutation was discussed for the missing API but
we decided REST endpoints would be better suited for configuration

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

feat(userdb): complete functionality for userdb integration

- dynamodb rollback changes to user starred repos in case increasing the total star count fails
- dynamodb increment/decrement repostars in repometa when user stars/unstars a repo
- dynamodb check anonymous user permissions are working as intendend
- common test handle anonymous users
- RepoMeta2RepoSummary set IsStarred and IsBookmarked

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

feat(userdb): rest api calls for toggling stars/bookmarks on/off

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

test(userdb): blackbox tests

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

test(userdb): move preferences tests in a different file with specific build tags

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

feat(repodb): add is-starred and is-bookmarked fields to repo-meta

- removed duplicated logic for determining if a repo is starred/bookmarked

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
Copy link
Contributor

@andaaron andaaron 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

@rchincha rchincha left a comment

Choose a reason for hiding this comment

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

lgtm

@rchincha rchincha merged commit 9cc990d into project-zot:main Apr 24, 2023
25 checks passed
@laurentiuNiculae laurentiuNiculae deleted the userdb-support branch May 2, 2023 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants