Skip to content

test: inline .avsc schema refs to prevent flaky Kafka tests #1744

Merged
asyncapi-bot merged 1 commit intoasyncapi:masterfrom
SanidhyaMadheshia:fix-issue-1742
Oct 16, 2025
Merged

test: inline .avsc schema refs to prevent flaky Kafka tests #1744
asyncapi-bot merged 1 commit intoasyncapi:masterfrom
SanidhyaMadheshia:fix-issue-1742

Conversation

@SanidhyaMadheshia
Copy link
Contributor

@SanidhyaMadheshia SanidhyaMadheshia commented Oct 15, 2025

Resolves : #1742

Target File: generator/packages/templates/clients/kafka/test/fixtures/asyncapi-adeo.yml

Summary of Changes:

  • Removed external $ref references to .avsc files.
  • Converted both .avsc files from JSON to YAML.
  • Inlined the converted schema content directly into the AsyncAPI YAML file.

Validation:

  • Verified the updated AsyncAPI document on studio.asyncapi.com
  • Confirmed there are 0 validation issues.

Summary by CodeRabbit

  • New Features
    • Inlined self-contained schemas for CostingRequest and CostingResponse payloads, including nested records and enums.
  • Improvements
    • Added detailed field metadata (descriptions, examples) and constraints (e.g., numeric bounds).
    • Introduced structured error and calculation result items with arrays and nullable fields.
  • Breaking Changes
    • Payload shapes for CostingRequest and CostingResponse have changed due to replacing external references with inline definitions; downstream consumers may need to update parsing/validation.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2025

⚠️ No Changeset found

Latest commit: 60d2505

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@asyncapi-bot
Copy link
Contributor

What reviewer looks at during PR review

The following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.

  1. PR Title: Use a concise title that follows our Conventional Commits guidelines and clearly summarizes the change using imperative mood (it means spoken or written as if giving a command or instruction, like "add new helper for listing operations")

    Note - In Generator, prepend feat: or fix: in PR title only when PATCH/MINOR release must be triggered.

  2. PR Description: Clearly explain the issue being solved, summarize the changes made, and mention the related issue.

    Note - In Generator, we use Maintainers Work board to track progress. Ensure the PR Description includes Resolves #<issue-number> or Fixes #<issue-number> this will automatically close the linked issue when the PR is merged and helps automate the maintainers workflow.

  3. Documentation: Update the relevant Generator documentation to accurately reflect the changes introduced in the PR, ensuring users and contributors have up-to-date guidance.

  4. Comments and JSDoc: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions, so others can easily understand and use the code.

  5. DRY Code: Ensure the code follows the Don't Repeat Yourself principle. Look out for duplicate logic that can be reused.

  6. Test Coverage: Ensure the new code is well-tested with meaningful test cases that pass consistently and cover all relevant edge cases.

  7. Commit History: Contributors should avoid force-pushing as much as possible. It makes it harder to track incremental changes and review the latest updates.

  8. Template Design Principles Alignment: While reviewing template-related changes in the packages/ directory, ensure they align with the Assumptions and Principles. If any principle feels outdated or no longer applicable, start a discussion these principles are meant to evolve with the project.

  9. Reduce Scope When Needed: If an issue or PR feels too large or complex, consider splitting it and creating follow-up issues. Smaller, focused PRs are easier to review and merge.

  10. Bot Comments: As reviewers, check that contributors have appropriately addressed comments or suggestions made by automated bots. If there are bot comments the reviewer disagrees with, react to them or mark them as resolved, so the review history remains clear and accurate.

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Walkthrough

Replaces external AVRO $ref payloads with fully inlined AVRO-like schemas for CostingRequestPayload and CostingResponsePayload in the AsyncAPI fixture. Adds nested record and enum definitions, field metadata, examples, and constraints directly within the single YAML file.

Changes

Cohort / File(s) Summary
AsyncAPI fixture inline AVRO schemas
packages/templates/clients/kafka/test/__fixtures__/asyncapi-adeo.yml
Removed external AVSC $refs for costingRequestV1 and costingResponse; added comprehensive inline schemas for CostingRequestPayload and CostingResponsePayload, including nested records/enums, field docs/examples, and constraints.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly and concisely describes the primary change of inlining external .avsc schema references to improve Kafka test stability, matching the modifications in the pull request and providing sufficient context for readers.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@SanidhyaMadheshia SanidhyaMadheshia changed the title fix: inline .avsc schema refs to prevent flaky Kafka tests (#1742) fix: inline .avsc schema refs to prevent flaky Kafka tests Oct 15, 2025
Copy link

@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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between adca1e4 and 60d2505.

📒 Files selected for processing (1)
  • packages/templates/clients/kafka/test/__fixtures__/asyncapi-adeo.yml (2 hunks)

@derberg derberg changed the title fix: inline .avsc schema refs to prevent flaky Kafka tests test: inline .avsc schema refs to prevent flaky Kafka tests Oct 16, 2025
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

Thanks a lot @SanidhyaMadheshia

I only changed PR title as this is a test's related change and no release is needed. Also update description to make sure github will close related issue automatically after we merge this PR.

Now let's wait for tests run

@derberg
Copy link
Member

derberg commented Oct 16, 2025

Thanks again @SanidhyaMadheshia

/rtm

@asyncapi-bot asyncapi-bot merged commit 9a09fae into asyncapi:master Oct 16, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky tests for kafka cause of schemas pointing $ref to website

3 participants

Comments