Skip to content

Conversation

@rescrv
Copy link
Contributor

@rescrv rescrv commented Jun 4, 2025

Description of changes

Returns the keys that are on the log in order, and the type of log operation.

Test plan

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

N/A

@github-actions
Copy link

github-actions bot commented Jun 4, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Jun 4, 2025

This PR introduces a new Rust binary, chroma-inspect-log-contents, which connects to a log service and outputs log keys and operation types for a specified collection. It fetches and prints records in batches, providing a simple inspection utility for the log state.

This summary was automatically generated by @propel-code-bot

async fn main() {
let args = std::env::args().skip(1).collect::<Vec<_>>();
if args.len() != 2 {
eprintln!("USAGE: chroma-inspect-log-state [HOST] [COLLECTION_UUID]");
Copy link
Contributor

Choose a reason for hiding this comment

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

[BestPractice]

The error message and command line usage instruction don't match the actual binary name. The error message refers to chroma-inspect-log-state but the binary is named chroma-inspect-log-contents.

"{} {} {} {}",
i as usize + j,
record.log_offset,
record.record.as_ref().map(|r| r.operation).unwrap_or(4),
Copy link
Contributor

Choose a reason for hiding this comment

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

[BestPractice]

Magic number 4 is used for the default operation. Consider using a named constant or referencing the appropriate enum value to make the code more maintainable and understandable.

@rescrv rescrv requested a review from Sicheng-Pan June 6, 2025 15:33
rescrv added 2 commits June 9, 2025 08:28
@rescrv rescrv force-pushed the rescrv/inspect-log-contents branch from ba22817 to fa5645f Compare June 9, 2025 15:29
Copy link
Contributor

@Sicheng-Pan Sicheng-Pan left a comment

Choose a reason for hiding this comment

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

Remember to update the runbook

@rescrv rescrv merged commit 3ae15d2 into main Jun 10, 2025
73 checks passed
@rescrv rescrv deleted the rescrv/inspect-log-contents branch June 10, 2025 15:03
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
## Description of changes

Returns the keys that are on the log in order, and the type of log
operation.

## Test plan

- [X] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes

N/A
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.

3 participants