-
Couldn't load subscription status.
- Fork 5.5k
Adding limits and fixing the state prop #16156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request makes several non-breaking updates across multiple modules. Most changes consist of incrementing version numbers in exported objects, while a subset of files introduce or enhance a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SearchIssuesAction as Search Issues Action
participant API as External API
User->>SearchIssuesAction: Trigger search request (filters: teamId, projectId, stateId, limit)
SearchIssuesAction->>SearchIssuesAction: Determine maxLimit (custom limit or DEFAULT_NO_QUERY_LIMIT)
loop Pagination Loop
SearchIssuesAction->>API: Request next page of issues
API-->>SearchIssuesAction: Return batch of issues
SearchIssuesAction->>SearchIssuesAction: Append results and check paging criteria
end
SearchIssuesAction-->>User: Return collected issues
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/linear_app/actions/create-issue/create-issue.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/linear_app/actions/search-issues/search-issues.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/linear_app/actions/update-issue/update-issue.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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)
components/linear_app/actions/update-issue/update-issue.mjs (1)
49-59: State Prop Logic Review
The state property (stateId) now uses the expressionteamIdToUpdate || teamIdensuring that if an updated team identifier is provided, it takes precedence; otherwise, it falls back to the original team ID. Please verify that this logic fully addresses the bug reported in the previous implementation. Additionally, consider whether an explicit check against empty strings or other falsy values might be necessary if those cases are possible.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (16)
components/linear_app/actions/create-issue/create-issue.mjs(1 hunks)components/linear_app/actions/get-issue/get-issue.mjs(1 hunks)components/linear_app/actions/get-teams/get-teams.mjs(1 hunks)components/linear_app/actions/search-issues/search-issues.mjs(3 hunks)components/linear_app/actions/update-issue/update-issue.mjs(1 hunks)components/linear_app/common/constants.mjs(2 hunks)components/linear_app/common/utils.mjs(1 hunks)components/linear_app/linear_app.app.mjs(2 hunks)components/linear_app/package.json(1 hunks)components/linear_app/sources/comment-created-instant/comment-created-instant.mjs(1 hunks)components/linear_app/sources/common/webhook.mjs(2 hunks)components/linear_app/sources/issue-created-instant/issue-created-instant.mjs(1 hunks)components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs(1 hunks)components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs(2 hunks)components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs(1 hunks)components/linear_app/sources/project-updated-instant/project-updated-instant.mjs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
🔇 Additional comments (30)
components/linear_app/package.json (1)
3-3: Version Bump Confirmation
The version has been updated to "0.7.1", which is consistent with the overall versioning strategy across the component.components/linear_app/actions/get-issue/get-issue.mjs (1)
7-7: Updated Module Version
The exported object’s version field has been correctly updated to "0.1.8". This version bump aligns with other related actions.components/linear_app/actions/update-issue/update-issue.mjs (1)
8-8: Module Version Increment
The version has been incremented to "0.1.8". This change is straightforward and ensures consistency with our other modules.components/linear_app/actions/create-issue/create-issue.mjs (1)
8-8: Version Update for Create Issue Action
The version field has been updated to "0.4.8". This update is consistent with the coordinated versioning across other actions in the linear_app component.components/linear_app/sources/project-updated-instant/project-updated-instant.mjs (1)
11-11: Consistent Versioning Applied
The version number has been incremented to "0.0.3". The change is minor and does not impact functionality.components/linear_app/sources/comment-created-instant/comment-created-instant.mjs (1)
10-10: Version bump looks goodThe version has been incremented from "0.1.9" to "0.1.10", which follows semantic versioning practices. This change is consistent with version updates in other Linear App components mentioned in the summary.
components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs (1)
11-11: Version increment appears correctThe version has been incremented from "0.0.1" to "0.0.2", which is appropriate for a minor update. This is consistent with the versioning pattern applied to other components in this PR.
components/linear_app/common/constants.mjs (2)
5-5: New constant for default query limitThis new constant establishes a standard default limit for queries that don't specify a limit value. The value of 20 is reasonable for pagination defaults.
53-53: Properly exported the new constantThe new constant is correctly added to the default export object, making it accessible to other modules that import this constants file.
components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs (1)
10-10: Version increment looks goodThe version has been incremented from "0.3.9" to "0.3.10", which is consistent with the version updates in other Linear App components in this PR.
components/linear_app/sources/issue-created-instant/issue-created-instant.mjs (1)
10-10: Version updated correctly to 0.3.10The version number has been incremented appropriately, maintaining proper semantic versioning across the linear_app components.
components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs (3)
11-11: Version updated correctly to 0.1.10The version number has been incremented appropriately, maintaining proper semantic versioning.
111-113: Good enhancement: Dynamic limit configurationAdding a configurable limit with a sensible default improves the component's flexibility.
118-118: Hardcoded limit replaced with configurable valueReplacing the hardcoded 1000 value with the configurable limit is a good practice that improves consistency and maintainability.
components/linear_app/common/utils.mjs (2)
62-71: Improved limit determination logicThe enhancement to dynamically determine limits based on multiple factors (custom limit, query presence) is a good improvement that makes the code more intelligent and adaptable to different use cases.
72-72: Updated return statement to use the dynamic limitThe return statement has been correctly updated to use the newly calculated limit value.
components/linear_app/actions/get-teams/get-teams.mjs (4)
2-2: Added necessary constants importThe constants import has been added to support the new limit configuration feature.
8-8: Version updated correctly to 0.2.8The version number has been incremented appropriately to reflect the changes made to the component.
12-18: Well-defined limit property addedThe new limit property has been properly defined with appropriate propDefinition and a clear description that includes the default value information.
21-28: Improved implementation with configurable limitThe implementation now properly uses the user-defined limit or falls back to a sensible default, making the component more flexible and user-friendly.
components/linear_app/sources/common/webhook.mjs (2)
24-30: Good addition of the limit property.This property provides a way for users to control the maximum number of items returned when polling, with a clear description indicating the default value of 20.
112-114: Well-implemented limit application.The implementation correctly uses the specified limit or falls back to a default value, and properly applies it to the pagination process.
Also applies to: 119-119
components/linear_app/linear_app.app.mjs (2)
167-168: Enhanced query description and correctly marked as optional.The updated description provides more detailed information about how the query is used to filter issues, and marking it as optional clarifies that it's not required.
183-188: Good addition of the limit property.This new property aligns with the limit properties added in other files and provides a clear description of its purpose, defaulting to 20 when no query is provided to avoid returning excessive results.
components/linear_app/actions/search-issues/search-issues.mjs (6)
3-3: Version incremented and constants imported.Correctly importing the constants module and incrementing the version number after functional changes.
Also applies to: 10-10
13-41: Improved properties organization and descriptions.The properties have been restructured to provide better organization:
teamIdis positioned as the primary filterprojectIdadded for additional filteringstateIdenhanced with better description and dynamic teamId parameterThese changes improve the structure and usability of the component.
66-71: Good addition of the limit property.The limit property consistently follows the pattern established in other files, allowing users to control the maximum number of issues returned.
78-94: Well-implemented pagination limit logic.The implementation intelligently determines the maximum limit based on:
- User-provided limit
- Query presence (using different defaults for query/no-query scenarios)
- Appropriate page size to optimize API calls
This prevents over-fetching while maintaining efficiency.
87-114: Robust pagination control implementation.The code now:
- Breaks the loop if the maximum limit is reached
- Calculates remaining items needed for each page
- Properly applies filters including state
- Passes the calculated limit to each API call
This approach optimizes API usage and ensures the specified limit is respected.
124-124: Proper loop termination condition.The loop now correctly continues only if there are more pages available AND we haven't reached the maximum limit of issues to fetch.
Adding a
stateprop to the search issues action, improving the description forquery, and adding default limits (we were previously trying to retrieve everything.