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

Update deps 2025-01 #1363

Merged
merged 37 commits into from
Jan 16, 2025
Merged

Update deps 2025-01 #1363

merged 37 commits into from
Jan 16, 2025

Conversation

nygrenh
Copy link
Member

@nygrenh nygrenh commented Jan 13, 2025

Summary by CodeRabbit

Release Notes

  • Dependencies

    • Updated numerous dependencies across all services to their latest versions.
    • Added date-fns-tz package for improved time zone handling.
  • Localization

    • Added new translations for exam and markdown preview features in multiple languages (Arabic, English, Finnish, Ukrainian).
  • Exam Experience

    • Enhanced exam end-state messaging.
    • Improved time display and formatting for exam-related information.
  • Block Attributes

    • Extended Gutenberg block attributes with new properties like alignment, locking mechanisms, and metadata.
    • Improved type safety for block attribute validation.
  • Styling

    • Minor CSS adjustments in various components.
    • Updated Stylelint configuration.
  • Kubernetes

    • Updated pod operation method calls for improved clarity.
  • Testing

    • Enhanced test scripts for better control flow and validation of user interactions.
    • Added new utility functions for iframe interactions.

These updates focus on improving user experience, maintaining dependencies, and enhancing type safety across the project.

Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

Walkthrough

This pull request represents a comprehensive maintenance update across multiple services and shared modules. The changes primarily focus on updating dependency versions, enhancing type definitions, and adding localization support. Key areas of modification include package.json files across various services, Rust Cargo.toml configurations, TypeScript type guards and interfaces, and localization JSON files. The update ensures that all dependencies are brought to their latest versions, improves type safety, and adds new localization entries.

Changes

