Skip to content

fix: alb_log regex #1302

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

Merged
merged 6 commits into from
Apr 26, 2025
Merged

Conversation

nikhilsinhaparseable
Copy link
Contributor

@nikhilsinhaparseable nikhilsinhaparseable commented Apr 25, 2025

Summary by CodeRabbit

  • Style
    • Reformatted log format definitions for improved readability and consistency without altering any matching logic or fields.
  • Chores
    • Enhanced the build process and CI workflow by patching a dependency’s build configuration to ensure smoother Kafka feature compilation.
    • Removed redundant patching step from coverage workflow for streamlined CI execution.

Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

The changes include two main updates: First, the resources/formats.json file was reformatted from a compact JSON style to a pretty-printed style with consistent indentation and expanded arrays, without altering any regex patterns, fields, or their order. Second, the Dockerfile.kafka was modified to add a preparatory step before building the Rust project with Kafka support. This step patches the CMakeLists.txt file in the librdkafka crate to update the minimum required CMake version from 3.2 to 3.5, ensuring compatibility before proceeding with the build. Additionally, the GitHub Actions workflow for Kafka builds was updated to include this patching step, while the same step was removed from the coverage workflow.

Changes

File(s) Change Summary
resources/formats.json Reformatted JSON for clarity: expanded arrays/objects, added indentation and line breaks, no changes to logic or patterns.
Dockerfile.kafka Added preparatory step to patch librdkafka's CMakeLists.txt to require CMake 3.5 instead of 3.2 before building Kafka.
.github/workflows/build.yaml Added step to patch librdkafka/CMakeLists.txt updating CMake version before Kafka build; minor formatting fixes.
.github/workflows/coverage.yaml Removed the step that patched librdkafka/CMakeLists.txt before coverage checks.

Possibly related PRs

  • Update to coverage #1285: Adds the "Find and fix librdkafka CMakeLists.txt" step to the coverage workflow, directly related but opposite in effect to this PR’s removal of that step.

Poem

In the warren, logs once tightly packed,
Now breathe easy, all neatly stacked.
Patterns unchanged, but order anew,
Indented lines, a clearer view.
A patch applied to build with care,
Kafka’s CMake now meets the fare.
🐇✨


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.
    • 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 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 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 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: 0

🧹 Nitpick comments (1)
resources/formats.json (1)

72-113: Verify the intended ALB log regex fix
The PR title indicates a fix to the alb_log pattern, but the diff only reformats the existing regex. Please confirm that this formatted pattern still meets the original requirements—e.g., matching all ALB protocols (http|https|h2|ws|wss), capturing every named group correctly, and handling edge cases. It would be valuable to add a unit or integration test against representative ALB log lines to guard against regressions.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 49ea3bd and d3c5d15.

📒 Files selected for processing (1)
  • resources/formats.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default aarch64-apple-darwin
  • GitHub Check: Build Default x86_64-apple-darwin
  • GitHub Check: Build Kafka aarch64-apple-darwin
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
  • GitHub Check: coverage
🔇 Additional comments (1)
resources/formats.json (1)

1-1420: Reformatted JSON only; no semantic changes detected
The diff is purely a pretty-print of the existing formats.json file. All entries, regex patterns, capture group names, and field lists remain unchanged in logic and order. The file is valid JSON with consistent two-space indentation.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 25, 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: 0

🧹 Nitpick comments (2)
Dockerfile.kafka (2)

38-56: Enable strict error handling in the multi-command RUN

To ensure every step in this multi-line RUN fails immediately and surfaces errors, consider prefixing your shell invocation with set -euxo pipefail. This will make debugging easier and prevent silent failures:

RUN set -euxo pipefail && \
    mkdir -p src && echo "fn main() {}" > src/main.rs && \
    cargo fetch && \
    #

43-50: Improve rdkafka-sys lookup and patch logic

The current approach hardcodes /usr/local/cargo/registry/src and only patches the first match. For better portability and to handle multiple crate versions:

  1. Reference the cargo registry dynamically via ${CARGO_HOME:-/usr/local/cargo}
  2. Restrict find depth to speed up the scan
  3. Iterate over all matching directories

Example refactor:

- RDKAFKA_SYS_DIR=$(find /usr/local/cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1) && \
- sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt" && \
+ export CARGO_REG_SRC="${CARGO_HOME:-/usr/local/cargo}/registry/src"
+ find "$CARGO_REG_SRC" -maxdepth 2 -type d -name "rdkafka-sys-*" | \
+   while read -r dir; do
+     sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$dir/librdkafka/CMakeLists.txt"
+   done && \
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d3c5d15 and c390969.

