Skip to content

Improve wait_for_file docs and constants#26

Merged
leynos merged 9 commits intomainfrom
codex/add-rustdoc-comment-for-wait_for_file
Aug 3, 2025
Merged

Improve wait_for_file docs and constants#26
leynos merged 9 commits intomainfrom
codex/add-rustdoc-comment-for-wait_for_file

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jul 31, 2025

Summary

  • document the wait_for_file re-export
  • use named constants for wait parameters in listener steps

Testing

  • make lint
  • make test

https://chatgpt.com/codex/tasks/task_e_688be00363688322b31033440634887a

Summary by Sourcery

Document the wait_for_file re-export in test-support and replace magic retry values in listener_steps tests with named constants

Enhancements:

  • Replace inline retry count and delay literals with SOCKET_RETRY_COUNT and SOCKET_RETRY_DELAY_MS constants in listener_steps tests

Documentation:

  • Add documentation comment for wait_for_file and re-export it from util in test-support

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 31, 2025

Reviewer's Guide

Replace magic literals with named constants in listener tests and add documentation for the wait_for_file re-export in the test-support module to improve readability and convenience.

File-Level Changes

Change Details Files
Introduce named constants for wait parameters in listener steps
  • Define SOCKET_RETRY_COUNT and SOCKET_RETRY_DELAY_MS constants
  • Replace literal retry values with constants in the wait_for_file call
tests/steps/listener_steps.rs
Document and re-export wait_for_file in test-support module
  • Add doc comment explaining the wait_for_file re-export
  • Re-export wait_for_file from util for convenience in tests
test-support/src/lib.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 31, 2025

Warning

Rate limit exceeded

@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 80ac2b9 and 181cb6e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • crates/comenqd/Cargo.toml (1 hunks)
  • crates/comenqd/src/config.rs (2 hunks)
  • crates/comenqd/src/daemon.rs (2 hunks)
  • crates/comenqd/src/logging.rs (1 hunks)

Summary by CodeRabbit

  • Chores

    • Updated dependency management to use workspace versions for development dependencies.
    • Added the rstest testing framework to the workspace dependencies.
    • Improved release workflow to trigger only on valid semantic version tags.
    • Removed unused test imports for cleaner code.
  • Documentation

    • Enhanced documentation for test utilities, providing clearer usage guidance.
  • Refactor

    • Centralised and standardised retry parameters for file polling in tests, improving maintainability.

Walkthrough

Document the re-exported wait_for_file function in the test support library with a descriptive comment. In the listener test, replace hardcoded retry parameters with named constants for retry count and delay, updating the call to wait_for_file accordingly. No changes are made to code logic or exported entity signatures.

Changes

Cohort / File(s) Change Summary
Test Support Utilities and Documentation
test-support/src/util.rs, test-support/src/lib.rs
Add SOCKET_RETRY_COUNT and SOCKET_RETRY_DELAY constants; re-export them and document wait_for_file.
Listener Test Retry Constants Update
tests/steps/listener_steps.rs
Import and use SOCKET_RETRY_COUNT and SOCKET_RETRY_DELAY constants in wait_for_file call, replacing hardcoded values.
Dependency and Workflow Updates
Cargo.toml, crates/comenq/Cargo.toml, crates/comenqd/Cargo.toml, .github/workflows/release.yml, crates/comenq/src/client.rs
Add rstest and tempfile as dev dependencies with workspace versions; refine release workflow tag pattern; remove unused rstest import.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

In the land where tests await their fate,
Constants step in—no more magic eight!
Comments now guide with wisdom clear,
Retry and delay spelled out right here.
With clarity shining in every file,
Reviewers, approach with a knowing smile!

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/add-rustdoc-comment-for-wait_for_file

🪧 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 generate unit tests to generate unit tests for 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
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes - here's some feedback:

  • Consider moving SOCKET_RETRY_COUNT and SOCKET_RETRY_DELAY_MS into the test-support util module so they can be reused across tests and avoid duplication.
  • In the doc comment for the wait_for_file re-export, add a brief usage example and clarify the units and meaning of the retry parameters for better clarity.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider moving SOCKET_RETRY_COUNT and SOCKET_RETRY_DELAY_MS into the test-support util module so they can be reused across tests and avoid duplication.
- In the doc comment for the wait_for_file re-export, add a brief usage example and clarify the units and meaning of the retry parameters for better clarity.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ec8f010 and c65f982.

