Skip to content

Conversation

@mensfeld
Copy link
Member

@mensfeld mensfeld commented Oct 5, 2025

close #621
close #614

@mensfeld mensfeld requested a review from Copilot October 5, 2025 09:30
@mensfeld mensfeld self-assigned this Oct 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors test topic names to use dynamically generated UUIDs instead of hardcoded strings. The goal is to normalize topic names across the test suite to avoid conflicts and ensure test isolation.

Key changes:

  • Introduces a TestTopics module that generates unique topic names with UUID suffixes
  • Replaces all hardcoded topic name strings throughout the test suite with calls to the new module
  • Updates topic creation logic in the test setup to use the new dynamic topic names

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/spec_helper.rb Adds TestTopics module for dynamic topic generation and updates topic creation setup
spec/lib/rdkafka/producer_spec.rb Replaces hardcoded topic names with TestTopics method calls
spec/lib/rdkafka/producer/partitions_count_cache_spec.rb Updates topic variables to use TestTopics.unique
spec/lib/rdkafka/producer/delivery_report_spec.rb Updates topic name to use TestTopics.unique
spec/lib/rdkafka/producer/delivery_handle_spec.rb Updates topic references to use TestTopics methods
spec/lib/rdkafka/metadata_spec.rb Updates topic references to use TestTopics methods
spec/lib/rdkafka/consumer_spec.rb Updates all topic references to use TestTopics methods
spec/lib/rdkafka/admin_spec.rb Updates topic references to use TestTopics methods
spec/lib/rdkafka/admin/*_spec.rb Updates topic references and removes unnecessary require statements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

retry
end

def notify_listener(listener, &block)
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

The consumer variable is not defined in this context. This line appears to be within the notify_listener function but no consumer is being passed to the function or created locally.

Suggested change
def notify_listener(listener, &block)
def notify_listener(consumer, &block)

Copilot uses AI. Check for mistakes.
TestTopics.example_topic => 1
}.each do |topic, partitions|
create_topic_handle = admin.create_topic(topic.to_s, partitions, 1)
create_topic_handle = admin.create_topic(topic, partitions, 1)
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Removing the .to_s call may cause issues if the TestTopics methods ever return non-string values. Consider adding explicit string conversion for safety.

Suggested change
create_topic_handle = admin.create_topic(topic, partitions, 1)
create_topic_handle = admin.create_topic(topic.to_s, partitions, 1)

Copilot uses AI. Check for mistakes.
@mensfeld mensfeld merged commit 34883eb into master Oct 5, 2025
82 checks passed
@mensfeld mensfeld deleted the normalize-topics-names branch October 5, 2025 15:35
mensfeld added a commit to karafka/karafka-rdkafka that referenced this pull request Oct 5, 2025
* small api syncs (karafka#706)

* small api syncs

* fix branch ref

* Update confluentinc/cp-kafka Docker tag to v8.0.1 (karafka#708)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.260.0 (karafka#707)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.261.0 (karafka#709)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.262.0 (karafka#710)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.263.0 (karafka#713)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update actions/cache action to v4.3.0 (karafka#714)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* verify kafka warnings, verify features (karafka#715)

* Normalize topics names (karafka#717)

* normalize topics names

* small remarks

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
mensfeld added a commit to karafka/karafka-rdkafka that referenced this pull request Oct 9, 2025
* small api syncs (karafka#706)

* small api syncs

* fix branch ref

* Update confluentinc/cp-kafka Docker tag to v8.0.1 (karafka#708)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.260.0 (karafka#707)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.261.0 (karafka#709)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.262.0 (karafka#710)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ruby/setup-ruby action to v1.263.0 (karafka#713)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update actions/cache action to v4.3.0 (karafka#714)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* verify kafka warnings, verify features (karafka#715)

* Normalize topics names (karafka#717)

* normalize topics names

* small remarks

* stabilize spec (karafka#718)

* Update dependency ruby to v3.4.7 (karafka#721)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update peter-evans/repository-dispatch action to v4 (karafka#722)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* v0.22.1

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Use independent spec topics Normalize test topics naming convention

2 participants