Skip to content

fix: Исправление сортировки по умолчанию#10

Merged
Stivo182 merged 1 commit intomainfrom
fix/default-sort
May 14, 2025
Merged

fix: Исправление сортировки по умолчанию#10
Stivo182 merged 1 commit intomainfrom
fix/default-sort

Conversation

@Stivo182
Copy link
Owner

@Stivo182 Stivo182 commented May 14, 2025

Summary by CodeRabbit

  • New Features
    • Added a new "ПорядокПоУмолчанию" (Default Order) column to the benchmark report for improved ordering and sorting.
  • Bug Fixes
    • Improved column removal logic to ensure proper handling of hidden columns in the report.
  • Tests
    • Introduced a new test to verify default sorting by method name in the benchmark report.
    • Updated existing tests to include sorting order checks.

@coderabbitai
Copy link

coderabbitai bot commented May 14, 2025

Walkthrough

A new "DefaultOrder" column is integrated into the benchmark report, affecting column setup, data population, sorting, and hiding logic. Helper procedures and functions are added to manage this column. Tests are updated to verify the new default sorting behavior, including a new test procedure for default order sorting.

Changes

File(s) Change Summary
src/BenchmarkOneScript/core/Классы/ПостроительОтчетаБенчмарков.os Added "ПорядокПоУмолчанию" (DefaultOrder) column to report; updated column setup, data filling, sorting, hiding logic; added helper procedure and function for the new column.
tests/ТестыБенчмарков.os Added a new test for default sorting order; updated existing test to explicitly set sorting mode.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BenchmarkReportBuilder
    participant ReportTable

    User->>BenchmarkReportBuilder: Initiate report creation
    BenchmarkReportBuilder->>ReportTable: Add standard columns
    BenchmarkReportBuilder->>ReportTable: ДобавитьКолонкуПорядкаПоУмолчанию()
    BenchmarkReportBuilder->>ReportTable: Populate data rows with DefaultOrder values
    BenchmarkReportBuilder->>ReportTable: Sort rows by DefaultOrder (if sorting mode is default)
    BenchmarkReportBuilder->>ReportTable: Hide DefaultOrder column (if required)
    ReportTable-->>User: Return final report
Loading

Poem

In the land of code where benchmarks dwell,
A new column joins the tale to tell—
"DefaultOrder" lines up the rows just right,
Guiding reports through day and night.
Tests now check the order true,
🐇 Hopping forward, code anew!

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 58542b4 and 0f0029e.

📒 Files selected for processing (2)
  • src/BenchmarkOneScript/core/Классы/ПостроительОтчетаБенчмарков.os (7 hunks)
  • tests/ТестыБенчмарков.os (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: sonar / test
  • GitHub Check: build (windows-latest, stable)
  • GitHub Check: build (windows-latest, dev)
  • GitHub Check: build (macos-latest, dev)
  • GitHub Check: build (ubuntu-latest, dev)
  • GitHub Check: build (macos-latest, stable)
  • GitHub Check: build (ubuntu-latest, stable)
  • GitHub Check: sonar / test
  • GitHub Check: build (windows-latest, stable)
  • GitHub Check: build (windows-latest, dev)
  • GitHub Check: build (macos-latest, dev)
  • GitHub Check: build (macos-latest, stable)
  • GitHub Check: build (ubuntu-latest, dev)
  • GitHub Check: build (ubuntu-latest, stable)
🔇 Additional comments (10)
src/BenchmarkOneScript/core/Классы/ПостроительОтчетаБенчмарков.os (8)

53-53: Logical addition of the new DefaultOrder column

Good addition of the new column at the beginning of the column setup process, which is appropriate for what will become the primary sort column.


74-76: Clean implementation of the column addition procedure

The implementation uses the helper function to maintain consistent naming, which is a good practice.


187-187: Appropriate handling of DefaultOrder column visibility

Correctly adding the DefaultOrder column to the hidden columns list since it's used only for sorting and shouldn't be visible in the final report.


207-216: Improved column hiding implementation

The updated implementation now properly handles both string column names and column objects, making it more robust and ensuring hidden columns are correctly removed from both collections.


226-235: Well-designed sequential numbering logic

The implementation assigns a sequential numeric order based on changes in benchmark method name, which provides a stable ordering that persists across report generations.


237-237: Proper population of DefaultOrder value

Correctly assigns the numeric order to each row in the report.


359-359: Effective implementation of default sorting logic

This line ensures the DefaultOrder column is used as the primary sort key when default sorting is selected, which addresses the core issue being fixed in this PR.


412-414: Good use of helper function for naming consistency

Using a dedicated function to provide the column name ensures consistency throughout the code and makes future renaming easier.

tests/ТестыБенчмарков.os (2)

327-328: Explicit sorting mode configuration

Making the sorting mode explicit in this test provides clarity and ensures the test behavior is well-defined.


357-373: Comprehensive test for default sorting behavior

This test properly verifies the default sorting behavior by checking that the report rows are ordered correctly. It validates the implementation of the DefaultOrder column and sorting logic added in the main file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

@sonar-openbsl-ru-qa-bot
Copy link

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