Skip to content

build: update frontend dependencies (Aug 2024) #46

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

Merged
merged 14 commits into from
Oct 22, 2024
Merged

Conversation

kshitij-k-osmosys
Copy link
Contributor

@kshitij-k-osmosys kshitij-k-osmosys commented Aug 13, 2024

Portal PR Checklist

Pre-requisites

  • I have gone through the Contributing guidelines for Submitting a Pull Request (PR) and ensured that this is not a duplicate PR.
  • I have performed preliminary testing to ensure that any existing features are not impacted and any new features are working as expected.

PR Details

PR details have been updated as per the given format (see below)

  • PR title adheres to the format specified in guidelines (e.g., feat: add admin login page)
  • Description has been added
  • Related changes have been added (optional)
  • Screenshots have been added (optional)
  • Pending actions have been added (optional)
  • Any other additional notes have been added (optional)

Additional Information

  • Appropriate label(s) have been added (ready for review should be added if the PR is ready to be reviewed)
  • Assignee(s) and reviewer(s) have been added (optional)

Description:

Update portal dependencies
Check changes on local machine

Related changes:

  • Update angular to version 18.2.0: https://www.npmjs.com/package/@angular/cli?activeTab=versions
  • Return type for getSeverity function has been updated, this also fixed the issue related to latest version of primeng not being installed
  • Typescript was updated to latest version
  • Tested the portal locally - working as expected
  • There was a minor change needed in app.module to support angular v18, did that
  • Kept the no standalone structure for the repo for now, in case angular drops support for it we would need to upgrade to standalone structure

Screenshots:

image

Pending actions:

NA

Additional notes:

NA

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new method for configuring HTTP clients with interceptors, enhancing modularity and flexibility.
  • Bug Fixes

    • Upgraded Apollo Client and Azure MSAL libraries, which may include bug fixes and improvements to authentication capabilities.
    • Enhanced error handling in the GraphqlService for better clarity and consistency of error messages.
    • Improved severity categorization logic in FileProcessorComponent for better type safety.
  • Chores

    • Routine maintenance performed by updating several libraries for improved security, performance, and compatibility.

@kshitij-k-osmosys kshitij-k-osmosys self-assigned this Aug 13, 2024
Copy link
Contributor

coderabbitai bot commented Aug 13, 2024

Walkthrough

The recent updates to the Angular application focus on enhancing the structure, clarity, and type safety of the codebase. Key modifications include improved configuration files for readability, updates to dependencies for enhanced functionality, and refined HTTP client management. Additionally, changes in error handling and method return types contribute to a more robust application architecture.

Changes

Files Change Summary
apps/portal/angular.json Improved JSON structure for readability; added @angular/localize/init to polyfills.
apps/portal/package.json Updated dependencies including Apollo Client and Azure MSAL; routine maintenance on various libraries.
apps/portal/src/app/app.module.ts Removed HttpClientModule; replaced with provideHttpClient(withInterceptorsFromDi()) for improved HTTP handling.
apps/portal/src/app/graphql/graphql.module.ts Removed HttpClientModule from exports, simplifying module dependencies.
apps/portal/src/app/features/file-processor/file-processor.component.ts Changed getSeverity return type to any; updated severity mapping logic, potentially impacting type safety.
apps/portal/src/app/graphql/graphql.service.ts Improved error handling by wrapping error messages in Error objects for consistency.

Poem

🐇 In the garden of code, where changes bloom bright,
We dance with our libraries, making things right.
Dependencies flourish, and structure takes flight,
Each update a hop, bringing joy and delight.
So here's to the code, in its vibrant array,
A warren of wonders, come celebrate today! 🌼


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
Early access features: disabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. Note: Our default code review model was also updated late last week. Please compare the quality of the reviews between the two models by toggling the early access feature.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

@kshitij-k-osmosys kshitij-k-osmosys added Ready for review Ready for review dependencies Pull requests that update a dependency file labels Aug 13, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9cf74d0 and 9f258c9.

Files ignored due to path filters (1)
  • apps/portal/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (1)
  • apps/portal/package.json (1 hunks)
Additional comments not posted (13)
apps/portal/package.json (13)

26-26: Verify compatibility of @apollo/client update.

The @apollo/client library has been updated from 3.10.3 to 3.11.4. Ensure that there are no breaking changes affecting the application.

Verification successful

No breaking changes detected in @apollo/client update.

The update from 3.10.3 to 3.11.4 appears to be safe from breaking changes according to the changelog review. Ensure that the application code using @apollo/client is compatible with the new version.

  • Verify the usage of @apollo/client in the following files:
    • apps/portal/src/app/graphql/graphql.module.ts
    • apps/portal/src/app/graphql/graphql.service.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in @apollo/client update.

# Test: Search for the changelog or release notes. Expect: No breaking changes.
rg --files-with-matches --type markdown 'BREAKING CHANGES' | xargs rg 'apollo/client'

Length of output: 1113


27-27: Verify compatibility of @azure/msal-angular update.

The @azure/msal-angular library has been updated from 3.0.17 to 3.0.23. Ensure that authentication flows are unaffected.