📒 Files selected for processing (2)
  • test-support/src/lib.rs (1 hunks)
  • tests/steps/listener_steps.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.rs: Clippy warnings MUST be disallowed.
Fix any warnings emitted during tests in the code itself rather than silencing them.
Where a function is too long, extract meaningfully named helper functions adhering to separation of concerns and CQRS.
Where a function has too many parameters, group related parameters in meaningfully named structs.
Where a function is returning a large error consider using Arc to reduce the amount of data returned.
Write unit and behavioural tests for new functionality. Run both before and after making any change.
Every module must begin with a module level (//!) comment explaining the module's purpose and utility.
Document public APIs using Rustdoc comments (///) so documentation can be generated with cargo doc.
Prefer immutable data and avoid unnecessary mut bindings.
Handle errors with the Result type instead of panicking where feasible.
Avoid unsafe code unless absolutely necessary and document any usage clearly.
Place function attributes after doc comments.
Do not use return in single-line functions.
Use predicate functions for conditional criteria with more than two branches.
Lints must not be silenced except as a last resort.
Lint rule suppressions must be tightly scoped and include a clear reason.
Prefer expect over allow.
Prefer .expect() over .unwrap().
Use concat!() to combine long string literals rather than escaping newlines with a backslash.
Prefer semantic error enums. Derive std::error::Error (via the thiserror crate) for any condition the caller might inspect, retry, or map to an HTTP status.
Use an opaque error only at the app boundary. Use eyre::Report for human-readable logs; these should not be exposed in public APIs.
Never export the opaque type from a library. Convert to domain enums at API boundaries, and to eyre only in the main main() entrypoint or top-level async task.

Files:

  • tests/steps/listener_steps.rs
  • test-support/src/lib.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • tests/steps/listener_steps.rs
  • test-support/src/lib.rs
🧬 Code Graph Analysis (1)
tests/steps/listener_steps.rs (1)
test-support/src/util.rs (1)
  • wait_for_file (22-30)
🔇 Additional comments (1)
tests/steps/listener_steps.rs (1)

73-78: Verify that 100 ms total wait is sufficient on CI runners.

wait_for_file now waits at most 10 × 10 ms = 100 ms. On slow or loaded CI hosts the listener might take longer to create the socket, causing sporadic test failures. Increase the window or make it configurable if flakiness appears.

Comment thread test-support/src/lib.rs
Comment thread tests/steps/listener_steps.rs Outdated
Copy link
Copy Markdown
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: 4

🔭 Outside diff range comments (1)
tests/steps/listener_steps.rs (1)

64-71: Increase socket retry budget for CI reliability

Raise the retry count to 20 and the delay to 25 ms in test-support so slow runners don’t time out:

• In test-support/src/util.rs
– Change SOCKET_RETRY_COUNT from 10 to 20
– Change SOCKET_RETRY_DELAY from Duration::from_millis(10) to Duration::from_millis(25)

• In test-support/src/lib.rs
– Update the commented example usages to reflect the new values

Proposed diff:

--- a/test-support/src/util.rs
+++ b/test-support/src/util.rs
@@ -7,7 +7,7 @@ pub const SOCKET_RETRY_COUNT: u32 = 10;
 pub const SOCKET_RETRY_COUNT: u32 = 20;
 
- pub const SOCKET_RETRY_DELAY: Duration = Duration::from_millis(10);
+ pub const SOCKET_RETRY_DELAY: Duration = Duration::from_millis(25);

 // Wait for a file to appear, retrying on failure
 pub async fn wait_for_file(…
--- a/test-support/src/lib.rs
+++ b/test-support/src/lib.rs
@@ -20,7 +20,7 @@ pub use util::{SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
 // use test_support::{wait_for_file, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
 // let found = wait_for_file(path, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY).await;
 // SOCKET_RETRY_COUNT = 20, SOCKET_RETRY_DELAY = 25 ms
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c65f982 and 94ec09a.

📒 Files selected for processing (3)
  • test-support/src/lib.rs (1 hunks)
  • test-support/src/util.rs (1 hunks)
  • tests/steps/listener_steps.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.rs: Clippy warnings MUST be disallowed.
Fix any warnings emitted during tests in the code itself rather than silencing them.
Where a function is too long, extract meaningfully named helper functions adhering to separation of concerns and CQRS.
Where a function has too many parameters, group related parameters in meaningfully named structs.
Where a function is returning a large error consider using Arc to reduce the amount of data returned.
Write unit and behavioural tests for new functionality. Run both before and after making any change.
Every module must begin with a module level (//!) comment explaining the module's purpose and utility.
Document public APIs using Rustdoc comments (///) so documentation can be generated with cargo doc.
Prefer immutable data and avoid unnecessary mut bindings.
Handle errors with the Result type instead of panicking where feasible.
Avoid unsafe code unless absolutely necessary and document any usage clearly.
Place function attributes after doc comments.
Do not use return in single-line functions.
Use predicate functions for conditional criteria with more than two branches.
Lints must not be silenced except as a last resort.
Lint rule suppressions must be tightly scoped and include a clear reason.
Prefer expect over allow.
Prefer .expect() over .unwrap().
Use concat!() to combine long string literals rather than escaping newlines with a backslash.
Prefer semantic error enums. Derive std::error::Error (via the thiserror crate) for any condition the caller might inspect, retry, or map to an HTTP status.
Use an opaque error only at the app boundary. Use eyre::Report for human-readable logs; these should not be exposed in public APIs.
Never export the opaque type from a library. Convert to domain enums at API boundaries, and to eyre only in the main main() entrypoint or top-level async task.

Files:

  • test-support/src/util.rs
  • tests/steps/listener_steps.rs
  • test-support/src/lib.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • test-support/src/util.rs
  • tests/steps/listener_steps.rs
  • test-support/src/lib.rs

Comment thread test-support/src/lib.rs Outdated
Comment thread test-support/src/lib.rs
Comment thread test-support/src/util.rs
Comment thread tests/steps/listener_steps.rs
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Aug 3, 2025

@coderabbitai Please create new GitHub issues for the following:

64-71: Increase socket retry budget for CI reliability

Raise the retry count to 20 and the delay to 25 ms in test-support so slow runners don’t time out:

• In test-support/src/util.rs
– Change SOCKET_RETRY_COUNT from 10 to 20
– Change SOCKET_RETRY_DELAY from Duration::from_millis(10) to Duration::from_millis(25)

• In test-support/src/lib.rs
– Update the commented example usages to reflect the new values

Proposed diff:

--- a/test-support/src/util.rs
+++ b/test-support/src/util.rs
@@ -7,7 +7,7 @@ pub const SOCKET_RETRY_COUNT: u32 = 10;
 pub const SOCKET_RETRY_COUNT: u32 = 20;
 
- pub const SOCKET_RETRY_DELAY: Duration = Duration::from_millis(10);
+ pub const SOCKET_RETRY_DELAY: Duration = Duration::from_millis(25);

 // Wait for a file to appear, retrying on failure
 pub async fn wait_for_file(…

--- a/test-support/src/lib.rs
+++ b/test-support/src/lib.rs
@@ -20,7 +20,7 @@ pub use util::{SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
 // use test_support::{wait_for_file, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
 // let found = wait_for_file(path, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY).await;
 // SOCKET_RETRY_COUNT = 20, SOCKET_RETRY_DELAY = 25 ms

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 3, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@leynos I'll create a GitHub issue for the socket retry budget improvements for CI reliability.


🏁 Script executed:

#!/bin/bash
# Create GitHub issue for socket retry budget improvements
gh issue create \
  --title "Increase socket retry budget for CI reliability" \
  --body "## Description

Raise the retry count to 20 and the delay to 25 ms in test-support so slow runners don't time out during CI execution.

## Changes Required

### In test-support/src/util.rs
- Change SOCKET_RETRY_COUNT from 10 to 20  
- Change SOCKET_RETRY_DELAY from Duration::from_millis(10) to Duration::from_millis(25)

### In test-support/src/lib.rs
- Update the commented example usages to reflect the new values

## Proposed Implementation

\`\`\`diff
--- a/test-support/src/util.rs
+++ b/test-support/src/util.rs
@@ -7,7 +7,7 @@ pub const SOCKET_RETRY_COUNT: u32 = 10;
 pub const SOCKET_RETRY_COUNT: u32 = 20;
 
- pub const SOCKET_RETRY_DELAY: Duration = Duration::from_millis(10);
+ pub const SOCKET_RETRY_DELAY: Duration = Duration::from_millis(25);

 // Wait for a file to appear, retrying on failure
 pub async fn wait_for_file(…

--- a/test-support/src/lib.rs
+++ b/test-support/src/lib.rs
@@ -20,7 +20,7 @@ pub use util::{SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
 // use test_support::{wait_for_file, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
 // let found = wait_for_file(path, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY).await;
 // SOCKET_RETRY_COUNT = 20, SOCKET_RETRY_DELAY = 25 ms
\`\`\`

## Context

Related to PR #26: https://github.com/leynos/comenq/pull/26
Requested by: @leynos" \
  --assignee leynos

Length of output: 1437


@leynos I've successfully created GitHub issue #41 for increasing the socket retry budget for CI reliability. The issue includes:

  • Clear description of the problem (slow CI runners timing out)
  • Specific changes needed for both files
  • Your proposed diff implementation
  • Context linking back to this PR
  • Assignment to you as requested

You can view the issue at: #41

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Aug 3, 2025

@coderabbitai Please suggest how best to resolve the following merge conflict:

test-support/src/lib.rs:

//! Test support utilities.

pub mod daemon;
pub mod util;

<<<<<<< codex/add-rustdoc-comment-for-wait_for_file
/// Maximum number of times to poll for an expected file.
pub use util::SOCKET_RETRY_COUNT;

/// Delay between polls when waiting for a file to appear.
///
/// Multiply by [`SOCKET_RETRY_COUNT`] for the worst-case wait duration.
pub use util::SOCKET_RETRY_DELAY;

/// Wait for a file to appear, retrying with a fixed delay.
///
/// This is re-exported from [`util`] for convenience in tests.
///
/// # Arguments
/// * `path` – Path to the file that is expected to be created.
/// * `tries` – Maximum number of polling attempts.
/// * `delay` – Pause between attempts as a [`std::time::Duration`].
///   The total wait time is `tries * delay`.
///
/// # Returns
/// `true` if the file appears within `tries` attempts, otherwise `false`.
///
/// # Examples
/// ```rust,no_run
/// use std::path::Path;
/// use test_support::{wait_for_file, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
///
/// #[tokio::main]
/// async fn main() {
///     let path = Path::new("/tmp/example.sock");
///     let found = wait_for_file(path, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY).await;
///     assert!(found);
/// }
/// ```
=======
pub use daemon::{octocrab_for, temp_config};
>>>>>>> main
pub use util::wait_for_file;

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 3, 2025

Tip

For best results, initiate chat on the files or code changes.

@leynos The merge conflict shows that main has added new daemon re-exports (octocrab_for and temp_config) while your branch added documented re-exports for the socket retry constants and comprehensive documentation for wait_for_file.

Here's the recommended resolution that combines both sets of changes:

//! Test support utilities.

pub mod daemon;
pub mod util;

// Re-exports from daemon module (added in main)
pub use daemon::{octocrab_for, temp_config};

// Re-exports from util module with documentation (from your branch)
/// Maximum number of times to poll for an expected file.
pub use util::SOCKET_RETRY_COUNT;

/// Delay between polls when waiting for a file to appear.
///
/// Multiply by [`SOCKET_RETRY_COUNT`] for the worst-case wait duration.
pub use util::SOCKET_RETRY_DELAY;

/// Wait for a file to appear, retrying with a fixed delay.
///
/// This is re-exported from [`util`] for convenience in tests.
///
/// # Arguments
/// * `path` – Path to the file that is expected to be created.
/// * `tries` – Maximum number of polling attempts.
/// * `delay` – Pause between attempts as a [`std::time::Duration`].
///   The total wait time is `tries * delay`.
///
/// # Returns
/// `true` if the file appears within `tries` attempts, otherwise `false`.
///
/// # Examples
/// ```rust,no_run
/// use std::path::Path;
/// use test_support::{wait_for_file, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY};
///
/// #[tokio::main]
/// async fn main() {
///     let path = Path::new("/tmp/example.sock");
///     let found = wait_for_file(path, SOCKET_RETRY_COUNT, SOCKET_RETRY_DELAY).await;
///     assert!(found);
/// }
/// ```
pub use util::wait_for_file;

This resolution:

  1. Preserves the daemon re-exports from main
  2. Keeps all your documented utility re-exports
  3. Maintains logical grouping (daemon exports first, then util exports)
  4. Preserves the comprehensive documentation you added

After applying this resolution, run git add test-support/src/lib.rs to mark the conflict as resolved.

@leynos leynos merged commit 9412e58 into main Aug 3, 2025
1 of 2 checks passed
@leynos leynos deleted the codex/add-rustdoc-comment-for-wait_for_file branch August 3, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant