Skip to content

Conversation

@LinZhihao-723
Copy link
Member

@LinZhihao-723 LinZhihao-723 commented May 13, 2025

Description

The current taskfile doesn't have globstar enabled as mentioned in the official doc here. This triggers a bug that find $DIR/**/* wouldn't be resolved properly. We've seen this problem since some files under components/core/tests/ are not properly checked/formatted using the current linting workflow.

This PR solves this problem by adding shopt: ["globstar"] at the beginning of the main taskfile. To align with our settings in util taskfiles, we also set up the pipefall options as we did here.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Ensure all workflows passed.
  • Ensure the files can be successfully located using **/* under the subtasks.

Summary by CodeRabbit

  • Style

    • Improved formatting and readability of several test cases and configuration files without altering their logic or behaviour.
  • Chores

    • Updated configuration to enhance shell script safety and enable recursive file matching.

@LinZhihao-723 LinZhihao-723 requested a review from a team as a code owner May 13, 2025 20:17
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 13, 2025

Walkthrough

This update applies formatting changes to test files by adjusting line breaks and indentation in assertions and string formatting calls, without modifying test logic or behaviour. Additionally, the taskfile.yaml configuration is updated to enable specific shell options for improved script execution. No changes to public interfaces or exported entities are introduced.

Changes

File(s) Change Summary
components/core/tests/test-ir_encoding_methods.cpp Reformatted REQUIRE macro calls in two assertions for improved readability; no logic or behaviour changes.
components/core/tests/test-kql.cpp Reformatted fmt::vformat calls in two test sections to single-line expressions; no change to logic or behaviour.
components/core/tests/test-string_utils.cpp Reformatted a GIVEN description string in a test scenario to a multi-line format; no logic or behaviour changes.
taskfile.yaml Added set and shopt keys to enable shell options: -u, pipefail, and globstar; no other configuration changes.

Suggested reviewers

  • davidlion

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.


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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c7df3d and 2c1f544.

📒 Files selected for processing (5)
  • components/core/tests/test-ir_encoding_methods.cpp (2 hunks)
  • components/core/tests/test-kql.cpp (2 hunks)
  • components/core/tests/test-string_utils.cpp (1 hunks)
  • components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx (1 hunks)
  • taskfile.yaml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx
  • components/core/tests/test-kql.cpp
  • components/core/tests/test-ir_encoding_methods.cpp
  • components/core/tests/test-string_utils.cpp
🔇 Additional comments (6)
taskfile.yaml (1)

3-3: Enable globstar for recursive globs
Adding the shopt: ["globstar"] directive at the top level correctly enables double-star patterns across all tasks, ensuring that **/* globs behave as intended. This change aligns with Taskfile documentation and PR objectives.

components/core/tests/test-string_utils.cpp (1)

212-214: Maintain consistent multi-line formatting in GIVEN
The updated GIVEN block now splits the descriptive string onto a separate indented line, improving readability while preserving test semantics.

components/core/tests/test-kql.cpp (2)

283-284: Refactor fmt::vformat into a single-line assignment
Consolidating the vformat call enhances readability by reducing vertical space without losing clarity.


305-306: Preserve multi-line fmt::vformat for escaped namespace
The multi-line formatting in the escaped namespace case retains clear separation of parameters, aiding future maintenance.

components/core/tests/test-ir_encoding_methods.cpp (2)

711-712: Align multi-line REQUIRE assertion indentation
Splitting the condition across two lines improves legibility in the protocol validation test. Behaviour remains unchanged.


834-835: Refine multi-line assertion structure
The reformatted REQUIRE now places the comparison operand on its own line, aligning with the surrounding style.

Comment on lines 79 to 80
* @param root0
* @param root0.className
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Add explicit JSDoc @param entries for destructured props
The new @param root0 and @param root0.className annotations clarify the input props. For completeness, consider adding a brief description for the @return tag or swapping it with @returns for consistency with JSDoc conventions.

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

For the PR title, how about:

fix(taskfiles): Enable `globstar` in main taskfile so that `**/*` works properly in shell commands; Enable `pipefail` in main taskfile.

@LinZhihao-723 LinZhihao-723 changed the title fix(taskfile): Enable globstar option globally to allow double star globs to work. fix(taskfiles): Enable globstar in main taskfile so that **/* works properly in shell commands; Enable pipefail in main taskfile. May 13, 2025
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1f544 and 169a412.

📒 Files selected for processing (1)
  • taskfile.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-14, true)
🔇 Additional comments (1)
taskfile.yaml (1)

4-4: Enable recursive globbing with globstar
This addition ensures that **/* patterns correctly match files in nested directories across all subtasks, aligning with the PR goal of supporting double-star globs.

@@ -1,5 +1,8 @@
version: "3"

set: ["u", "pipefail"]
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Optional: Consider enabling exit-on-error (e)
The current set: ["u", "pipefail"] will treat unset variables as errors and cause pipelines to fail if any component fails, but individual failing commands in a pipeline may not abort the task immediately. It’s a common best practice to include e so that the shell exits on any error (equivalent to set -euo pipefail).

You can apply this diff if you want stricter fail-fast behaviour:

-set: ["u", "pipefail"]
+set: ["e", "u", "pipefail"]

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.

2 participants