49-49: Verify compatibility of @angular-eslint/schematics update.

The @angular-eslint/schematics library has been updated to ^18.3.0. Ensure that there are no issues with Angular schematics.


56-56: Verify compatibility of @types/jasmine update.

The @types/jasmine library has been updated to ~5.1.4. Ensure that there are no issues with Jasmine type definitions.


40-40: Verify compatibility of rxjs update.

The rxjs library has been updated from ~7.8.0 to ~7.8.1. Ensure that there are no issues with reactive programming patterns in the application.


46-46: Verify compatibility of @angular-eslint/builder update.

The @angular-eslint/builder library has been updated to ^18.3.0. Ensure that there are no issues with linting processes.


32-32: Verify compatibility of apollo-angular update.

The apollo-angular library has been updated from 7.0.1 to 7.0.2. Ensure compatibility with existing GraphQL operations.


54-54: Verify compatibility of @eslint/js update.

The @eslint/js library has been updated to ^9.9.0. Ensure that there are no issues with JavaScript linting.


62-62: Verify compatibility of eslint-plugin-prettier update.

The eslint-plugin-prettier library has been updated to ^5.2.1. Ensure that there are no issues with Prettier integration.


28-28: Verify compatibility of @azure/msal-browser update.

The @azure/msal-browser library has been updated from 3.14.0 to 3.20.0. Ensure that there are no breaking changes affecting authentication mechanisms.


64-64: Verify compatibility of jasmine-core update.

The jasmine-core library has been updated to ~5.2.0. Ensure that there are no issues with core Jasmine functionality.

Verification successful

Jasmine-core update to version 5.2.0 is compatible.

The update includes bug fixes and new features without any breaking changes. It should be safe to proceed with this version. No action is required unless specific issues arise during testing.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for changes in jasmine-core update.

# Test: Search for the changelog or release notes. Expect: No issues with core Jasmine functionality.
rg --files-with-matches --type markdown 'CHANGELOG' | xargs rg 'jasmine-core'

Length of output: 720


Script:

#!/bin/bash
# Fetch the changelog for jasmine-core from its GitHub repository
curl -s https://api.github.com/repos/jasmine/jasmine/releases | jq -r '.[] | select(.tag_name == "v5.2.0") | .body'

Length of output: 218


Script:

#!/bin/bash
# Fetch and display the release notes for jasmine-core version 5.2.0
curl -s https://raw.githubusercontent.com/jasmine/jasmine/main/release_notes/5.2.0.md

Length of output: 1182


41-41: Verify compatibility of tslib update.

The tslib library has been updated from ^2.3.0 to ^2.6.3. Ensure that there are no compatibility issues with TypeScript features.


35-35: Verify compatibility of graphql update.

The graphql library has been updated from 16.8.1 to 16.9.0. Ensure that there are no compatibility issues with existing GraphQL schemas or queries.

@kshitij-k-osmosys kshitij-k-osmosys changed the title build: update portal dependencies (Aug 2024) build: update frontend dependencies (Aug 2024) Aug 13, 2024
xixas
xixas previously approved these changes Aug 14, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9f258c9 and 185cce6.

Files ignored due to path filters (1)
  • apps/portal/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (1)
  • apps/portal/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/portal/package.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
apps/portal/src/app/app.module.ts (1)

4-4: Format the import statement.

The import statement is flagged by the linter for formatting issues. Consider formatting the imports for better readability.

