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

Feature/profiles #4287

Open
wants to merge 25 commits into
base: devel
Choose a base branch
from
Open

Feature/profiles #4287

wants to merge 25 commits into from

Conversation

msmannan00
Copy link
Member

@msmannan00 msmannan00 commented Oct 31, 2024

feature profile and config optimization

msmannan00 and others added 12 commits August 24, 2024 17:37
1. Integrated profiles.
2. Created a default profile for tenant 1000000, applied in both config and config_lang.
3. Implemented migration scripts.
4. Removed duplicate variables from config and config_lang, mapping them to the default profile.
5. Implemented chaining for tenants to first search for variables in their profile, and if not found, default to the default profile.
@msmannan00 msmannan00 requested a review from a team as a code owner October 31, 2024 15:09
Copy link

codacy-production bot commented Oct 31, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for d68389d1 83.65% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d68389d) Report Missing Report Missing Report Missing
Head commit (e9972c8) 19811 16549 83.53%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4287) 838 701 83.65%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@evilaliv3 evilaliv3 force-pushed the devel branch 8 times, most recently from 6dd774b to c58a7f5 Compare November 18, 2024 19:24
@evilaliv3 evilaliv3 force-pushed the devel branch 7 times, most recently from 3f8f509 to 0b3dfc0 Compare December 11, 2024 13:17
- Updated database schema to include support for users and user profiles.
- Implemented a new profile interface in the client for better user management.
- Updated logic to ensure users inherit all relevant information directly from profiles.
- Added default tenant creation during user or profile initialization.
- Refactored backend to transition user logic to a combined user and profile model, using self-joins for hierarchical relationships.
- Fixed and optimized frontend test cases related to user functionality to ensure consistent behavior.
@evilaliv3 evilaliv3 force-pushed the devel branch 2 times, most recently from 151ae61 to 57e664c Compare December 18, 2024 10:40
@evilaliv3 evilaliv3 force-pushed the devel branch 2 times, most recently from d6cea5d to 4373b5a Compare January 18, 2025 15:53
- Separated User and Profile functionality for better modularity.
- Fixed backend tests.
- Resolved migration issues.
- Set default language during wizard creation.
- Shifted PGP handling from UserProfile to User.
1. Implemented user profile migration
2. tenant cache bug fix
3. backend test case indexing fixes for receiver
@evilaliv3
Copy link
Member

evilaliv3 commented Jan 18, 2025

@msmannan00: i performed a first run of tests and all seems in very perfect shape.

I took care of merging the the devel branch into this and solving the conflicts:

At the moment i notice the following just the following defects that we could ameliorate

  • config.'version', 'last_version', 'db_version' appear at the moment present in both tenant 1 and profile 1000001; i wonder if to keep this or to find ways of having these only either in tenant 1 or profile 100001. The same could be said for example in relation to variables like profile_counter that is present both in tenant1 and profile 1000001 but actually this second variable appears not used.
  • config.onion and config.tor_onion_key appear at the moment present also on profiles: maybe these variables should be present only on tenants? i see in fact that at the moment we are also instantiating an onion service for the tenants profiles.

I will continue looking into this next week.

@msmannan00
Copy link
Member Author

Yes, you are right about that, it should only be on tenant I guess I missed it from my side

@evilaliv3
Copy link
Member

@msmannan00 , apparently this tests seems to fail once every two runs: globaleaks.tests.handlers.recipient.test_rtip.TestRTipInstance.test_delete

globaleaks.tests.handlers.recipient.test_rtip
  TestRTipInstance
    test_delete ...                                                     [ERROR]

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/evilaliv3/Development/whistleblowing-software/backend/env/lib/python3.12/site-packages/twisted/internet/defer.py", line 1656, in _inlineCallbacks
    result = current_context.run(
  File "/home/evilaliv3/Development/whistleblowing-software/backend/env/lib/python3.12/site-packages/twisted/python/failure.py", line 514, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/evilaliv3/Development/whistleblowing-software/backend/globaleaks/tests/handlers/recipient/test_rtip.py", line 289, in test_delete
    yield handler.delete(rtip_descs[0]['id'])
  File "/home/evilaliv3/Development/whistleblowing-software/backend/globaleaks/tests/helpers.py", line 128, in callInThreadWithCallback
    result = func(*args, **kw)
  File "/home/evilaliv3/Development/whistleblowing-software/backend/globaleaks/orm.py", line 185, in _wrap
    result = function(session, *args, **kwargs)
  File "/home/evilaliv3/Development/whistleblowing-software/backend/globaleaks/handlers/recipient/rtip.py", line 795, in delete_rtip
    raise errors.ForbiddenOperation
globaleaks.rest.errors.ForbiddenOperation: ForbiddenOperation: <<Operation Forbidden>> (8) HTTP:403

globaleaks.tests.handlers.recipient.test_rtip.TestRTipInstance.test_delete

The failure seems related to the user profile permission: profile.can_delete_submission

@msmannan00
Copy link
Member Author

msmannan00 commented Jan 20, 2025

let me check it out, the issue was there but fixed it last week, most probably was skipped in commits will review it out asap

@msmannan00
Copy link
Member Author

@evilaliv3 test is fixed, most probably it wont fail again, good to see branch is already on latest codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants