Skip to content

v0.2.8 - New format Markdown string function (#663)

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Nov 14:32
· 2 commits to main since this release
fd550b8

🌟 Summary

Ultralytics Actions v0.2.8 focuses on smarter, cleaner automation: better AI-powered PR reviews, richer GitHub issue templates, and powerful markdown/code formatting tools for both files and in-memory strings. ✨


📊 Key Changes

  • 🧩 New markdown string formatter (core of this release)

    • Added process_markdown_string(...) to format Python and Bash code blocks inside in-memory markdown strings, not just files.
    • Reuses existing formatting logic (process_markdown_file, format_code_with_ruff, format_bash_with_prettier, update_markdown_file) for consistent behavior.
    • Safely handles temp files via tempfile.TemporaryDirectory() so nothing is written permanently.
  • 🤖 Smarter, more focused AI PR reviews

    • Switched review generation to the gpt-5.1-codex model for better code understanding.
    • Introduced should_skip_file() and refined skip patterns to avoid generated/minified/irrelevant files.
    • Added safeguards:
      • Ignore non-file paths and files larger than 100 KB.
      • Limit file content to a 5,000-character snippet, with a clear ... (truncated) marker.
    • Added prompt controls:
      • Uses a conservative token budget estimate to stay under MAX_PROMPT_CHARS.
      • Caps inline review comments at MAX_REVIEW_COMMENTS = 8.
      • Sorts comments by severity, then file, then line number using SEVERITY_RANK.
    • Improves GitHub API usage for reviews and comments:
      • Proper pagination (?per_page=100) for reviews and comments.
      • Correct delete endpoint for inline comments (/pulls/comments/{id}).
      • More robust HTTP status handling: only treat unexpected status codes as hard errors.
    • Adds detailed debug logging (system and user prompts) specifically when running in ultralytics/actions for easier troubleshooting.
  • 🧹 Consistent Prettier formatting at 120 characters

    • Updated action.yml and update_markdown_code_blocks.py so Prettier runs with --print-width 120 for:
      • JS/TS, CSS, JSON, YAML, HTML, Vue, Svelte, etc.
      • Shell scripts via prettier-plugin-sh.
      • Markdown files (including docs, with existing --tab-width 4 preserved).
    • Ensures generated shell code blocks in markdown also use the 120-character width.
  • 🧭 Cleaner URL handling & GitHub client refactor

    • Simplified clean_url() to more reliably strip quotes, trailing punctuation, .git@main, and git+, including nested cases.
    • Refactored GitHubClient to parse and store owner and repo_name once, then reuse them in:
      • is_org_member
      • get_label_ids (GraphQL)
      • block_user
      • get_pr_contributors
    • Improved HTTP request handling:
      • Separates “status is expected” from “status is successful”.
      • Only raises errors when status is unexpected, not just because it’s 4xx, making workflows more resilient.
  • 📋 New GitHub issue templates & support links

  • 🔢 Version bump

    • actions/__init__.py version updated from 0.2.7 to 0.2.8.

🎯 Purpose & Impact

  • 🚀 Easier programmatic docs & content generation

    • process_markdown_string(...) lets you format markdown that lives purely in memory (e.g., generated docs, bot comments, PR descriptions) without touching the filesystem.
    • Ensures Python and Bash code blocks are consistently formatted whether they come from files or are dynamically generated.
  • 🤖 Higher-quality, more reliable PR reviews

    • Using gpt-5.1-codex should improve code understanding and the relevance of automated feedback.
    • Smarter file skipping, size limits, and content truncation keep the AI focused on meaningful changes and avoid wasting tokens on noise.
    • Comment capping, severity-based sorting, and concise-guidance produce fewer but higher-value review comments, making them easier for maintainers to act on.
    • More robust API handling reduces flaky failures and edge cases when dismissing old reviews or deleting previous comments.
  • 📏 Cleaner, more readable code and docs

    • A unified 120-character line width across JS/TS, shell scripts, and markdown reduces wrapping noise and makes diffs easier to review.
    • Consistent formatting across CI, local runs, and doc-generation tools leads to more predictable outputs and fewer formatting-only PR changes.
  • 🧱 Stronger infrastructure for automation

    • Refined URL cleaning avoids broken or malformed links in generated content and summaries.
    • Centralized repo owner/name handling simplifies future integrations with GitHub APIs and reduces subtle bugs.
    • Clearer error semantics (expected vs. unexpected statuses) help workflows fail less often while still surfacing true misconfigurations.
  • 🙋 Better support and community interaction

    • Structured issue templates help users provide the right information the first time, making it faster to reproduce and fix problems.
    • Direct links to docs and community channels encourage self-help and discussion, reducing friction for both users and maintainers.

Overall, v0.2.8 makes Ultralytics Actions more developer-friendly, more robust in CI, and better suited for automated documentation and review workflows. 💼✨

What's Changed

Full Changelog: v0.2.7...v0.2.8