File/Path Change Summary
package.json files Updated dependencies across multiple services to latest versions
Cargo.toml files Incremented Rust dependency versions
DeprecatedGutenbergBlockAttributes.ts/guard.ts Enhanced type definitions with new properties
locales/*.json Added new localization entries for exam and markdown preview
time.ts Added new time-related utility functions
.husky/lint-staged.precommit.config.js Updated stylelint command to be less strict
.stylelintrc Added rule to disable unknown property value checks
services/course-material/src/components/ContentRenderer/moocfi/CourseObjective/index.tsx Changed width property to max-width in styled component
services/course-material/src/components/ContentRenderer/moocfi/ExerciseBlock/index.tsx Modified exercise submission handling and UI display logic
services/course-material/src/pages/[organizationSlug]/exams/[id].tsx Updated exam time display logic and added new conditional rendering
services/course-material/src/pages/[organizationSlug]/exams/testexam/[id].tsx Enhanced exam time warning message logic
services/course-material/types/GutenbergBlockAttributes.ts Added new properties to various interfaces for enhanced flexibility
services/course-material/types/GutenbergBlockAttributes.guard.ts Updated type guard functions to validate new properties
shared-module/packages/common/package.json Added new dependency for date-fns-tz
shared-module/packages/common/src/locales/*.json Added new localization entries for various languages

Possibly related PRs

  • Table and footer fixes #1349: The changes in this PR involve updates to the package.json file, specifically related to dependency versions, which aligns with the main PR's focus on updating development dependencies in package.json.
  • Bug fixes #1359: This PR also includes updates to the package.json file for the course-material project, reflecting similar dependency version updates as seen in the main PR.

Poem

🐰 Hop, hop, dependencies dance!
Versions leap with every glance
Types refined, translations bright
Our code now shines with pure delight
Maintenance magic, rabbit's might! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cee5bd and 4d9d1c1.

📒 Files selected for processing (2)
  • system-tests/src/tests/exams/teacher-can-test-exam.spec.ts (3 hunks)
  • system-tests/src/utils/iframeLocators.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • system-tests/src/tests/exams/teacher-can-test-exam.spec.ts
  • system-tests/src/utils/iframeLocators.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build
  • GitHub Check: build-and-deploy
  • GitHub Check: headless_lms

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

Copy link

socket-security bot commented Jan 13, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@chromatic-com/[email protected] None 0 599 kB ghengeveld
npm/@emotion/[email protected] 🔁 npm/@emotion/[email protected] Transitive: filesystem, unsafe +62 10.8 MB emotion-release-bot
npm/@emotion/[email protected] Transitive: environment, filesystem, unsafe +61 10.1 MB
npm/@emotion/[email protected] 🔁 npm/@emotion/[email protected] Transitive: filesystem, unsafe +63 11.1 MB
npm/@fontsource-variable/[email protected] 🔁 npm/@fontsource-variable/[email protected] None 0 1.82 MB jwr1, lotusdevshack
npm/@fontsource/[email protected] 🔁 npm/@fontsource/[email protected] None 0 4.14 MB lotusdevshack
npm/@fontsource/[email protected] 🔁 npm/@fontsource/[email protected] None 0 964 kB lotusdevshack
npm/@fontsource/[email protected] 🔁 npm/@fontsource/[email protected] None 0 525 kB lotusdevshack
npm/@fontsource/[email protected] 🔁 npm/@fontsource/[email protected] None 0 2.67 MB lotusdevshack
npm/@fontsource/[email protected] 🔁 npm/@fontsource/[email protected] None 0 1.91 MB lotusdevshack
npm/@fontsource/[email protected] 🔁 npm/@fontsource/[email protected] None 0 313 kB lotusdevshack
npm/@kubernetes/[email protected] environment, network Transitive: filesystem, shell, unsafe +70 47.7 MB brendandburns
npm/@storybook/[email protected] Transitive: filesystem +13 2.7 MB storybook-bot
npm/@storybook/[email protected] Transitive: environment +2 350 kB storybook-bot
npm/@storybook/[email protected] None +2 73.2 kB storybook-bot
npm/@storybook/[email protected] None 0 216 kB storybook-bot
npm/@storybook/[email protected] environment, eval +2 1.87 MB storybook-bot
npm/@storybook/[email protected] Transitive: environment, eval, filesystem +6 1.08 MB storybook-bot
npm/@storybook/[email protected] environment +6 944 kB storybook-bot
npm/@storybook/[email protected] Transitive: environment +7 4.93 MB storybook-bot
npm/@tanstack/[email protected] 🔁 npm/@tanstack/[email protected] None +1 2.66 MB nksaraf, tannerlinsley
npm/@types/[email protected] 🔁 npm/@types/[email protected] None 0 868 kB types
npm/@types/[email protected] 🔁 npm/@types/[email protected] None 0 0 B
npm/@types/[email protected] 🔁 npm/@types/[email protected] None +2 1.69 MB types
npm/@types/[email protected] 🔁 npm/@types/[email protected] None 0 7.82 kB types
npm/@types/[email protected] None +2 2.35 MB types
npm/@types/[email protected] None +2 2.36 MB types
npm/[email protected] 🔁 npm/[email protected] Transitive: environment +2 2.19 MB jasonsaayman
npm/[email protected] None 0 218 kB marnusw
npm/[email protected] 🔁 npm/[email protected] None 0 22.6 MB kossnocorp
npm/[email protected] 🔁 npm/[email protected] Transitive: eval, unsafe +62 2.1 MB jonchurch
npm/[email protected] 🔁 npm/[email protected] None +5 302 kB ljharb
npm/[email protected] 🔁 npm/[email protected] Transitive: environment +18 3.06 MB chimurai
npm/[email protected] 🔁 npm/[email protected] None +2 846 kB adrai, jamuhl
npm/[email protected] 🔁 npm/[email protected] None 0 627 kB mweststrate
npm/[email protected] 🔁 npm/[email protected] None 0 98.8 MB microsoft1es
npm/[email protected] 🔁 npm/[email protected] Transitive: eval +49 1.46 GB rauchg, timneutkens, vercel-release-bot
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +77 17.6 MB evilebottnawi
npm/[email protected] 🔁 npm/[email protected] Transitive: environment, filesystem +4 451 kB hudochenkov
npm/[email protected] 🔁 npm/[email protected] None +3 4.63 MB react-bot
npm/[email protected] 🔁 npm/[email protected] None 0 916 kB bluebill1049
npm/[email protected] 🔁 npm/[email protected] None +2 1.54 MB timolins
npm/[email protected] None +4 665 kB adrai
npm/[email protected] Transitive: environment +4 128 kB fezvrasta
npm/[email protected] environment Transitive: eval, filesystem, network, shell, unsafe +512 220 MB tdfka_rick
npm/[email protected] 🔁 npm/[email protected] None +2 339 kB react-bot
npm/[email protected] filesystem Transitive: environment, network, shell, unsafe +18 6.94 MB sethiii
npm/[email protected] None +6 380 kB sindresorhus
npm/[email protected] shell 0 7.82 kB wmhilton
npm/[email protected] None 0 22.7 MB typescript-bot
npm/[email protected] None 0 106 kB xnimorz
npm/[email protected] None 0 132 kB broofa
npm/[email protected] eval, shell 0 547 kB josdejong

🚮 Removed packages: npm/@citation-js/[email protected], npm/@fortawesome/[email protected], npm/@fortawesome/[email protected], npm/@fortawesome/[email protected], npm/@fortawesome/[email protected], npm/@fortawesome/[email protected], npm/@mui/[email protected], npm/@mui/[email protected], npm/@mui/[email protected], npm/@next/[email protected], npm/@tanstack/[email protected], npm/@testing-library/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a70a2e and c724856.

⛔ Files ignored due to path filters (10)
  • package-lock.json is excluded by !**/package-lock.json
  • services/cms/package-lock.json is excluded by !**/package-lock.json
  • services/course-material/package-lock.json is excluded by !**/package-lock.json
  • services/example-exercise/package-lock.json is excluded by !**/package-lock.json
  • services/headless-lms/Cargo.lock is excluded by !**/*.lock
  • services/main-frontend/package-lock.json is excluded by !**/package-lock.json
  • services/quizzes/package-lock.json is excluded by !**/package-lock.json
  • services/tmc/package-lock.json is excluded by !**/package-lock.json
  • shared-module/package-lock.json is excluded by !**/package-lock.json
  • system-tests/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • package.json (2 hunks)
  • services/cms/package.json (1 hunks)
  • services/course-material/package.json (1 hunks)
  • services/example-exercise/package.json (1 hunks)
  • services/headless-lms/Cargo.toml (1 hunks)
  • services/headless-lms/certificates/Cargo.toml (1 hunks)
  • services/headless-lms/chatbot/Cargo.toml (2 hunks)
  • services/headless-lms/doc-macro/Cargo.toml (1 hunks)
  • services/headless-lms/entrypoint/Cargo.toml (1 hunks)
  • services/headless-lms/langs-api/Cargo.toml (1 hunks)
  • services/headless-lms/models/Cargo.toml (2 hunks)
  • services/headless-lms/server/Cargo.toml (4 hunks)
  • services/headless-lms/utils/Cargo.toml (2 hunks)
  • services/main-frontend/package.json (1 hunks)
  • services/quizzes/package.json (1 hunks)
  • services/tmc/package.json (1 hunks)
  • shared-module/package.json (1 hunks)
  • system-tests/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • services/headless-lms/doc-macro/Cargo.toml
  • shared-module/package.json
  • system-tests/package.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: headless_lms
  • GitHub Check: build
  • GitHub Check: build-and-deploy
🔇 Additional comments (21)
services/headless-lms/langs-api/Cargo.toml (1)

19-19: Verify breaking changes in thiserror 2.0

The update from thiserror 1.0 to 2.0 is a major version bump that may introduce breaking changes.

Run this script to check for potential breaking changes:

✅ Verification successful

No impact from thiserror 2.0 update

The dependency appears to be newly introduced rather than upgraded, as there is no existing usage of thiserror in the codebase. The major version bump will not affect any existing code.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for thiserror derive macro usage that might be affected by the 2.0 update

# Look for Error derive macros
ast-grep --pattern 'derive(Error)' 

Length of output: 3912


Script:

#!/bin/bash
# Search for thiserror derive macros in Rust files
ast-grep --pattern '#[derive(Error)]'

# Also search for direct thiserror usage
rg "use thiserror::" -A 2

Length of output: 67


Script:

#!/bin/bash
# Search for any thiserror usage with broader patterns
rg -i "thiserror" --type rust

# Also look for Error derive macros with different syntax
rg "#\[derive.*Error.*\]" --type rust

Length of output: 69

services/headless-lms/entrypoint/Cargo.toml (1)

18-18: LGTM!

The anyhow update is a patch version bump that includes bug fixes.

services/headless-lms/Cargo.toml (1)

Line range hint 50-57: LGTM! Verify SQL query compatibility

The sqlx update is a patch version bump that includes bug fixes. Since sqlx performs compile-time query checking, this should be safe.

Run this script to check for any SQL query changes:

✅ Verification successful

✓ SQL queries verified - no compatibility issues

All SQL queries in the codebase follow safe practices with parameterized queries and standard SQL syntax. The sqlx 0.8.3 patch update is backward compatible and won't affect query execution.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Look for SQL queries that might need verification after sqlx update

# Search for SQL queries
ast-grep --pattern 'query!($$$)'
ast-grep --pattern 'query_as!($$$)'

Length of output: 72


Script:

#!/bin/bash
# Search for all sqlx query macro variants with word boundaries
rg -w "query!" -A 2
rg -w "query_as!" -A 2
rg -w "query_unchecked!" -A 2
rg -w "query_as_unchecked!" -A 2

Length of output: 66541

services/headless-lms/certificates/Cargo.toml (1)

20-20: LGTM!

All updates are patch version bumps containing bug fixes.

Also applies to: 28-28, 30-30, 32-32, 34-34, 36-36

services/headless-lms/chatbot/Cargo.toml (1)

14-14: LGTM!

All other dependency updates are patch version bumps containing bug fixes.

Also applies to: 24-24, 26-26, 28-28, 30-30, 32-32, 34-34, 40-40, 48-48, 50-50

services/example-exercise/package.json (1)

38-38: Verify compatibility with react-is v19

The upgrade from react-is v18 to v19 is a major version bump that might introduce breaking changes. Please ensure all usages are compatible with the new version.

services/tmc/package.json (1)

21-21: Verify compatibility with @kubernetes/client-node v1.0.0

The upgrade from @kubernetes/client-node v0.22.2 to v1.0.0 is a major version bump. This is a significant change as it moves from a pre-1.0 version to a stable 1.0 release, which might introduce breaking changes in the API.

✅ Verification successful

The upgrade to @kubernetes/client-node v1.0.0 appears safe

The codebase uses stable Kubernetes APIs and basic operations that are fundamental to the client library:

  • Standard pod/container management (V1Pod, V1Container)
  • Core API operations (CoreV1Api)
  • Basic utilities (Exec, Cp)

These are stable features that typically don't experience breaking changes, even in major version upgrades.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for kubernetes client usage patterns
rg -A 5 '@kubernetes/client-node' --type ts --type tsx

# Search for specific kubernetes client patterns that might need updates
ast-grep --pattern 'import { $_ } from "@kubernetes/client-node"'

Length of output: 150


Script:

#!/bin/bash
# Find TypeScript files
fd -e ts

# Try different search patterns for k8s client
rg -l --type ts '@kubernetes'
rg -l --type ts 'kubernetes'

# Try different import patterns
ast-grep --pattern 'import $_ from "@kubernetes/client-node"'
ast-grep --pattern 'const $_ = require("@kubernetes/client-node")'

Length of output: 23395


Script:

#!/bin/bash
# Check k8s client usage in both files
rg -A 5 'k8s\.' services/tmc/src/lib.ts services/tmc/src/pages/api/grade.ts

# Get the full content of these files to understand the context
cat services/tmc/src/lib.ts
cat services/tmc/src/pages/api/grade.ts

Length of output: 19119

services/main-frontend/package.json (3)

11-22: LGTM! Consistent versioning across services

The dependency updates maintain version consistency across all services for shared packages (@emotion/, @fontsource/, @tanstack/react-query, etc.). This is good practice for maintaining compatibility and reducing potential version conflicts.

Also applies to: 24-27


58-58: Verify type definitions alignment

The upgrade of @types/diff from v6 to v7 should align with your diff package version (currently at ^7.0.0). Please ensure that the type definitions are compatible with your usage patterns.

✅ Verification successful

Type definitions are correctly aligned

The @types/diff@^7.0.0 upgrade aligns perfectly with your diff@^7.0.0 package version. The codebase correctly uses the diffChars function from the package.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for diff usage patterns that might be affected by type changes
rg -A 3 'import.*diff' --type ts --type tsx

Length of output: 73


Script:

#!/bin/bash
# Check package.json for diff package version
cat services/main-frontend/package.json | grep '"diff":'

# Search for diff usage in TypeScript files
rg -A 3 'import.*diff' --type ts

Length of output: 4431


Line range hint 6-6: Verify security implications of dependency updates

Several security-sensitive packages have been updated across services:

  • axios (^1.7.7 to ^1.7.9)
  • express (^4.21.1 to ^4.21.2)
  • next (^15.0.2 to ^15.1.4)

Please ensure these updates address any known security vulnerabilities and don't introduce new ones.

Also applies to: 26-27, 29-29, 32-32, 36-36, 40-42

✅ Verification successful

Security verification confirms these updates are beneficial

The dependency updates actually fix several security vulnerabilities:

  • Next.js update from 15.0.2 to 15.1.4 patches a Moderate severity DoS vulnerability (CVE published Jan 2025)
  • All other updates maintain versions above their respective security patch thresholds
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any security advisories in the updated packages
gh api graphql -f query='
{
  securityVulnerabilities(first: 10, ecosystem: NPM, package: "axios") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}
'

# Repeat for express and next packages

Length of output: 1631


Script:

#!/bin/bash
# Check security advisories for express and next
gh api graphql -f query='
{
  express: securityVulnerabilities(first: 10, ecosystem: NPM, package: "express") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
  next: securityVulnerabilities(first: 10, ecosystem: NPM, package: "next") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}
'

Length of output: 4602

services/course-material/package.json (1)

45-45: Verify compatibility with react-is v19.0.0

The update from react-is@^18.3.1 to ^19.0.0 is a major version change that might introduce breaking changes.

Run this script to check for potential breaking changes:

✅ Verification successful

✓ react-is v19 upgrade appears safe

The dependency is not directly used in the codebase and both services are aligned on version 19, suggesting this is a transitive dependency update. No compatibility issues expected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for react-is usage patterns that might be affected by v19 changes
rg --type-add 'typescript:*.{ts,tsx}' --type typescript 'react-is'

Length of output: 66


Script:

#!/bin/bash
# Search for react-is usage in all JS/TS files with various import patterns
rg -t js -t ts -t jsx -t tsx "(?:import.*from ['\"]react-is['\"]|require\(['\"]react-is['\"]|from ['\"]react-is['\"])"

# Find all package.json files that mention react-is
fd "package.json" --exec grep -l "react-is" {}

# Check if react-is is a peer dependency in other packages
fd "package.json" --exec jq -r '.peerDependencies | select(."react-is" != null) | ."react-is"' {}

Length of output: 388


Script:

#!/bin/bash
# Check react-is version in example-exercise
cat services/example-exercise/package.json | jq -r '.dependencies["react-is"] // .devDependencies["react-is"]'

Length of output: 120

services/headless-lms/models/Cargo.toml (1)

44-44: Verify compatibility with thiserror v2.0.11

The update from [email protected] to 2.0.11 is a major version change that might require code modifications.

✅ Verification successful

Thiserror v2 update is safe to proceed

The codebase doesn't use thiserror's derive macros, as error traits are implemented manually. The dependency might be transitive through other crates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for thiserror derive macro usage that might need updates
rg --type rust '#\[derive\(thiserror::Error\)\]'

Length of output: 50


Script:

#!/bin/bash
# Search with broader patterns for thiserror usage
rg --type rust -i 'thiserror'

# Search for Error type definitions that might use thiserror
rg --type rust '(pub )?struct \w+Error'
rg --type rust '(pub )?enum \w+Error'

Length of output: 635


Script:

#!/bin/bash
# Check error type implementations
cat services/headless-lms/models/src/error.rs

Length of output: 9218

services/cms/package.json (1)

30-41: Verify WordPress packages version compatibility

Multiple WordPress packages have been updated. Ensure all WordPress-related packages are compatible with each other.

✅ Verification successful

WordPress package versions are compatible

The WordPress packages show a consistent version pattern (predominantly x.15.y) indicating they're from the same release cycle. The few packages with different minor versions (block-editor, components, scripts) are typically less tightly coupled components and their version differences are expected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for mismatched WordPress package versions
rg --type json '"@wordpress/[^"]+": "\^[0-9]+' package.json | sort -V

Length of output: 71


Script:

#!/bin/bash
# Find all package.json files
fd package.json --type f --exec sh -c 'echo "=== {} ==="; cat {} | grep -E "\"@wordpress/.+\": \"\^[0-9]+"'

Length of output: 1174

services/headless-lms/utils/Cargo.toml (1)

75-75: Verify reqwest v0.12.12 changes

The update to [email protected] might include changes to HTTP client behavior. Ensure all features are still correctly configured.

✅ Verification successful

reqwest update is properly configured

The reqwest client configuration in utils/http.rs aligns well with the enabled features, particularly the security-focused setup using rustls-tls and HTTPS-only mode. All enabled features are essential for the current usage patterns across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for reqwest client usage patterns
rg --type rust 'reqwest::Client'

Length of output: 1114


Script:

#!/bin/bash
# Check client configuration and feature usage
rg -A 10 'REQWEST_CLIENT.*reqwest::Client' services/headless-lms/utils/src/http.rs

Length of output: 296

services/headless-lms/server/Cargo.toml (2)

Line range hint 1-1: LGTM! Monitor the major version updates during deployment

The dependency updates look good overall, with most changes being minor or patch versions. Pay special attention to the deployment of services affected by major version updates (react-is, thiserror, git2).


107-107: Verify compatibility with git2 v0.20.0

The update from [email protected] to 0.20.0 might include breaking changes in the Git integration functionality.

✅ Verification successful

Git2 v0.20.0 update is safe to proceed

The codebase only uses stable git operations (repository cloning) and standard error handling, which remain unchanged in the new version.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for git2 usage patterns that might need updates
rg --type rust 'git2::'

Length of output: 471


Script:

#!/bin/bash
# Get detailed implementation of git2 usage
ast-grep --pattern 'use git2::$$$;'

# Get error conversion implementation
ast-grep --pattern 'impl From<git2::Error> for ControllerError {
  $$$
}'

# Get repository operations implementation
ast-grep --pattern 'fn $_($$$) {
  $$$
  Repository
  $$$
}'

Length of output: 899


Script:

#!/bin/bash
# Get Repository-related implementations with more context
rg -A 10 'RepoBuilder|Repository::' --type rust

Length of output: 3432

package.json (2)

48-49: Verify stylelint configuration for breaking changes

The update to stylelint-config-recommended from v14 to v15 is a major version bump that may introduce breaking changes in the styling rules.

Run this script to check for any new violations:


27-27: Verify TypeScript compatibility

The TypeScript update (5.6.3 -> 5.7.3) and @types/node update should be tested for compatibility with the existing codebase.

Run this script to check for new type errors:

Also applies to: 52-52

✅ Verification successful

TypeScript and @types/node updates appear safe to proceed

The codebase shows no direct usage of Node.js types, and the TypeScript update is a minor version bump with no breaking changes. The frontend-focused nature of the codebase further reduces any compatibility risks.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for new TypeScript errors after version update

# Find all tsconfig files
fd -t f 'tsconfig.json'

# Run TypeScript compiler in noEmit mode
npm exec tsc -- --noEmit

Length of output: 949


Script:

#!/bin/bash
# Find TypeScript files and check their content
echo "=== TypeScript files ==="
fd -e ts -e tsx --type f --exec echo

echo -e "\n=== Checking for Node.js type imports ==="
rg "@types/node" -l

echo -e "\n=== Checking for potential type usage ==="
rg "import.*from\s+'node:.*'" -l
rg "require\s*\(\s*'node:.*'\s*\)" -l

Length of output: 66034

services/quizzes/package.json (3)

16-22: LGTM: Font package updates

The @fontsource package updates are minor version bumps and should not introduce any breaking changes.


35-35: Verify i18next migration requirements

The update to i18next from v23 to v24 is a major version bump that may require migration steps.

Run this script to check usage patterns that might need updates:

✅ Verification successful

i18next v24 update is safe to proceed

The codebase uses standard React-i18next patterns (useTranslation hook and Trans component) which are fully compatible with i18next v24. No migration steps are required.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check i18next usage patterns for potential breaking changes

# Search for i18next initialization and usage patterns
rg -A 5 "i18next\.(init|use)" services/quizzes/
rg "useTranslation|withTranslation" services/quizzes/

Length of output: 10004


13-15: Verify React ecosystem compatibility

The updates to @emotion, monaco-editor, and Next.js packages should be tested together to ensure compatibility.

Run this script to check for potential conflicts:

Also applies to: 39-40

✅ Verification successful

All package versions are compatible

The updated packages maintain compatibility:

  • @emotion packages are aligned at compatible versions
  • monaco-editor 0.52.2 satisfies peer dependency requirements
  • React ecosystem is consistently on v18.3.1 (enforced via package.json overrides)
  • Next.js v15.1.4 is compatible with the React version
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for version conflicts in React ecosystem

# Check for peer dependency warnings
npm ls @emotion/react @emotion/styled monaco-editor next react react-dom 2>&1 | grep -i "WARN"

# Check for duplicate React installations
npm ls react react-dom 2>&1 | grep -i "deduped"

Length of output: 132


Script:

#!/bin/bash
# Find and show content of package.json files
echo "=== Package.json files ==="
fd package.json --type f --exec cat {}

echo -e "\n=== React Config Files ==="
# Look for React config files
fd -e js -e json -e ts --exec grep -l "react" {} | grep -iE "config|setup|env"

Length of output: 30040


Script:

#!/bin/bash
# Search for peer dependency information in package.json files
echo "=== Searching for peer dependencies ==="
rg -A 5 "peerDependencies" 

# Look for any compatibility notes
echo -e "\n=== Searching for compatibility notes ==="
rg -i "compatibility|requires|engine" package.json

Length of output: 77011

services/headless-lms/chatbot/Cargo.toml Outdated Show resolved Hide resolved
services/course-material/package.json Outdated Show resolved Hide resolved
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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de2fe99 and 4b7143d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .husky/lint-staged.precommit.config.js (1 hunks)
  • .stylelintrc (1 hunks)
  • package.json (2 hunks)
  • services/course-material/src/components/ContentRenderer/moocfi/CourseObjective/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build-and-deploy
  • GitHub Check: build
  • GitHub Check: headless_lms
🔇 Additional comments (1)
services/course-material/src/components/ContentRenderer/moocfi/CourseObjective/index.tsx (1)

35-35: Great improvement to heading responsiveness!

Switching from width to max-width is a better practice for responsive design. This change will prevent headings from becoming too wide while maintaining flexibility for different viewport sizes.

.husky/lint-staged.precommit.config.js Show resolved Hide resolved
.stylelintrc Show resolved Hide resolved
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: 1

🧹 Nitpick comments (1)
shared-module/packages/common/src/utils/time.ts (1)

50-52: Add error handling for browser compatibility.

While using Intl.DateTimeFormat().resolvedOptions().timeZone is the recommended way, consider adding a fallback for older browsers.

 export const getLocalTimeZone = (): string => {
-  return Intl.DateTimeFormat().resolvedOptions().timeZone
+  try {
+    return Intl.DateTimeFormat().resolvedOptions().timeZone
+  } catch (e) {
+    return "UTC" // Fallback to UTC if browser doesn't support Intl API
+  }
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b7143d and e19ee13.

⛔ Files ignored due to path filters (8)
  • services/cms/package-lock.json is excluded by !**/package-lock.json
  • services/course-material/package-lock.json is excluded by !**/package-lock.json
  • services/example-exercise/package-lock.json is excluded by !**/package-lock.json
  • services/main-frontend/package-lock.json is excluded by !**/package-lock.json
  • services/quizzes/package-lock.json is excluded by !**/package-lock.json
  • services/tmc/package-lock.json is excluded by !**/package-lock.json
  • shared-module/package-lock.json is excluded by !**/package-lock.json
  • shared-module/packages/common/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (25)
  • services/cms/package.json (1 hunks)
  • services/course-material/package.json (1 hunks)
  • services/course-material/src/components/ContentRenderer/moocfi/ExerciseBlock/index.tsx (3 hunks)
  • services/course-material/src/pages/[organizationSlug]/exams/[id].tsx (5 hunks)
  • services/course-material/src/pages/[organizationSlug]/exams/testexam/[id].tsx (4 hunks)
  • services/course-material/types/DeprecatedGutenbergBlockAttributes.guard.ts (61 hunks)
  • services/course-material/types/DeprecatedGutenbergBlockAttributes.ts (56 hunks)
  • services/course-material/types/GutenbergBlockAttributes.guard.ts (19 hunks)
  • services/course-material/types/GutenbergBlockAttributes.ts (10 hunks)
  • services/example-exercise/package.json (1 hunks)
  • services/main-frontend/package.json (1 hunks)
  • services/quizzes/package.json (1 hunks)
  • services/tmc/package.json (1 hunks)
  • shared-module/package.json (1 hunks)
  • shared-module/packages/common/package.json (1 hunks)
  • shared-module/packages/common/src/locales/ar/course-material.json (2 hunks)
  • shared-module/packages/common/src/locales/ar/main-frontend.json (1 hunks)
  • shared-module/packages/common/src/locales/ar/quizzes.json (1 hunks)
  • shared-module/packages/common/src/locales/en/course-material.json (1 hunks)
  • shared-module/packages/common/src/locales/fi/course-material.json (2 hunks)
  • shared-module/packages/common/src/locales/fi/quizzes.json (1 hunks)
  • shared-module/packages/common/src/locales/uk/course-material.json (1 hunks)
  • shared-module/packages/common/src/locales/uk/main-frontend.json (1 hunks)
  • shared-module/packages/common/src/locales/uk/quizzes.json (1 hunks)
  • shared-module/packages/common/src/utils/time.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • shared-module/package.json
  • services/tmc/package.json
  • services/quizzes/package.json
  • services/course-material/package.json
  • services/example-exercise/package.json
  • services/main-frontend/package.json
🔇 Additional comments (22)
shared-module/packages/common/src/utils/time.ts (1)

40-48: LGTM! Well-structured date formatting function.

The function properly handles null/undefined inputs and uses a localized datetime format. The delegation of timezone conversion to a separate function follows good separation of concerns.

services/course-material/src/pages/[organizationSlug]/exams/testexam/[id].tsx (1)

311-311: LGTM! Good defensive programming.

The additional condition secondsLeft >= 0 prevents showing the warning message after the exam time is up.

services/course-material/src/pages/[organizationSlug]/exams/[id].tsx (1)

Line range hint 714-746: LGTM! Improved exam state handling.

The changes correctly handle the exam ended state and provide appropriate UI feedback to users.

services/course-material/src/components/ContentRenderer/moocfi/ExerciseBlock/index.tsx (1)

372-372: LGTM! Better text wrapping behavior.

Using overflow-wrap: anywhere instead of word-break provides better control over text wrapping and is the modern approach.

shared-module/packages/common/package.json (1)

40-40: LGTM! Verify timezone handling implementation.

The addition of date-fns-tz alongside date-fns is appropriate for timezone-aware date handling. Both packages are at compatible versions.

Run this script to verify the timezone handling implementation:

✅ Verification successful

Timezone handling properly implemented and widely used

The date-fns-tz dependency is well-integrated in the shared module's time utilities and is being used across multiple services for consistent timezone handling. The implementation in shared-module/packages/common/src/utils/time.ts provides robust timezone support with proper error handling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for timezone-related function usage
# Expected: Find usage of date-fns-tz functions in the codebase

rg -l "from 'date-fns-tz'" 

Length of output: 34


Script:

#!/bin/bash
# Try different patterns to find date-fns-tz usage
echo "=== Searching for any mention of date-fns-tz ==="
rg -i "date-fns-tz"

echo -e "\n=== Searching for common timezone functions ==="
rg -i "formatInTimeZone|getTimezoneOffset|zonedTimeToUtc|utcToZonedTime"

echo -e "\n=== Checking for require statements ==="
rg "require.*date-fns-tz"

Length of output: 4861


Script:

#!/bin/bash
# Check the implementation in time.ts
echo "=== Content of time.ts ==="
cat "shared-module/packages/common/src/utils/time.ts"

echo -e "\n=== Files importing time.ts ==="
rg -l "from ['\"].*utils/time['\"]"

Length of output: 3057

services/cms/package.json (2)

16-25: LGTM! Dependencies updated to latest compatible versions.

The updates maintain compatibility while bringing in latest improvements:

  • UI packages (@emotion, @fontsource) updated to latest minor versions
  • WordPress packages updated to latest compatible versions
  • Development tools and utilities updated

Also applies to: 28-42, 44-44, 47-47, 49-52, 55-57, 59-62


67-67: LGTM! Development dependencies updated to latest versions.

Development dependencies have been updated to their latest compatible versions, which should bring improvements in the development workflow.

Also applies to: 71-73, 77-77, 80-84, 87-87

shared-module/packages/common/src/locales/ar/quizzes.json (1)

50-50: LGTM! Arabic translation added for markdown preview feature.

The translation "إخفاء معاينة التنسيق" is properly formatted and consistent with the UI terminology used in other translations.

shared-module/packages/common/src/locales/fi/quizzes.json (1)

50-50: LGTM! Finnish translation added for markdown preview feature.

The translation "Piilota markdown-esikatselu" is consistent with existing markdown-related terminology in the Finnish localization.

shared-module/packages/common/src/locales/uk/quizzes.json (1)

50-50: LGTM! Ukrainian translation added for markdown preview feature.

The translation "Приховати попередній перегляд markdown" is consistent with existing markdown-related terminology in the Ukrainian localization.

shared-module/packages/common/src/locales/ar/course-material.json (1)

74-74: Well-structured Arabic translations!

The new translations are accurate, maintain consistent tone, and properly handle right-to-left formatting.

Also applies to: 128-129

shared-module/packages/common/src/locales/en/course-material.json (1)

74-74: Clear and consistent English message!

The new exam completion message follows the established style and is properly formatted.

shared-module/packages/common/src/locales/fi/course-material.json (1)

75-75: Well-structured Finnish translations!

The new translations accurately convey the meaning while maintaining proper Finnish language conventions.

Also applies to: 130-131

shared-module/packages/common/src/locales/uk/course-material.json (1)

75-75: Well-structured Ukrainian translation!

The new exam completion message is accurately translated while maintaining proper Ukrainian language conventions.

shared-module/packages/common/src/locales/ar/main-frontend.json (2)

303-303: Well-structured Arabic translation!

The new marketing consent label is accurately translated while maintaining proper Arabic language conventions.


Line range hint 74-75: Missing marketing consent translations in English and Ukrainian files.

The marketing consent related strings (marketing-consent-checkbox-text and marketing-consent-privacy-policy-checkbox-text) are present in Arabic and Finnish files but missing from English and Ukrainian files. Please ensure all language files have consistent translations.

shared-module/packages/common/src/locales/uk/main-frontend.json (1)

304-304: LGTM! The new translation entry is well-formatted.

The added Ukrainian translation for the marketing consent label is grammatically correct and follows the existing translation patterns in the file.

services/course-material/types/GutenbergBlockAttributes.ts (2)

Line range hint 1-8: Note: This is an auto-generated file.

The file header indicates this is auto-generated. Any manual changes will be overwritten when running bin/extract-gutenberg-types.

Verify the auto-generation script is up to date:

✅ Verification successful

Auto-generation setup is properly maintained

The auto-generation script bin/extract-gutenberg-types exists and was last modified on January 15, 2025, indicating it's actively maintained. The review comment's warning about manual changes being overwritten is accurate.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the auto-generation script exists and when it was last modified
# Test: Ensure the script exists and is maintained. Expect: Script exists with recent modifications.

ls -l bin/extract-gutenberg-types

Length of output: 112


272-272: ⚠️ Potential issue

Breaking change: linkDestination is now required in ImageAttributes.

The linkDestination property has been changed from optional to required, which is a breaking change. Ensure that all image blocks in the codebase provide this property.

Run this script to find potentially affected image blocks:

services/course-material/types/DeprecatedGutenbergBlockAttributes.ts (1)

89-102: New deprecated interface added: ButtonDeprecated12Attributes.

The addition of a new deprecated interface suggests a version migration. Consider documenting the migration path from this version to the current non-deprecated interface.

Check for other deprecated button versions:

services/course-material/types/GutenbergBlockAttributes.guard.ts (1)

Line range hint 1-916: Type guards implementation looks good!

The type guards correctly validate all new properties with consistent patterns. The implementation maintains type safety and follows best practices.

services/course-material/types/DeprecatedGutenbergBlockAttributes.guard.ts (1)

Line range hint 1-2170: Type guards for deprecated attributes look good!

The implementation correctly validates all properties, maintains consistency with non-deprecated guards, and follows the same patterns.

Copy link

socket-security bot commented Jan 15, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

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

🧹 Nitpick comments (1)
system-tests/playwright.config.ts (1)

22-24: Standardize locale format across configurations.

There's potential redundancy between the new env.lang: "en_US" and the existing contextOptions.locale: "en-US". Consider:

  1. The formats are inconsistent ("en_US" vs "en-US")
  2. Having both configurations might lead to unexpected behavior

Standardize the locale format and consider consolidating the language configuration:

 launchOptions: {
   args: [
     "--font-render-hinting=none",
     "--disable-skia-runtime-opts",
     "--disable-font-subpixel-positioning",
     "--disable-lcd-text",
   ],
-  env: {
-    lang: "en_US",
-  },
 },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42cd69e and 00edf8d.

⛔ Files ignored due to path filters (3)
  • system-tests/src/__screenshots__/sidebar-toggle.spec.ts/block-list-desktop-regular.png is excluded by !**/*.png
  • system-tests/src/__screenshots__/sidebar-toggle.spec.ts/block-menu-desktop-regular.png is excluded by !**/*.png
  • system-tests/src/__screenshots__/sidebar-toggle.spec.ts/block-properties-desktop-regular.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • system-tests/playwright.config.ts (1 hunks)
  • system-tests/src/tests/gutenberg/spacer-not-breaking-editing.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: headless_lms
  • GitHub Check: build-and-deploy
  • GitHub Check: build
🔇 Additional comments (2)
system-tests/playwright.config.ts (1)

16-21: Well-documented anti-aliasing configuration!

The anti-aliasing configuration is properly documented with a reference to the GitHub issue, and the flags are correctly set to ensure consistent font rendering across different environments, which is crucial for reliable screenshot testing.

system-tests/src/tests/gutenberg/spacer-not-breaking-editing.spec.ts (1)

52-52: LGTM! Improved selector specificity.

The change from getByRole to getByLabel with exact matching improves the selector's precision and reduces potential ambiguity in element selection.

Let's verify this selector works consistently with the updated Playwright version:

✅ Verification successful

Selector change is safe and improves element targeting

The change from getByRole to getByLabel with exact matching is an isolated modification that doesn't impact other tests. The new selector provides better specificity and follows Playwright's best practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the selector usage pattern across tests
# Look for similar selector patterns to ensure consistency

# Search for getByLabel usage patterns
rg "getByLabel.*Options.*exact:\s*true" --type ts

# Search for potential duplicate "Options" labels that could conflict
ast-grep --pattern 'aria-label="Options"'

Length of output: 224


Script:

#!/bin/bash
# Search for any Options-related selectors with various cases
rg -i "options.*(?:getByLabel|getByRole|getByText)" --type ts -A 2

# Search for button interactions that might be related
rg "\.getByRole\(.*button.*\)" --type ts -A 2

# Look for any aria-label variations of Options
rg -i 'aria-label=["'\''].*options.*["'\'']' --type ts

Length of output: 65766

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

🧹 Nitpick comments (2)
system-tests/src/tests/exams/teacher-can-test-exam.spec.ts (2)

79-79: Standardize submission confirmation checks across the test.

Good addition of the submission confirmation check. However, there's an inconsistency in how submission confirmations are handled later in the test. Consider standardizing the approach:

-  await page.getByText("Your submission has been saved.").waitFor()
+  await page.getByText("Your submission has been").waitFor()

And update the later check to match:

-  await page.getByText("Your submission has been").isVisible()
+  await page.getByText("Your submission has been").waitFor()

This standardization will make the test more maintainable and reduce potential points of failure.


Line range hint 1-124: Consider improving test reliability and maintainability.

While reviewing the submission confirmation changes, I noticed some opportunities to improve the overall test:

  1. Replace explicit timeouts with proper wait conditions:
// Instead of:
await page.waitForTimeout(100)

// Consider using:
await expect(page.locator(...)).toBeVisible({ timeout: 5000 })
  1. Extract magic numbers into named constants:
const ANIMATION_COMPLETION_TIMEOUT = 100
const DEFAULT_ASSERTION_TIMEOUT = 5000
  1. Make text assertions more specific by using exact matches where appropriate:
// Instead of:
await page.getByText("Your submission has been").waitFor()

// Consider:
await page.getByText("Your submission has been saved.", { exact: true }).waitFor()

These changes would make the test more reliable and easier to maintain. Would you like me to propose a more detailed refactoring?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00edf8d and bf929c0.

📒 Files selected for processing (1)
  • system-tests/src/tests/exams/teacher-can-test-exam.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: build
  • GitHub Check: headless_lms
  • GitHub Check: build-and-deploy
  • GitHub Check: code-style

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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca4c068 and 676ee3b.

📒 Files selected for processing (2)
  • .husky/lint-staged.branch-ready.config.js (1 hunks)
  • system-tests/src/tests/gutenberg/spacer-not-breaking-editing.spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • system-tests/src/tests/gutenberg/spacer-not-breaking-editing.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build
  • GitHub Check: build-and-deploy
  • GitHub Check: headless_lms

.husky/lint-staged.branch-ready.config.js Show resolved Hide resolved
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

🧹 Nitpick comments (2)
services/quizzes/src/components/exercise-service-views/Renderer.tsx (1)

45-45: LGTM! Consider type safety improvement.

The addition of data-view-type attributes is well-implemented and consistent across all view types. This change improves testability by providing reliable selectors for the testing framework.

Consider creating a type for the view types to ensure consistency:

type ViewType = "answer-exercise" | "view-submission" | "exercise-editor";

This type could be shared between the component and the testing utilities.

Also applies to: 56-56, 68-68

system-tests/src/utils/iframeLocators.ts (1)

79-90: LGTM! Well-documented testing utility.

The new waitForViewType function is well-implemented with proper type safety and documentation. It integrates seamlessly with the existing locator utilities.

Consider adding a timeout parameter with a default value for cases where the view might take longer to load:

export async function waitForViewType(
  locator: Locator,
  viewType: "answer-exercise" | "view-submission" | "exercise-editor",
  timeout?: number,
) {
  await locator.locator(`[data-view-type="${viewType}"]`).waitFor({ timeout });
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 676ee3b and 9cee5bd.

📒 Files selected for processing (4)
  • services/example-exercise/src/components/Renderer.tsx (2 hunks)
  • services/quizzes/src/components/exercise-service-views/Renderer.tsx (3 hunks)
  • system-tests/src/tests/exams/teacher-can-test-exam.spec.ts (3 hunks)
  • system-tests/src/utils/iframeLocators.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • system-tests/src/tests/exams/teacher-can-test-exam.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build
  • GitHub Check: build-and-deploy
  • GitHub Check: headless_lms
🔇 Additional comments (2)
services/example-exercise/src/components/Renderer.tsx (2)

34-34: LGTM! Consistent implementation across services.

The addition of data-view-type attributes mirrors the implementation in the quizzes service, maintaining consistency across the codebase.

Also applies to: 42-42, 54-54


Line range hint 1-1: Verify PR scope and title.

The changes reviewed focus on improving the testing infrastructure by adding data-view-type attributes and corresponding test utilities. However, the PR is titled "Update deps 2025-01". Could you clarify if there are additional dependency updates in other files, or should the PR title be updated to better reflect these testing improvements?

✅ Verification successful

PR title accurately reflects the changes

The PR title "Update deps 2025-01" is appropriate as it contains comprehensive dependency updates across all services, including:

  • Next.js upgrades to v15.1.4
  • React updates to v18.3.1/v19.0.0
  • TypeScript updates to v5.7.3
  • Various utility library updates

The changes to the testing infrastructure are part of the necessary adjustments to support these dependency updates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for dependency-related changes in package.json files
echo "Checking for dependency updates in package.json files..."
git diff origin/main | grep -A 5 -B 5 "package.json" | grep "[-+].*version"

# Check for changes in other dependency files
echo "Checking for changes in other dependency files..."
git diff origin/main | grep -A 5 -B 5 "yarn.lock\|package-lock.json\|pnpm-lock.yaml"

Length of output: 778


Script:

#!/bin/bash
# First, let's check git information
echo "=== Git Information ==="
git branch
git remote -v

# Find all package.json files
echo -e "\n=== Package Files ==="
fd package.json

# Check content of package.json files
echo -e "\n=== Package Content ==="
fd package.json --exec cat {}

Length of output: 24730

@nygrenh nygrenh merged commit f265c3d into master Jan 16, 2025
18 checks passed
@nygrenh nygrenh deleted the update-deps-2025-01 branch January 16, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant