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

fix(ci): remove sqlness state in success #4313

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

waynexia
Copy link
Member

@waynexia waynexia commented Jul 8, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

Change the --preserve-state logic to dump tempdir unconditionally and remove it in success. In case the log is cleaned on panic.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of data directories to ensure proper cleanup and exit behavior.
    • Updated SQL queries to allow more flexible matching of timestamps in the Start_time field.
  • Improvements

    • Adjusted the column order in the result set for better logical grouping of data.

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@waynexia waynexia requested a review from a team as a code owner July 8, 2024 03:17
Copy link
Contributor

coderabbitai bot commented Jul 8, 2024

Walkthrough

The primary updates involve improvements in handling temporary directories and SQL query adjustments for timestamp flexibility. Changes include an alteration to how the data_home directory is managed, cleaner exit conditions, and updates to SQL patterns and column orders for better Start_time handling in the cluster_info results.

Changes

File Change Summary
tests/runner/src/main.rs Updated handling of data_home, changed cleanup condition, added removal of data directory.
tests/cases/standalone/information_schema/cluster_info.result Modified Start_time regex pattern and adjusted column order in SQL results.
tests/cases/standalone/information_schema/cluster_info.sql Updated regex pattern for the Start_time field in SQL queries for flexible timestamp matching.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Runner
    participant Env
    User->>Runner: Execute main function
    Runner->>Runner: Obtain data_home using into_path()
    Runner->>Env: Create new environment with data_home
    Runner->>User: Process data
    alt Preserve state
        Runner->>User: Exit without removing data_home
    else
        Runner->>User: Print "Removing state"
        Runner->>Runner: Remove data_home directory
    end
Loading

Poem

In the code's deep warren, a change is found,
Where data homes now sturdily bound.
Cleanup’s a breeze, no mess left behind,
SQL times flex, more patterns to find.
Here’s to progress, tidy and grand,
A bunny’s work, all carefully planned! 🐇✨


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 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.
  • 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.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Jul 8, 2024
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 58f991b and bd72fd3.

Files selected for processing (1)
  • tests/runner/src/main.rs (2 hunks)
Additional comments not posted (5)
tests/runner/src/main.rs (5)

85-85: LGTM!

The change to use temp_dir.into_path() is appropriate and aligns with the new requirements for cleanup.


110-110: LGTM!

Cloning data_home ensures the original path is preserved for later use in cleanup.


115-115: LGTM!

Inverting the condition aligns with the new requirement to remove the data directory unless preserve_state is explicitly set.


116-116: LGTM!

The updated message correctly informs the user about the removal of the state directory.


117-117: LGTM!

The change ensures that the temporary directory is cleaned up properly, preventing any leftover state from affecting future test runs. The use of tokio::fs::remove_dir_all is appropriate for asynchronous directory removal.

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.85%. Comparing base (e5730a3) to head (f0b4f6e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4313      +/-   ##
==========================================
- Coverage   85.11%   84.85%   -0.27%     
==========================================
  Files        1060     1060              
  Lines      187648   187648              
==========================================
- Hits       159720   159230     -490     
- Misses      27928    28418     +490     

killme2008 and others added 2 commits July 7, 2024 22:11
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bd72fd3 and 6811960.

Files selected for processing (2)
  • tests/cases/standalone/information_schema/cluster_info.result (2 hunks)
  • tests/cases/standalone/information_schema/cluster_info.sql (2 hunks)
Files skipped from review due to trivial changes (1)
  • tests/cases/standalone/information_schema/cluster_info.result
Additional comments not posted (3)
tests/cases/standalone/information_schema/cluster_info.sql (3)

8-8: LGTM!

The updated regex pattern for Start_time is more flexible and should match various timestamp formats.


16-16: Consistent regex update for Start_time.

The regex pattern update for Start_time matches the change at line 8, ensuring consistency.


26-26: Consistent regex update for Start_time.

The regex pattern update for Start_time matches the changes at lines 8 and 16, ensuring consistency.

@waynexia waynexia added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@waynexia waynexia added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@WenyXu WenyXu enabled auto-merge July 8, 2024 12:16
@WenyXu WenyXu added this pull request to the merge queue Jul 8, 2024
Merged via the queue into GreptimeTeam:main with commit 9686113 Jul 8, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants