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

Development: Update server dependencies #10061

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

krusche
Copy link
Member

@krusche krusche commented Dec 22, 2024

Keep server dependencies up to date to avoid security issues

Checklist

  • This is a small issue that I tested locally and was confirmed by another developer on a test server.
  • I chose a title conforming to the naming conventions for pull requests.
  • Make sure all relevant Github actions pass

Summary by CodeRabbit

  • New Features

    • Updated Docker images for MySQL and PostgreSQL in the setup documentation.
    • Enhanced WebSocket security configuration with a programmatic approach.
  • Bug Fixes

    • Improved clarity on database migration instructions and compatibility with updated Docker images.
  • Documentation

    • Revised Docker Compose setup instructions, including memory allocation and supported versions.
    • Updated database migration documentation to reflect changes from MySQL to PostgreSQL.
  • Chores

    • Dependency versions updated across various configuration files to maintain current standards.

@krusche krusche requested a review from a team as a code owner December 22, 2024 11:38
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) documentation docker core Pull requests that affect the corresponding module labels Dec 22, 2024
Copy link

coderabbitai bot commented Dec 22, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 pmd (7.8.0)
src/main/java/de/tum/cit/aet/artemis/core/config/SecurityConfiguration.java

The following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration.

src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketSecurityConfiguration.java

The following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration.

Walkthrough

This pull request encompasses updates across multiple files in the Artemis project, focusing on dependency version upgrades, configuration refinements, and minor security configuration adjustments. The changes span build configuration files, Docker configurations, documentation, and Java source code. Key modifications include updating library versions in build.gradle and gradle.properties, refining Nginx and Docker Compose configurations, updating database migration documentation, and making subtle changes to WebSocket and security configurations.

Changes

File Change Summary
build.gradle Updated nimbus-jose-jwt from 9.47 to 9.48 and gradle-tooling-api from 8.11.1 to 8.12
docker/nginx/nginx.conf Updated base image to nginx:1.27.3-alpine-slim, added worker and server configurations
docs/admin/database.rst Updated Docker image versions for MySQL and PostgreSQL, clarified migration instructions
docs/dev/setup/docker-compose.rst Updated MySQL Docker image version, added Docker Compose setup details
gradle.properties Updated versions: Spring Boot to 3.4.1, Logback to 1.5.15, Liquibase plugin to 2.2.2
src/main/java/de/tum/cit/aet/artemis/core/config/SecurityConfiguration.java Renamed filterChain method to securityFilterChain
src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketSecurityConfiguration.java Restructured WebSocket security configuration, extended AbstractSecurityWebSocketMessageBrokerConfigurer

Possibly related PRs

Suggested Labels

dependencies, server, ready for review, tests

Suggested Reviewers

  • florian-glombik
  • SimonEntholzer
  • pzdr7
  • az108
  • Jan-Thurner
  • BBesrour
  • magaupp
  • dfuchss

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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 or @coderabbitai title anywhere in the PR title to generate the title automatically.

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

@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 (3)
src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketSecurityConfiguration.java (1)

15-19: Keep an eye on the Spring Security issue.
These comments explaining why @EnableWebSocketSecurity is commented out are helpful. Remember to remove or adjust these comments when upgrading to a Spring Security version where the issue is resolved.

src/main/java/de/tum/cit/aet/artemis/core/config/SecurityConfiguration.java (1)

Line range hint 168-190: Renaming method and refining permission policy.
Renaming “filterChain” to “securityFilterChain” improves clarity and readability. The switch to “permissionsPolicyHeader” is a neat approach. Validate that this change does not break existing tests or integration scenarios.

docs/dev/setup/docker-compose.rst (1)

Line range hint 308-324: Consider adding security-related environment variables

While the MySQL configuration is functional, consider adding security-related environment variables such as:

  • MYSQL_ROOT_PASSWORD for production environments
  • MYSQL_USER and MYSQL_PASSWORD for a non-root user
        environment:
-         - MYSQL_ALLOW_EMPTY_PASSWORD=yes
+         - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
+         - MYSQL_USER=${MYSQL_USER}
+         - MYSQL_PASSWORD=${MYSQL_PASSWORD}
          - MYSQL_DATABASE=Artemis
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35d113e and 097ec17.

⛔ Files ignored due to path filters (5)
  • docker/mysql.yml is excluded by !**/*.yml
  • docker/nginx.yml is excluded by !**/*.yml
  • docker/postgres.yml is excluded by !**/*.yml
  • src/main/kubernetes/artemis/statefulsets/artemis-mysql.yml is excluded by !**/*.yml
  • src/test/resources/config/application.yml is excluded by !**/*.yml
📒 Files selected for processing (7)
  • build.gradle (2 hunks)
  • docker/nginx/nginx.conf (1 hunks)
  • docs/admin/database.rst (2 hunks)
  • docs/dev/setup/docker-compose.rst (1 hunks)
  • gradle.properties (3 hunks)
  • src/main/java/de/tum/cit/aet/artemis/core/config/SecurityConfiguration.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketSecurityConfiguration.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docker/nginx/nginx.conf
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/de/tum/cit/aet/artemis/core/config/SecurityConfiguration.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketSecurityConfiguration.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

🔇 Additional comments (8)
src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketSecurityConfiguration.java (2)

8-9: Imports look good.
No issues found with these import statements. They follow the coding guidelines by avoiding star imports.


21-40: Ensure inbound WebSocket security rules are tested thoroughly.
The custom inbound configuration looks appropriate. However, the deny rule on MESSAGE and SUBSCRIBE types is quite restrictive unless it is specifically intended. Verify that this matches your application's requirements.

Would you like a script to search for areas that rely on WebSocket MESSAGE/SUBSCRIBE events?

gradle.properties (3)

10-10: Spring Boot version bumped to 3.4.1.
Ensure that any known issues or breaking changes in 3.4.1 have been addressed. It’s good to review the release notes for compatibility.


34-34: Logback version bumped to 1.5.15.
No immediate concerns. Check if any config changes are required for advanced logging features or appenders used in your codebase.


51-51: Liquibase plugin version updated to 2.2.2.
Review Liquibase release notes to ensure that any schema migration changes or new functionalities do not affect your deployment pipeline.

build.gradle (2)

421-421: Upgrade to nimbus-jose-jwt:9.48 detected.
This upgrade is important for security. Check the existing JWT usage to confirm there are no deprecations or breaking changes.


535-535: gradle-tooling-api bumped to 8.12.
This update generally aligns well with Gradle 8.12. Confirm backward compatibility with any build scripts referencing older Gradle functionalities.

docs/dev/setup/docker-compose.rst (1)

308-308: MySQL version is consistent

The MySQL version (9.1.0) matches the version specified in the database migration documentation, maintaining consistency across the codebase.

docs/admin/database.rst Show resolved Hide resolved
@krusche krusche added this to the 7.8.0 milestone Dec 22, 2024
@krusche krusche merged commit 4e1f491 into develop Dec 22, 2024
25 of 30 checks passed
@krusche krusche deleted the chore/update-server-dependencies branch December 22, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Pull requests that affect the corresponding module docker documentation server Pull requests that update Java code. (Added Automatically!) tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

1 participant