-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Linear - New ProjectUpdates #15332
Linear - New ProjectUpdates #15332
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request updates the Linear app integration with a focus on version increments and the introduction of new functionalities related to project updates. Key changes include the addition of new methods, a GraphQL fragment, a query for project updates, and a new webhook trigger for project updates. The package version has been incremented, and several action files have also received minor version updates. Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 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 (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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: 1
🧹 Nitpick comments (3)
components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs (1)
8-9
: Enhance source description with supported event types.The description should clarify that this source only emits events for newly created project updates, not for updates or deletions.
Apply this diff to improve the description:
- name: "New Project Update (Instant)", - description: "Emit new event when a new Project Update is created. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)", + name: "New Project Update Created (Instant)", + description: "Emit new event when a project update is created (does not trigger on update or delete actions). [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",components/linear_app/linear_app.app.mjs (1)
Line range hint
19-25
: Fix typo inresourceMapper
property name.The property name
resouceMapper
is consistently misspelled throughout the file (missing 'r'). While this doesn't affect functionality as it's used consistently, it should be corrected for maintainability.Apply this diff to fix the typo:
return this.listResourcesOptions({ prevContext, resourcesFn: this.listTeams, - resouceMapper: ({ + resourceMapper: ({ id, name, }) => ({ label: name, value: id, }), });This change should be applied to all occurrences in the file.
Also applies to: 293-321
components/linear_app/sources/common/webhook.mjs (1)
64-66
: Consider adding JSDoc documentation for the new method.The
isRelevantPolling
method appears to be a base implementation that child classes can override for specific filtering logic during polling operations. Adding documentation would help developers understand its purpose and expected usage.+ /** + * Determines if a polled resource is relevant and should be emitted. + * Override this method in child classes to implement specific filtering logic. + * @param {Object} resource - The resource to check + * @returns {boolean} True if the resource is relevant, false otherwise + */ isRelevantPolling() { return true; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
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
(1 hunks)components/linear_app/actions/update-issue/update-issue.mjs
(1 hunks)components/linear_app/common/constants.mjs
(1 hunks)components/linear_app/common/fragments.mjs
(1 hunks)components/linear_app/common/queries.mjs
(1 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
(1 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
(2 hunks)
✅ Files skipped from review due to trivial changes (10)
- components/linear_app/package.json
- components/linear_app/sources/comment-created-instant/comment-created-instant.mjs
- components/linear_app/actions/get-teams/get-teams.mjs
- components/linear_app/actions/search-issues/search-issues.mjs
- components/linear_app/actions/get-issue/get-issue.mjs
- components/linear_app/actions/create-issue/create-issue.mjs
- components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs
- components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs
- components/linear_app/sources/issue-created-instant/issue-created-instant.mjs
- components/linear_app/actions/update-issue/update-issue.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (9)
components/linear_app/common/constants.mjs (1)
16-16
: LGTM! Addition of PROJECT_UPDATE constantThe new constant follows the established naming pattern and correctly maps to Linear's API resource type.
components/linear_app/sources/project-updated-instant/project-updated-instant.mjs (1)
11-11
: LGTM! Version bump and improved documentationGood maintenance updates:
- Version increment follows semantic versioning
- Added helpful description for the teamIds parameter
Also applies to: 22-22
components/linear_app/common/utils.mjs (1)
45-48
: Consider adding date format validationWhile the implementation is consistent with other filters, consider adding validation for the date format in
createdAt.gte
to prevent potential GraphQL query errors.Example validation:
const createdAt = args.filter.createdAt - ? `, createdAt: { gte: "${args.filter.createdAt.gte}" }` + ? `, createdAt: { gte: "${new Date(args.filter.createdAt.gte).toISOString()}" }` : "";components/linear_app/common/queries.mjs (1)
78-105
: LGTM! Well-structured ProjectUpdates queryThe new query follows best practices:
- Consistent with Linear's GraphQL schema
- Implements standard pagination
- Properly references required fragments
components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs (2)
50-59
: LGTM! Good practice limiting historical data.The implementation wisely limits the initial data fetch to updates from the last week, preventing excessive historical data processing.
63-71
: LGTM! Robust filtering implementation.The filtering logic properly handles both webhook events and polling scenarios, ensuring events are only emitted for the specified team and project (if provided).
components/linear_app/linear_app.app.mjs (2)
251-253
: LGTM! Clean implementation of project update retrieval.The method follows the established pattern of using the Linear SDK for single resource retrieval.
272-280
: LGTM! Consistent implementation of project updates listing.The method follows the established pattern for GraphQL queries and response handling.
components/linear_app/sources/common/webhook.mjs (1)
114-114
: Verify the impact of switching fromisRelevant
toisRelevantPolling
.The change from
isRelevant
toisRelevantPolling
suggests a separation between webhook and polling relevance checks. While both base implementations returntrue
, we should verify that existing child classes implement the new method correctly where needed.✅ Verification successful
The separation of
isRelevant
andisRelevantPolling
is correctly implementedThe change introduces a clear separation between webhook and polling validation:
- Base class provides safe defaults (both methods return
true
)- Sources can override either method based on their specific needs
- Currently, only
new-projectupdate-created
needs specific polling validation and correctly implementsisRelevantPolling
- Other sources appropriately inherit the default polling behavior
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for existing implementations of isRelevant that might need to be updated # Find all source files that might extend this base class echo "Searching for source files that might need updates..." rg -l "isRelevant\(" components/linear_app/sources/ # Check for any existing implementations that might need the new method echo "Checking existing implementations..." ast-grep --pattern 'isRelevant($_) { $$$ }' components/linear_app/sources/Length of output: 627
Script:
#!/bin/bash # Search for both method implementations and their usage with context echo "Searching for isRelevant and isRelevantPolling implementations and usage..." rg "isRelevant" -A 3 -B 3 components/linear_app/sources/ # Check class definitions that might extend the base class echo "Checking class definitions..." ast-grep --pattern 'class $_ extends $_ { $$$ }' # Try different patterns for method implementations echo "Checking alternative method syntaxes..." ast-grep --pattern 'isRelevant = $_'Length of output: 34711
Script:
#!/bin/bash # Check for class inheritance and polling-related code echo "Checking class inheritance..." ast-grep --pattern 'class $_ extends Webhook { $$$ }' echo "Checking for polling-related code..." rg "poll" -B 2 -A 2 components/linear_app/sources/ # Check for any other isRelevantPolling implementations or references echo "Checking for isRelevantPolling usage..." rg "isRelevantPolling" -B 2 -A 2 components/linear_app/sources/Length of output: 2270
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 (2)
components/linear_app/common/fragments.mjs (2)
139-167
: LGTM! Consider enhancing user and initiative fields.The fragment structure is well-organized and follows Linear's GraphQL schema. Consider these optional enhancements:
- Add
name
field to theuser
object for display purposes- Add
id
field toinitiatives.nodes
for reference purposesuser { id + name } ... initiatives { nodes { + id name } }
143-143
: Document thehealth
field.Please add a comment explaining the possible values and meaning of the
health
field to improve code maintainability.id body + // health: Represents the project's health status (e.g. "on_track", "at_risk", "off_track") health
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/linear_app/common/fragments.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
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.
Hi @michelle0927 lgtm! Ready for QA!
/approve |
Resolves #15313
Note: Will add source to
linear
app once this is published. Can't push changes forlinear
untillinear_app
package is updated.Summary by CodeRabbit
New Features
PROJECT_UPDATE
to enhance resource management.ProjectUpdate
.listProjectUpdates
for retrieving project updates.isRelevantPolling
for improved resource filtering.Chores
Version Bump