- import { HttpClient, HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
+ import { 
+   HttpClient, 
+   HTTP_INTERCEPTORS, 
+   provideHttpClient, 
+   withInterceptorsFromDi 
+ } from '@angular/common/http';
Tools
GitHub Check: Lint

[failure] 4-4:
Replace ·HttpClient,·HTTP_INTERCEPTORS,·provideHttpClient,·withInterceptorsFromDi· with ⏎··HttpClient,⏎··HTTP_INTERCEPTORS,⏎··provideHttpClient,⏎··withInterceptorsFromDi,⏎

apps/portal/src/app/features/file-processor/file-processor.component.ts (1)

148-148: Format the method signature.

The method signature is flagged by the linter for formatting issues. Consider formatting it for better readability.

- getSeverity(status: number): 'success' | 'secondary' | 'info' | 'warning' | 'danger' | 'contrast' | undefined {
+ getSeverity(
+   status: number
+ ): 'success' | 'secondary' | 'info' | 'warning' | 'danger' | 'contrast' | undefined {
Tools
GitHub Check: Lint

[failure] 148-148:
Replace status:·number with ⏎····status:·number,⏎··

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 185cce6 and 282dacd.

Files ignored due to path filters (1)
  • apps/portal/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (5)
  • apps/portal/angular.json (2 hunks)
  • apps/portal/package.json (1 hunks)
  • apps/portal/src/app/app.module.ts (3 hunks)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts (1 hunks)
  • apps/portal/src/app/graphql/graphql.module.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • apps/portal/angular.json
  • apps/portal/src/app/graphql/graphql.module.ts
Files skipped from review as they are similar to previous changes (1)
  • apps/portal/package.json
Additional context used
GitHub Check: Lint
apps/portal/src/app/app.module.ts

[failure] 4-4:
Replace ·HttpClient,·HTTP_INTERCEPTORS,·provideHttpClient,·withInterceptorsFromDi· with ⏎··HttpClient,⏎··HTTP_INTERCEPTORS,⏎··provideHttpClient,⏎··withInterceptorsFromDi,⏎

apps/portal/src/app/features/file-processor/file-processor.component.ts

[failure] 148-148:
Replace status:·number with ⏎····status:·number,⏎··


[failure] 149-149:
Replace ·[key:·number]:·'success'·|·'secondary'·|·'info'·|·'warning'·|·'danger'·|·'contrast' with ⏎······[key:·number]:·'success'·|·'secondary'·|·'info'·|·'warning'·|·'danger'·|·'contrast';⏎···

Additional comments not posted (2)
apps/portal/src/app/app.module.ts (1)

94-94: Ensure compatibility with provideHttpClient.

The addition of provideHttpClient(withInterceptorsFromDi()) is a modern approach to handling HTTP requests. Verify that all existing HTTP configurations and interceptors are compatible with this change.

apps/portal/src/app/features/file-processor/file-processor.component.ts (1)

149-156: Ensure the correctness of severity mapping.

The severityMap has been updated, changing the mapping for the key 2 from 'primary' to 'secondary'. Verify that this change aligns with the intended logic and does not affect other parts of the application.

Verification successful

No Impact from Severity Mapping Change

The change in severity mapping from 'primary' to 'secondary' for the key 2 in the getSeverity method does not appear to impact other parts of the application, as there are no direct calls to this method found in the TypeScript files.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of changes in severity mapping.

# Test: Search for usage of `getSeverity` method. Expect: Consistency with the new mapping logic.
rg --type ts 'getSeverity' -A 3

Length of output: 590


Script:

#!/bin/bash
# Search for all instances where the `getSeverity` method is called in the codebase.
rg 'getSeverity\(' --type ts -A 3

Length of output: 594

Tools
GitHub Check: Lint

[failure] 149-149:
Replace ·[key:·number]:·'success'·|·'secondary'·|·'info'·|·'warning'·|·'danger'·|·'contrast' with ⏎······[key:·number]:·'success'·|·'secondary'·|·'info'·|·'warning'·|·'danger'·|·'contrast';⏎···

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 282dacd and 48274f3.

Files selected for processing (2)
  • apps/portal/src/app/app.module.ts (3 hunks)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • apps/portal/src/app/app.module.ts
  • apps/portal/src/app/features/file-processor/file-processor.component.ts

@xixas
Copy link
Contributor

xixas commented Aug 16, 2024

@kshitij-k-osmosys Make sure you have tested in docker too. Both working and functionality as we use GraphQL for this and we made change in the way we are importing HTTP Module.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 48274f3 and 1bda2ad.

Files ignored due to path filters (1)
  • apps/portal/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (2)
  • apps/portal/package.json (1 hunks)
  • apps/portal/src/app/graphql/graphql.service.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/portal/package.json
Additional comments not posted (4)
apps/portal/src/app/graphql/graphql.service.ts (4)

26-26: Improved error handling by using structured error objects.

Using Error objects instead of string literals enhances the clarity and consistency of error messages.


39-39: Enhanced error handling with structured error objects.

Replacing string literals with Error objects improves the robustness of error handling.


47-47: Consistent error handling with Error objects.

Using Error objects in the catch block ensures uniformity and provides more context for errors.


80-80: Improved error handling in query and mutate methods.

The use of Error objects in catch blocks enhances the clarity and consistency of error messages.

Also applies to: 110-110

@kshitij-k-osmosys
Copy link
Contributor Author

@kshitij-k-osmosys Make sure you have tested in docker too. Both working and functionality as we use GraphQL for this and we made change in the way we are importing HTTP Module.

Tested functionality for both API and Portal on docker
Tested the summary functionality by uploading a .txt file
Successfully working

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1bda2ad and 5bbfd64.

Files selected for processing (1)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5bbfd64 and 664fda9.

Files selected for processing (1)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts (1 hunks)
Additional comments not posted (1)
apps/portal/src/app/features/file-processor/file-processor.component.ts (1)

148-160: Skipping further comments as the existing comments are still valid.

The changes in the getSeverity function have already been discussed in detail in the existing comments. The key points are:

  • The return type has been changed to any, which is not ideal for type safety. A specific type or a union of possible string values would be better.
  • The type of severityMap has also been changed to any, which is not ideal for the same reason.
  • The default return value has been changed to 'secondary' based on the agreement in the existing comments to use 'secondary' for unhandled cases.

As the existing comments are still valid and applicable, I'm skipping further comments to avoid duplication.

@xixas xixas merged commit ace6251 into main Oct 22, 2024
6 checks passed
@xixas xixas deleted the build/update-portal-deps branch October 22, 2024 05:35
@coderabbitai coderabbitai bot mentioned this pull request Feb 27, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Ready for review Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants