-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(new-primary-school): Add mms frigg api scopes to clients api #17267
Conversation
WalkthroughThe pull request introduces a new seeder file in the authentication API library that adds specific scopes to a client. The file defines an Changes
Sequence DiagramsequenceDiagram
participant Seeder
participant AuthSystem
participant Client
Seeder->>AuthSystem: addScopesToClient()
AuthSystem->>Client: Assign '@mms.is/frigg' scope
AuthSystem-->>Seeder: Scope assignment complete
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17267 +/- ##
==========================================
- Coverage 35.73% 35.72% -0.01%
==========================================
Files 6941 6939 -2
Lines 148407 148374 -33
Branches 42340 42331 -9
==========================================
- Hits 53037 53011 -26
+ Misses 95370 95363 -7 Flags with carried forward coverage won't be shown. Click here to find out more. see 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
libs/auth-api-lib/seeders/data/add-mms-frigg-api-scopes-to-clients-api.ts (1)
3-8
: Consider adding a down/rollback functionAs this is a database seeder, it's recommended to include a
down
function to remove these scopes if needed. This ensures the changes are reversible.export const up = compose( addScopesToClient({ clientId: '@island.is/clients/api', scopeNames: ['@mms.is/frigg'], }), ) + export const down = compose( + addScopesToClient({ + clientId: '@island.is/clients/api', + scopeNames: ['@mms.is/frigg'], + remove: true, + }), + )
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
libs/auth-api-lib/seeders/data/add-mms-frigg-api-scopes-to-clients-api.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
libs/auth-api-lib/seeders/data/add-mms-frigg-api-scopes-to-clients-api.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (1)
libs/auth-api-lib/seeders/data/add-mms-frigg-api-scopes-to-clients-api.ts (1)
1-1
: Verify helper functions existence and implementation
The code imports helper functions from a relative path. Let's verify these exist and understand their implementation.
✅ Verification successful
Based on the search results, I can see that both helper functions addScopesToClient
and compose
exist and are properly implemented in the codebase:
compose
is defined inlibs/auth-api-lib/seeders/data/helpers/compose.ts
addScopesToClient
is defined inlibs/auth-api-lib/seeders/data/helpers/addScopesToClient.ts
- Both are exported through the index file at
libs/auth-api-lib/seeders/data/helpers/index.ts
The implementation follows the same pattern as other seeder files in the codebase that add scopes to clients. The helper functions are actively used across multiple seeder files with the same pattern.
Helper functions exist and are properly implemented
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify helper functions existence and implementation
# Look for helper functions in nearby files
rg -A 10 "export.*(?:addScopesToClient|compose)" ./libs/auth-api-lib/seeders/data/
Length of output: 32145
libs/auth-api-lib/seeders/data/add-mms-frigg-api-scopes-to-clients-api.ts
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 31 Total Test Services: 0 Failed, 28 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (2) |
...
Attach a link to issue if relevant
What
Specify what you're trying to achieve
Why
Specify why you need to achieve this
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit