Skip to content

🧪 Add unit tests for KeyPart::to_strs conversion#66

Merged
bashandbone merged 3 commits into
mainfrom
testing/add-keypart-to-strs-test-18160120789405461786
Mar 13, 2026
Merged

🧪 Add unit tests for KeyPart::to_strs conversion#66
bashandbone merged 3 commits into
mainfrom
testing/add-keypart-to-strs-test-18160120789405461786

Conversation

@bashandbone
Copy link
Copy Markdown
Contributor

🎯 What: The testing gap addressed
This PR adds test coverage for the KeyPart::to_strs method in crates/recoco-core/src/base/value.rs, closing a testing gap by formally validating the function that converts key components to string sequences.

📊 Coverage: What scenarios are now tested
The new test_key_part_to_strs test covers string array creation for all possible variants in the KeyPart enum:

  • KeyPart::Bytes (verifies base64 conversion)
  • KeyPart::Str
  • KeyPart::Bool
  • KeyPart::Int64
  • KeyPart::Range
  • KeyPart::Uuid
  • KeyPart::Date
  • KeyPart::Struct (validates recursive conversion of nested keys)

Result: The improvement in test coverage
The code now safely and reliably guarantees proper string array representations for KeyPart evaluation.


PR created automatically by Jules for task 18160120789405461786 started by @bashandbone

Add comprehensive test cases in `crates/recoco-core/src/base/value.rs` covering
the conversion of all `KeyPart` variants (Bytes, Str, Bool, Int64, Range, Uuid,
Date, Struct) into string arrays using the `to_strs()` method. This ensures that
key parts are correctly encoded according to expectation, particularly checking base64
conversion for bytes and string formatting for numbers, bools, UUIDs, and dates.

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings March 13, 2026 02:42
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 13, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
recoco-docs 2a1b8e4 Commit Preview URL

Branch Preview URL
Mar 13 2026, 03:10 AM

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hi @bashandbone, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link
Copy Markdown
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

Adds unit test coverage for KeyPart::to_strs, validating string conversion for each KeyPart variant (including nested Struct).

Changes:

  • Added a new unit test test_key_part_to_strs covering Bytes, Str, Bool, Int64, Range, Uuid, Date, and nested Struct conversions.
  • Asserts expected string outputs including base64 for Bytes and recursive flattening for Struct.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/recoco-core/src/base/value.rs Outdated
Comment thread crates/recoco-core/src/base/value.rs Outdated
bashandbone and others added 2 commits March 12, 2026 23:09
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
@bashandbone bashandbone merged commit 2dbba8b into main Mar 13, 2026
8 of 10 checks passed
@bashandbone bashandbone deleted the testing/add-keypart-to-strs-test-18160120789405461786 branch March 13, 2026 03:10
@github-actions
Copy link
Copy Markdown
Contributor

🤖 I'm sorry @bashandbone, but I was unable to process your request. Please see the logs for more details.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hey @bashandbone,

Thanks for your contribution to codeweaver! 🧵

You need to agree to the CLA first... 🖊️

Before we can accept your contribution, you need to agree to our Contributor License Agreement (CLA).

To agree to the CLA, please comment:

I read the contributors license agreement and I agree to it.

Those exact words are important1, so please don't change them. 😉

You can read the full CLA here: Contributor License Agreement


@bashandbone has signed the CLA.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Footnotes

  1. Our bot needs those exact words to recognize that you agree to the CLA.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants