fix(platform): Improve Linear Search Block [SECRT-1880]#11967
fix(platform): Improve Linear Search Block [SECRT-1880]#11967Torantulino merged 5 commits intodevfrom
Conversation
SECRT-1880 - Add state field (with id, name, type) to Issue model for duplicate detection - Add State model for workflow state information - Update try_search_issues() to return createdAt, state, project, and assignee - Add max_results parameter (default 10, was ~50) to reduce token usage - Add team_name filter to scope results to specific team - Fix try_get_team_by_name() to return descriptive error when team not found - Add error output to LinearSearchIssuesBlock for graceful error handling - Add categories to LinearSearchIssuesBlock (PRODUCTIVITY, ISSUE_TRACKING)
WalkthroughThe Linear search block now supports limiting results and optional team filtering. The API and Issue model were expanded to include state, createdAt, project, and assignee. Team name resolution was added to convert human-friendly names to Linear team IDs. Changes
Sequence DiagramsequenceDiagram
actor User as "User"
participant Block as "LinearSearchBlock"
participant Client as "LinearAPIClient"
participant Linear as "Linear GraphQL API"
User->>Block: search_issues(term, team_name?, max_results?)
alt team_name provided
Block->>Client: try_get_team_by_name(team_name)
Client->>Linear: query teams by name
Linear-->>Client: team nodes
Client-->>Block: team_id
else no team_name
Block->>Block: team_id = None
end
Block->>Client: try_search_issues(term, first=max_results, teamId=team_id)
Client->>Linear: query issues (term, first, teamId) requesting state, createdAt, project, assignee
Linear-->>Client: issue nodes with expanded fields
Client-->>Block: list[Issue] (includes state, createdAt, project, assignee)
Block-->>User: search results
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
✏️ Tip: You can disable this entire section by setting 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/integrations/block-integrations/linear/issues.md (1)
92-96: 🛠️ Refactor suggestion | 🟠 MajorUpdate "How it works" section to reflect new filtering and limiting capabilities.
The section currently doesn't mention the
max_resultsparameter orteam_namefiltering, which are central to the improvements in this PR. As per coding guidelines, the "How It Works" section should include 1-2 paragraphs describing processing logic, validation, and error handling.📝 Proposed enhancement with processing details
<!-- MANUAL: how_it_works --> -This block searches for issues in Linear using a text query. It searches across issue titles, descriptions, and other fields to find matching issues. +This block searches for issues in Linear using a text query. It searches across issue titles, descriptions, and other fields to find matching issues. You can limit the number of results returned using the `max_results` parameter (default: 10, max: 100) to control token consumption and response size. -Returns a list of issues matching the search term. +Optionally filter results by team name to narrow searches to specific workspaces. If a team name is provided, the block resolves it to a team ID before searching. Returns matching issues with their state, creation date, project, and assignee information. If the search or team resolution fails, an error message is returned. <!-- END MANUAL -->As per coding guidelines, the "How It Works" section should provide a technical explanation including processing logic, validation, and error handling.
🧹 Nitpick comments (1)
docs/integrations/block-integrations/linear/issues.md (1)
103-103: Document the default value and valid range formax_results.Based on the PR objectives, the default is 10 and the valid range is 1–100. Including this information helps users understand the behavior without needing to consult additional documentation or test the block.
📝 Proposed documentation enhancement
-| max_results | Maximum number of results to return | int | No | +| max_results | Maximum number of results to return (default: 10, range: 1-100) | int | No |
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
docs/integrations/README.mddocs/integrations/block-integrations/linear/issues.md
🧰 Additional context used
📓 Path-based instructions (2)
docs/integrations/**/*.md
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/integrations/**/*.md: Provide a technical explanation of how the block functions in the 'How It Works' section, including 1-2 paragraphs describing processing logic, validation, error handling, or edge cases, with code examples in backticks when helpful
Provide exactly 3 practical use cases in the 'Use Case' section, formatted with bold headings followed by short one-sentence descriptions
Files:
docs/integrations/block-integrations/linear/issues.mddocs/integrations/README.md
docs/**/*.md
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/**/*.md: Keep documentation descriptions concise and action-oriented, focusing on practical, real-world scenarios
Use consistent terminology with other blocks and avoid overly technical jargon unless necessary in documentation
Files:
docs/integrations/block-integrations/linear/issues.mddocs/integrations/README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Seer Code Review
- GitHub Check: types
- GitHub Check: test (3.12)
- GitHub Check: test (3.13)
- GitHub Check: test (3.11)
- GitHub Check: Check PR Status
🔇 Additional comments (1)
docs/integrations/README.md (1)
573-573: LGTM! Correct categorization.The relocation of "Linear Search Issues" to the "Issue Tracking" section accurately reflects its functionality and improves documentation organization.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
- Update 'How it works' section to describe max_results and team_name filtering - Add default value and range to max_results input description
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/integrations/block-integrations/linear/issues.md (1)
1-122:⚠️ Potential issue | 🔴 CriticalCritical: Documentation out of sync with code – run the block docs generator.
The CI pipeline failed with: "Documentation is out of sync with code. Run the block docs generator to fix."
You must run the documentation generator script before merging:
poetry run python scripts/generate_block_docs.pyThis ensures the documentation accurately reflects the block's actual implementation.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/integrations/block-integrations/linear/issues.md
🧰 Additional context used
📓 Path-based instructions (2)
docs/integrations/**/*.md
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/integrations/**/*.md: Provide a technical explanation of how the block functions in the 'How It Works' section, including 1-2 paragraphs describing processing logic, validation, error handling, or edge cases, with code examples in backticks when helpful
Provide exactly 3 practical use cases in the 'Use Case' section, formatted with bold headings followed by short one-sentence descriptions
Files:
docs/integrations/block-integrations/linear/issues.md
docs/**/*.md
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/**/*.md: Keep documentation descriptions concise and action-oriented, focusing on practical, real-world scenarios
Use consistent terminology with other blocks and avoid overly technical jargon unless necessary in documentation
Files:
docs/integrations/block-integrations/linear/issues.md
🪛 GitHub Actions: Block Documentation Sync Check
docs/integrations/block-integrations/linear/issues.md
[error] 1-1: Documentation is out of sync with code. Run the block docs generator to fix. Command that failed: poetry run python scripts/generate_block_docs.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Seer Code Review
- GitHub Check: types
- GitHub Check: test (3.11)
- GitHub Check: test (3.12)
- GitHub Check: test (3.13)
- GitHub Check: Check PR Status
🔇 Additional comments (2)
docs/integrations/block-integrations/linear/issues.md (2)
93-95: Excellent technical documentation!The "How It Works" section effectively covers processing logic, validation (
max_resultsrange), error handling (search and team resolution failures), and edge cases (team name resolution). The two-paragraph structure with code examples in backticks aligns perfectly with the coding guidelines. As per coding guidelines, the technical explanation should include 1-2 paragraphs describing processing logic, validation, error handling, or edge cases, with code examples in backticks when helpful.
114-119: Use cases are well-structured.The three use cases follow the required format with bold headings and concise one-sentence descriptions, focusing on practical scenarios (duplicate detection, related issue lookup, and quick keyword search). As per coding guidelines, the Use Case section should provide exactly 3 practical use cases formatted with bold headings followed by short one-sentence descriptions.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
@claude please regenerate the block docs to satisfy the CI Check |
|
Claude finished @Torantulino's task in 1m 49s —— View job Regenerated Block Documentation
Ran |
Co-authored-by: Toran Bruce Richards <[email protected]>
|
Tested in dev cloud environment and working, good to merge! |
Summary
Implements SECRT-1880 - Improve Linear Search Block
Changes
Models (
models.py)Statemodel withid,name, andtypefields for workflow state informationstate: State | Nonefield toIssuemodelAPI Client (
_api.py)try_search_issues()to:max_resultsparameter (default 10, was ~50) to reduce token usageteam_idparameter for team filteringcreatedAt,state,project, andassigneefields in resultstry_get_team_by_name()to return descriptive error message when team not found instead of crashing withIndexErrorBlock (
issues.py)max_resultsinput parameter (1-100, default 10)team_nameinput parameter for optional team filteringerroroutput field for graceful error handlingPRODUCTIVITY,ISSUE_TRACKING)Breaking Changes
max_resultsup to 100 if neededNon-Breaking Changes
statefield added toIssue(optional, defaults toNone)max_resultsparam added (has default value)team_nameparam added (optional, defaults toNone)erroroutput added (follows established pattern from GitHub blocks)Testing
Resolves SECRT-1880