📒 Files selected for processing (1)
  • Dockerfile.kafka (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default aarch64-apple-darwin
  • GitHub Check: Build Default x86_64-apple-darwin
  • GitHub Check: Build Kafka aarch64-apple-darwin
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: coverage
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
🔇 Additional comments (1)
Dockerfile.kafka (1)

57-58: Leverage Docker layer caching for dependencies

Great use of a dummy main.rs in a separate build step to precompile dependencies. This two-phase build (dependencies first, then real source) maximizes Docker layer cache efficiency, speeding up iterative builds when only application code changes.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 25, 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

🧹 Nitpick comments (1)
.github/workflows/build.yaml (1)

133-133: Remove trailing whitespace
Several newly added lines contain trailing spaces, triggering YAMLlint errors. Please strip the trailing whitespace on lines 133, 138, 142, 145, 148, 151, and 154.

Also applies to: 138-138, 142-142, 145-145, 148-148, 151-151, 154-154

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 133-133: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c390969 and a12d1f7.

📒 Files selected for processing (2)
  • .github/workflows/build.yaml (1 hunks)
  • .github/workflows/coverage.yaml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/coverage.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/build.yaml

[error] 133-133: trailing spaces

(trailing-spaces)


[error] 138-138: trailing spaces

(trailing-spaces)


[error] 142-142: trailing spaces

(trailing-spaces)


[error] 145-145: trailing spaces

(trailing-spaces)


[error] 148-148: trailing spaces

(trailing-spaces)


[error] 151-151: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default aarch64-apple-darwin
  • GitHub Check: Build Default x86_64-apple-darwin
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: coverage

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

♻️ Duplicate comments (1)
.github/workflows/build.yaml (1)

167-171: Cross-platform sed -i syntax implemented
You’ve correctly applied OS-specific logic for sed -i on macOS vs. Linux, addressing the portability concern raised earlier.

🧹 Nitpick comments (1)
.github/workflows/build.yaml (1)

150-179: Trim trailing whitespace & ensure newline at EOF
YAMLlint reports trailing spaces on lines 150, 152, 156, 159, 162, 165, 172, 179 and a missing newline at end of file. Please remove all trailing spaces and add a final blank line to conform to YAML standards.

🧰 Tools
🪛 actionlint (1.7.4)

150-150: this step is for running action since it contains at least one of "uses", "with" keys, but also contains "run" key which is used for running shell command

(syntax-check)

🪛 YAMLlint (1.35.1)

[error] 152-152: trailing spaces

(trailing-spaces)


[error] 156-156: trailing spaces

(trailing-spaces)


[error] 159-159: trailing spaces

(trailing-spaces)


[error] 162-162: trailing spaces

(trailing-spaces)


[error] 165-165: trailing spaces

(trailing-spaces)


[error] 172-172: trailing spaces

(trailing-spaces)


[error] 179-179: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a12d1f7 and e2a3088.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build.yaml

150-150: this step is for running action since it contains at least one of "uses", "with" keys, but also contains "run" key which is used for running shell command

(syntax-check)

🪛 YAMLlint (1.35.1)
.github/workflows/build.yaml

[error] 152-152: trailing spaces

(trailing-spaces)


[error] 156-156: trailing spaces

(trailing-spaces)


[error] 159-159: trailing spaces

(trailing-spaces)


[error] 162-162: trailing spaces

(trailing-spaces)


[error] 165-165: trailing spaces

(trailing-spaces)


[error] 172-172: trailing spaces

(trailing-spaces)


[error] 179-179: trailing spaces

(trailing-spaces)


[error] 181-181: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: coverage
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 26, 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

🧹 Nitpick comments (1)
.github/workflows/build.yaml (1)

175-175: Add newline at end-of-file.
YAML linters expect a trailing newline to avoid new-line-at-end-of-file errors. Please ensure the file ends with a blank line.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bd32964 and 3ab336e.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/build.yaml

[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Build Kafka aarch64-apple-darwin
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: coverage
🔇 Additional comments (3)
.github/workflows/build.yaml (3)

5-7: Ensure globs are parsed correctly in paths-ignore.
You moved from quoted to unquoted glob patterns for docs/**, helm/**, and assets/** while keeping "**.md" quoted. Although YAML supports unquoted simple globs, this inconsistency could be confusing or lead to unexpected behavior. Please verify that the CI is still ignoring those paths as intended, or consider quoting all patterns for uniformity.


119-139: Linux-specific patch step is well-scoped.
Good use of if: runner.os == 'Linux' to isolate the CMakeLists.txt version bump on Linux runners, complete with a backup, in-place edit, and diff output.


140-159: macOS patch step uses correct sed -i '' syntax.
The macOS variant correctly applies the in-place edit with sed -i '', mirrors the Linux step’s backup-and-diff approach, and is gated by if: runner.os == 'macOS'.

@nitisht nitisht merged commit 83bc666 into parseablehq:main Apr 26, 2025
14 checks passed
@nikhilsinhaparseable nikhilsinhaparseable deleted the alb-log-regex-fix branch April 26, 2025 04:15
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