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: Add architecture test for query capitalization #7994

Merged
merged 30 commits into from
Feb 24, 2024

Conversation

Strohgelaender
Copy link
Contributor

@Strohgelaender Strohgelaender commented Feb 4, 2024

Checklist

General

Motivation and Context

@Query content should follow our SQL style guide.

Description

Added an architecture test that extracts keywords and checks if they are written in upper case.

Steps for Testing

code review

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Summary by CodeRabbit

  • Refactor
    • Converted Long to long in method parameters and return types for exercise and student IDs in StudentParticipationRepository.java.
    • Updated comparison for isMuted and isHidden fields using IS TRUE instead of = true in UserRepository.java.
  • Bug Fixes
    • Ensured consistency in SQL query syntax for better performance.
    • Fixed issues with query logic and method signatures related to muting and hiding users.
  • Tests
    • Introduced new tests for SQL query style consistency.
    • Modified and added repository tests for improved coverage and eager loading of related entities.
  • Chores
    • Adjusted user-related methods for enhanced user group management clarity.

@Strohgelaender Strohgelaender requested a review from Hialus February 8, 2024 09:11
@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Feb 13, 2024
@Strohgelaender Strohgelaender marked this pull request as ready for review February 13, 2024 14:08
@Strohgelaender Strohgelaender requested a review from a team as a code owner February 13, 2024 14:08
Copy link

coderabbitai bot commented Feb 13, 2024

Walkthrough

The updates across various Java repository and test files in the Artemis project focus on standardizing SQL query syntax, refining method signatures, and enhancing performance. Key changes include switching parameter types from Long to long, updating SQL keywords to uppercase for consistency, refining casting syntax, and improving query logic. Additionally, new tests ensure adherence to SQL style guidelines and repository methods have been optimized for effective data handling and user management.

Changes

File Path Change Summary
.../repository/AttachmentUnitRepository.java
.../repository/CourseRepository.java
.../repository/ExamRepository.java
.../repository/StudentParticipationRepository.java
.../repository/iris/IrisMessageRepository.java
Changed parameter type from Long to long.
.../repository/BuildLogStatisticsEntryRepository.java
.../repository/CompetencyProgressRepository.java
.../repository/StatisticsRepository.java
.../repository/metis/ConversationParticipantRepository.java
Modified SQL keywords to uppercase (IN, AS).
.../repository/CourseRepository.java
.../repository/ResultRepository.java
Updated casting syntax to CAST(... AS ...).
.../repository/ExamRepository.java Updated ordering and query conditions to uppercase (ASC, IN) and changed parameter types.
.../repository/ModelElementRepository.java
.../repository/ParticipantScoreRepository.java
Updated SQL queries for proper casing of aliases and sorting criteria.
.../repository/UserRepository.java Changed comparison for boolean fields to IS TRUE.
.../test/.../ArchitectureTest.java Introduced a test for uppercase SQL style.
.../repository/ParticipationTestRepository.java
.../repository/ProgrammingExerciseTestRepository.java
.../repository/UserTestRepository.java
Refactored queries and methods for improved data handling.
.../user/UserUtilService.java Replaced method for clear user group management.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

coolchock
coolchock previously approved these changes Feb 17, 2024
Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

code lgtm

Co-authored-by: Julian Christl <julian.christl@tum.de>
julian-christl
julian-christl previously approved these changes Feb 18, 2024
Copy link
Member

@julian-christl julian-christl left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the test!

Copy link
Member

@Hialus Hialus left a comment

Choose a reason for hiding this comment

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

Code looks good to me now. Thanks for the improvements

@MaximilianAnzinger MaximilianAnzinger added ready to merge maintainer-approved The feature maintainer has approved the PR and removed ready for review labels Feb 21, 2024
@krusche krusche merged commit 21b809d into develop Feb 24, 2024
21 of 28 checks passed
@krusche krusche deleted the chore/sql-caps-arch-test branch February 24, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-approved The feature maintainer has approved the PR ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants