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

Feature/optimize #441

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Feature/optimize #441

merged 3 commits into from
Jan 23, 2024

Conversation

theshadowco
Copy link
Member

@theshadowco theshadowco commented Jan 23, 2024

Описание

Оптимизации и исправления ошибок

  • проблемы с ролями
  • мультиязычные строки
  • формы

Связанные задачи

Closes

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Дополнительно

Summary by CodeRabbit

  • New Features

    • Expanded the .gitignore rules to prevent tracking of specific Gradle XML files.
    • Updated dependencies for improved functionality and compatibility.
    • Enhanced memory efficiency through string interning in various classes.
    • Added new role rights to enhance user permission granularity.
  • Bug Fixes

    • Improved error messages in EnumConverter to aid in debugging.
  • Refactor

    • Removed an obsolete method from MDReader.
    • Utilized string interning in RoleDataConverter for better performance.
  • Style

    • Standardized file header comments across multiple files.
  • Documentation

    • Updated file headers to reflect the latest changes.
  • Chores

    • No user-impacting chores to report.

Copy link

coderabbitai bot commented Jan 23, 2024

Walkthrough

The recent updates focus on enhancing performance through memory optimization and string interning, upgrading dependency versions, refining error messaging, and expanding role rights enumeration. Comments and whitespace have been tidied across multiple files, and an obsolete method was removed for cleaner code.

Changes

File Path Change Summary
.gitignore Added rule to ignore Gradle_*.xml files.
build.gradle.kts Updated bsl-common-library to "0.5.1" and supportconf to "0.13.1".
src/main/java/com/github/.../storage/RoleData.java
src/main/java/com/github/.../support/MultiLanguageString.java
Updated header comments; added new fields for string interning; refactored methods for efficiency.
src/main/java/com/github/.../support/RoleRight.java Modified header comments; added new enum constants.
src/main/java/com/github/.../reader/FakeReader.java
src/main/java/com/github/.../reader/MDReader.java
src/main/java/com/github/.../reader/common/xstream/ExtendXStream.java
Reformatted file header comments; removed readExternalSource method in MDReader.java.
src/main/java/com/github/.../reader/common/converter/EnumConverter.java
src/main/java/com/github/.../reader/common/converter/RoleDataConverter.java
Improved error messages in EnumConverter.java; used string interning in RoleDataConverter.java.
src/main/java/com/github/.../reader/designer/converter/FormElementConverter.java Added logging for error handling; imported ExtendXStream.

🐇
In the realm of code, where the rabbits dwell,
Changes hop through files, casting a spell.
Strings interned, dependencies soar,
A cleaner warren than ever before. 🌟
🐇

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.

Copy link

Test Results

 53 files  ±0   53 suites  ±0   14s ⏱️ -13s
206 tests ±0  206 ✅ ±0  0 💤 ±0  0 ❌ ±0 
208 runs  ±0  208 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f00f3f4. ± Comparison against base commit a8af664.

Copy link

github-actions bot commented Jan 23, 2024

Test Results

 53 files  ±0   53 suites  ±0   17s ⏱️ -10s
206 tests ±0  206 ✅ ±0  0 💤 ±0  0 ❌ ±0 
208 runs  ±0  208 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f00f3f4. ± Comparison against base commit a8af664.

♻️ This comment has been updated with latest results.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a8af664 and f00f3f4.
Files ignored due to path filters (2)
  • src/test/resources/fixtures/mdclasses/Roles.Роль1.json is excluded by: !**/*.json
  • src/test/resources/fixtures/ssl_3_1/Roles.БазовыеПраваБСП.json is excluded by: !**/*.json
Files selected for processing (11)
  • .gitignore (1 hunks)
  • build.gradle.kts (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/RoleData.java (3 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/support/MultiLanguageString.java (4 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/support/RoleRight.java (2 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/FakeReader.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java (2 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/EnumConverter.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/RoleDataConverter.java (2 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendXStream.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/FormElementConverter.java (1 hunks)
Files skipped from review due to trivial changes (3)
  • src/main/java/com/github/_1c_syntax/bsl/reader/FakeReader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendXStream.java
Additional comments: 15
.gitignore (1)
  • 15-15: The addition of the Gradle_*.xml pattern to the .gitignore file is correct and will help to ignore Gradle XML files that should not be tracked in version control.
src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/EnumConverter.java (1)
  • 52-52: The change to include the class name in the IllegalArgumentException message in EnumConverter.java is a good practice as it provides more context in the error message, which can be helpful for debugging.
src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/FormElementConverter.java (3)
  • 27-27: The import of ExtendXStream is correctly added to support the logging functionality within the FormElementConverter.java.
  • 31-31: The addition of the @Slf4j annotation is appropriate for enabling logging in the FormElementConverter.java.
  • 45-47: The error handling for NumberFormatException with logging is a good improvement. It provides better error reporting when an unknown type is encountered during the unmarshalling process.
src/main/java/com/github/_1c_syntax/bsl/mdo/storage/RoleData.java (3)
  • 26-26: The import of GenericInterner is correctly added to support the new RIGHT_INTERNER field in RoleData.java.
  • 50-50: The addition of the RIGHT_INTERNER field is a good practice for memory management, as it will help to intern instances of Right and reduce memory footprint.
  • 102-103: The update to the Right class's toString and EqualsAndHashCode annotations to include the value field is correct, as it ensures that the value field is considered in the string representation and equality checks of Right objects.
src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/RoleDataConverter.java (2)
  • 27-27: The import of GenericInterner is correctly added to support the interning functionality in the RoleDataConverter.java.
  • 94-94: The use of RoleData.RIGHT_INTERNER.intern in the readRight method is a good optimization to manage memory more efficiently by interning Right objects.
src/main/java/com/github/_1c_syntax/bsl/mdo/support/MultiLanguageString.java (3)
  • 44-44: The addition of the stringInterner field is a good practice for memory efficiency, as it will help to intern string keys and reduce memory footprint.
  • 51-55: The new constructor in MultiLanguageString that interns language keys is a good improvement for memory management.
  • 115-117: Refactoring the putAll method to use the putContent method for interning language keys is a good practice for code reuse and maintainability.
src/main/java/com/github/_1c_syntax/bsl/mdo/support/RoleRight.java (1)
  • 99-102: The addition of new enum constants STANDARD_AUTHENTICATION_CHANGE, SESSION_STANDARD_AUTHENTICATION_CHANGE, and SESSION_OS_AUTHENTICATION_CHANGE to the RoleRight enum is correct and seems to be aligned with the PR's objectives related to role management.
build.gradle.kts (1)
  • 59-60: The updates to the dependency versions for bsl-common-library and supportconf in build.gradle.kts are correct and follow semantic versioning best practices.

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
80.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@theshadowco theshadowco merged commit e69b628 into develop Jan 23, 2024
15 checks passed
@theshadowco theshadowco deleted the feature/optimize branch January 23, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant