Skip to content

This and that, mostly naming things#25

Merged
amotl merged 6 commits intomainfrom
more
May 15, 2025
Merged

This and that, mostly naming things#25
amotl merged 6 commits intomainfrom
more

Conversation

@coderabbitai
Copy link

coderabbitai bot commented May 11, 2025

Warning

Rate limit exceeded

@amotl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 4 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 c34496a and e46e16e.

📒 Files selected for processing (12)
  • CHANGES.md (2 hunks)
  • README.md (4 hunks)
  • docs/backlog.md (2 hunks)
  • docs/sandbox.md (1 hunks)
  • pyproject.toml (1 hunks)
  • src/cratedb_about/bundle/llmstxt.py (1 hunks)
  • src/cratedb_about/cli.py (2 hunks)
  • src/cratedb_about/outline/model.py (3 hunks)
  • src/cratedb_about/query/model.py (3 hunks)
  • tests/test_cli.py (1 hunks)
  • tests/test_outline.py (2 hunks)
  • tests/test_query.py (1 hunks)

"""

Walkthrough

The changes rename the CLI subcommand from build to bundle with a --format=llms-txt option, update related documentation, and adjust the outline API to use a .to_dict() method instead of an as_dict parameter. Constants and environment variables are renamed, new example queries are added, and tests and dependencies are updated accordingly.

Changes

File(s) Change Summary
src/cratedb_about/cli.py, src/cratedb_about/bundle/llmstxt.py, tests/test_cli.py Renamed CLI command from build to bundle with a --format option; updated log messages and test functions to reflect this change; added validation for the format option.
src/cratedb_about/outline/model.py, tests/test_outline.py Replaced as_dict parameter with a .to_dict() method via a new OutlineItems class; updated method signatures and test functions to use the new approach.
src/cratedb_about/query/model.py, tests/test_query.py Changed environment variable for context URL from CRATEDB_CONTEXT_URL to ABOUT_CONTEXT_URL; made it a class property; added new example questions and corresponding tests for URL override and default.
CHANGES.md, README.md, docs/backlog.md, docs/sandbox.md Updated documentation and changelogs to reflect the renaming of commands, constants, and environment variables; clarified instructions and examples; reorganized backlog tasks and marked completed items.
pyproject.toml Added the jaraco-classes<4 dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant LlmstxtBuilder

    User->>CLI: cratedb-about bundle --format=llms-txt --outdir=DIR
    CLI->>CLI: Validate format == "llms-txt"
    CLI->>LlmstxtBuilder: Instantiate and run with outdir
    LlmstxtBuilder->>LlmstxtBuilder: Bundle llms-txt files
    LlmstxtBuilder->>CLI: Return success
    CLI->>User: Output ready message
Loading

Possibly related PRs

Suggested reviewers

  • kneth
  • surister
  • WalBeh
  • bmunkholm

Poem

🐇✨
Bundle, bundle, hop and run,
The build command’s work is finally done!
Outlines now with .to_dict() shine,
And context URLs are quite divine.
Docs and tests all prance in line—
With every change, the code’s more fun,
Hooray for progress—onward we hop, one by one!

"""

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 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.

@amotl amotl changed the title This and that This and that, mostly naming things May 11, 2025
@amotl amotl requested review from kneth and surister May 11, 2025 23:56
@amotl amotl marked this pull request as ready for review May 11, 2025 23:56
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: 0

🧹 Nitpick comments (1)
docs/backlog.md (1)

6-6: Format the bare URL to follow Markdown best practices.

The static analysis tool detected a bare URL at line 6, which should be properly formatted according to Markdown best practices.

-  https://github.com/crate/about/issues/24
+  [#24](https://github.com/crate/about/issues/24)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

6-6: Bare URL used
null

(MD034, no-bare-urls)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8883b5e and e0165b6.

📒 Files selected for processing (12)
  • CHANGES.md (2 hunks)
  • README.md (4 hunks)
  • docs/backlog.md (2 hunks)
  • docs/sandbox.md (1 hunks)
  • pyproject.toml (1 hunks)
  • src/cratedb_about/bundle/llmstxt.py (1 hunks)
  • src/cratedb_about/cli.py (2 hunks)
  • src/cratedb_about/outline/model.py (3 hunks)
  • src/cratedb_about/query/model.py (3 hunks)
  • tests/test_cli.py (1 hunks)
  • tests/test_outline.py (2 hunks)
  • tests/test_query.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
tests/test_query.py (1)
src/cratedb_about/query/model.py (2)
  • Settings (39-71)
  • llms_txt_url (54-55)
src/cratedb_about/outline/model.py (1)
src/cratedb_about/util.py (1)
  • to_dict (18-19)
src/cratedb_about/cli.py (1)
src/cratedb_about/bundle/llmstxt.py (1)
  • LllmsTxtBuilder (14-39)
tests/test_outline.py (2)
src/cratedb_about/outline/model.py (2)
  • find_items (140-161)
  • to_dict (47-48)
src/cratedb_about/util.py (1)
  • to_dict (18-19)
🪛 markdownlint-cli2 (0.17.2)
docs/backlog.md

6-6: Bare URL used
null

(MD034, no-bare-urls)

🔇 Additional comments (34)
src/cratedb_about/outline/model.py (3)

44-48: Well-designed OutlineItems class implementation

The new OutlineItems class that subclasses list provides a clean way to add the to_dict() method to collections of OutlineItem objects. This follows good object-oriented design principles by extending functionality while maintaining compatibility with the list interface.


144-144: Good API improvement by simplifying the return type

Changing the return type annotation to OutlineItems makes the function signature clearer and more consistent. This improves the API design by ensuring a consistent return type.


161-161: Clean implementation of the fluent interface pattern

Returning an OutlineItems instance allows callers to use the .to_dict() method when needed, which is more intuitive than the previous as_dict parameter approach. This change follows the fluent interface pattern and makes the API more consistent.

pyproject.toml (1)

76-76:

Details

✅ Verification successful

Verify jaraco-classes compatibility with the project

The addition of "jaraco-classes<4" dependency supports the @classproperty decorator needed for the environment variable renaming from "CRATEDB_CONTEXT_URL" to "ABOUT_CONTEXT_URL".


🏁 Script executed:

#!/bin/bash
# Check for any version conflicts with the new dependency
pip install jaraco-classes<4 && pip freeze | grep jaraco

Length of output: 128


🏁 Script executed:

#!/bin/bash
# Properly quote the version specifier to avoid shell redirection
pip install 'jaraco-classes<4'
# Verify the installed version
pip show jaraco-classes
# Check for any dependency conflicts
pip check

Length of output: 872


jaraco-classes<4 compatibility verified

Installed jaraco-classes<4 (resolved to 3.4.0) and its dependency more-itertools-10.7.0, then ran pip check—no broken requirements found. This confirms the new dependency is compatible and can safely be merged.

src/cratedb_about/bundle/llmstxt.py (2)

22-22: Updated log message for consistency with new command name

The log message has been updated from "Building llms-txt" to "Bundling llms-txt" to match the renamed CLI command (bundle instead of build).


27-27: Updated resource path matches module name change

The resource path has been correctly updated from "cratedb_about.build" to "cratedb_about.bundle", which aligns with the module renaming.

docs/sandbox.md (2)

9-9: Documentation text updated to match new terminology

The description has been changed from "Rebuild all the llms.txt files" to "Produce all the llms.txt files", which aligns with the more general "bundle" concept rather than "build".


12-12: Command updated to use the new CLI interface

The command has been properly updated to use the new bundle --format=llms-txt syntax instead of the previous build command.

CHANGES.md (2)

10-14: Clear and concise documentation of changes.

The changelog entries accurately reflect the changes described in the PR objectives, with proper documentation of the renaming of the subcommand, API interface improvements, new examples, and environment variable renaming.


24-24: Consistent correction in the v0.0.3 section.

The change correctly updates the subcommand name from build to bundle in the previous release notes, maintaining consistency with the renamed command.

tests/test_query.py (2)

76-77: Well-structured test for default URL value.

This test properly verifies the default behavior of the Settings.llms_txt_url property.

Note: This test has some overlap with test_model_settings() on line 14, but keeping it separate helps isolate testing of this specific property.


80-82: Good environment variable override test.

The test correctly verifies that the Settings.llms_txt_url property respects the environment variable override, using appropriate mocking techniques.

README.md (5)

92-92: Consistent command name update.

The section heading correctly reflects the renamed CLI subcommand from build to bundle.


138-139: API usage updated to more fluent interface.

The example code has been refactored from using the as_dict parameter to the more fluent .to_dict() method, improving code readability and consistency with modern Python practices.


151-154: Bundle section properly updated.

The section name and description have been updated to reflect the renamed CLI subcommand and clarify its purpose.


157-157: Command example updated with new format.

The CLI command example correctly shows the new syntax with bundle --format=llms-txt instead of just build.


181-182: Environment variable name updated consistently.

The documentation now correctly references the renamed environment variable ABOUT_CONTEXT_URL instead of CRATEDB_CONTEXT_URL.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

182-182: Bare URL used
null

(MD034, no-bare-urls)

src/cratedb_about/query/model.py (3)

5-5: Added classproperty import for improved class attribute implementation.

The import of classproperty from jaraco.classes.properties is appropriate for implementing the class-level property that will replace the static variable.


32-35: Added useful example questions for CrateDB.

The new example questions enhance the variety of queries users can make about CrateDB, covering important topics like query optimization, cluster health, storage consumption, and timestamp formatting.


53-56: Improved settings implementation with classproperty.

The refactoring from a static variable to a @classproperty method is a good improvement that:

  1. Makes the code more dynamic and testable
  2. Follows Python conventions for computed values
  3. Ensures the environment variable is read at access time rather than at module import time
  4. Correctly implements the environment variable renaming from CRATEDB_CONTEXT_URL to ABOUT_CONTEXT_URL
docs/backlog.md (2)

15-15: LGTM: Updated task phrasing for better clarity.

The task description now more clearly describes the planned interface change for the --optional flag.


26-33: LGTM: Completed tasks documentation properly updated.

All the relevant tasks from the PR objectives have been appropriately moved to the "Done" section, including:

  • Renaming build to bundle --format=llms-txt
  • Refactoring as_dict parameter to .to_dict() interface
  • Renaming environment variables for better consistency
src/cratedb_about/cli.py (5)

8-8: LGTM: Updated import path reflects new module structure.

The import path has been correctly updated to reference the new module location.


71-73: LGTM: Format option added with appropriate default.

The format option is correctly added with a default value of "llms-txt", aligning with the PR objective of changing build to bundle --format=llms-txt.


75-76: LGTM: Context now properly passed to the command function.

Adding @click.pass_context and updating the function signature ensures the context is available for error handling.


78-78: LGTM: Docstring updated for clarity.

The docstring now correctly describes the command's purpose of generating multiple llms.txt files.


80-81: LGTM: Format validation properly implemented.

The validation logic ensures the format is "llms-txt" and provides a helpful error message if not.

tests/test_cli.py (3)

47-47: LGTM: Test updated to reflect command renaming.

The test function and command reference have been correctly updated to reflect the renamed command, and the expected log output has been updated accordingly.

Also applies to: 53-53, 60-60


68-68: LGTM: Error handling test updated for renamed command.

The test for missing required options has been properly updated for the renamed command.

Also applies to: 74-74


84-97: LGTM: Added test coverage for invalid format handling.

Good addition of a test case to verify the command's behavior when given an invalid format option. This ensures the validation logic is working correctly.

tests/test_outline.py (4)

159-160: LGTM: Test updated to use the new fluent interface.

The test has been properly updated to call .to_dict() on the returned object instead of using the as_dict=True parameter, which aligns with the PR objective.


164-164: LGTM: Test name updated for consistency.

The test function name has been updated to reflect the new API naming convention, removing the _as_ part for better consistency.


180-181: LGTM: Test properly updated for the new API.

The test for finding items by title has been correctly updated to use the fluent .to_dict() interface rather than the previous as_dict parameter.


185-185: LGTM: Object variant test name updated for consistency.

The test function name has been properly updated to match the new naming pattern.

Copy link
Member

@kneth kneth left a comment

Choose a reason for hiding this comment

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

LGTM

@amotl amotl force-pushed the format-llms-txt branch from 939b770 to a663ef2 Compare May 15, 2025 11:13
Base automatically changed from format-llms-txt to main May 15, 2025 11:14
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.

2 participants