Skip to content

Migrate org groups (hr_group -> admin_group, primary_group -> member_group) - #1275

Open
simensandhaug wants to merge 24 commits into
mainfrom
feat/migrate-org-group
Open

Migrate org groups (hr_group -> admin_group, primary_group -> member_group)#1275
simensandhaug wants to merge 24 commits into
mainfrom
feat/migrate-org-group

Conversation

@simensandhaug

@simensandhaug simensandhaug commented Nov 14, 2022

Copy link
Copy Markdown
Contributor

Changes

  • Change DB fields for hr_group and primary_group to admin_group and member_group for organizations
  • Change name and group type for all responsible groups
  • New ResponsibleGroup.name format "Organization:Type" instead of just "Type"
  • ResponsibleGroup.group_type format "Type" (e.g ADMIN or MEMBER)
  • Every ResponsibleGroup also has a pointer to a Group object that has outdated names
    • Previous : "Organization:(HR|Medlem):uuid"
    • New : "Organization:(Admin|Member):uuid"
  • These changes make it easier to navigate api.indokntnu.no/admin and the names are more descriptive
  • Change necessary instances of hr_group and primary_group

@vercel

vercel Bot commented Nov 14, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
indok-web ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 27, 2023 at 4:24PM (UTC)

@simensandhaug
simensandhaug requested review from hermannm and larwaa and removed request for larwaa November 14, 2022 18:35
larwaa
larwaa previously requested changes Nov 14, 2022

@larwaa larwaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Absolutely fantastic job with this PR. A migration such as this always introduces a lot of complexity, and I think you've handled it in an excellent manner! Have a look at the feedback on migrations which I think will make your life a bit easier, and the other comments that I hope you find useful 😊 Again, great work with this, you're really touching some of the more complex parts of the application 🏆

Comment thread backend/apps/organizations/migrations/0032_auto_20210824_1457.py Outdated
Comment thread backend/apps/organizations/migrations/0034_auto_20221114_1854.py Outdated
Comment thread backend/apps/organizations/migrations/0034_auto_20221114_1854.py Outdated
Comment thread backend/apps/organizations/signals.py Outdated
Comment thread backend/apps/organizations/models.py Outdated
@codecov

codecov Bot commented Nov 21, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.54%. Comparing base (4d8fa0d) to head (6a8a60e).
⚠️ Report is 1031 commits behind head on main.

Files with missing lines Patch % Lines
backend/apps/organizations/signals.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1275      +/-   ##
==========================================
- Coverage   81.55%   81.54%   -0.01%     
==========================================
  Files          88       88              
  Lines        3166     3165       -1     
==========================================
- Hits         2582     2581       -1     
  Misses        584      584              
Flag Coverage Δ
apitests 81.54% <94.11%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@simensandhaug
simensandhaug dismissed larwaa’s stale review December 3, 2022 22:10

fixed the requested changes

@larwaa larwaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are always a bit tricky, lots of moving parts, but I think it's more or less good to go, just a minor bug

Comment thread backend/apps/organizations/signals.py Outdated
Comment thread backend/apps/organizations/signals.py Outdated
Comment thread backend/apps/permissions/migrations/0034_auto_20221114_1854.py Outdated
Comment thread backend/apps/permissions/migrations/0034_auto_20221114_1854.py Outdated
simensandhaug and others added 2 commits February 20, 2023 18:31
remove print statement

Co-authored-by: Lars Waage <46653859+larwaa@users.noreply.github.com>
remove comment

Co-authored-by: Lars Waage <46653859+larwaa@users.noreply.github.com>
@simensandhaug

Copy link
Copy Markdown
Contributor Author

Requested changes should be fixed if i understood the problem with uuid correctly. If not im positive we can just remove the uuid from the name altogether, i cant see a reason why we would specifically need it in the name on the adminpage because it would be a field?

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

2 participants