-
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
14726 bug asana create task action assignee prop always throw error #14813
base: master
Are you sure you want to change the base?
14726 bug asana create task action assignee prop always throw error #14813
Conversation
Actions - Create Project - Create Task - Create Subtask - Search Task - Search User Projects - Update Task Sources - Task Assigned In Project - Task Uploaded In Project
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe pull request includes updates to multiple Asana integration components, primarily focusing on incrementing version numbers across various action and source files. Additionally, several components have enhanced property definitions to include workspace context for properties such as Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AsanaAPI
User->>AsanaAPI: Create Task with Assignee
AsanaAPI-->>User: Task Created
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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: 3
🧹 Outside diff range and nitpick comments (3)
components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs (1)
8-8
: Consistent naming convention updateThe addition of "New" prefix and patch version bump are appropriate for this minor naming change. However, ensure this naming convention update is documented in the team's style guide.
Consider documenting the naming convention change in the README or contributing guidelines.
Also applies to: 10-10
components/asana/actions/search-tasks/search-tasks.mjs (1)
8-8
: Improvement: Added workspace context to assignee propertyThe addition of workspace context to the assignee property is a positive change that aligns with the PR objective of fixing the assignee property error. This change ensures that users are filtered within the correct workspace context.
This pattern of including workspace context for user-related properties should be consistently applied across all Asana actions to prevent similar issues.
Also applies to: 25-27
components/asana/actions/update-task/update-task.mjs (1)
Line range hint
1-124
: Architectural Recommendation: Document the Workspace Context PatternThe consistent addition of workspace context to user-related properties appears to be the key fix for the assignee property error. Consider:
- Documenting this requirement in the component's README
- Adding validation to ensure workspace context is always provided for user properties
- Creating a shared propDefinition helper for user properties that enforces this pattern
Would you like help creating this documentation or implementing these suggestions?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
components/asana/actions/add-task-to-section/add-task-to-section.mjs
(1 hunks)components/asana/actions/create-project/create-project.mjs
(3 hunks)components/asana/actions/create-subtask/create-subtask.mjs
(3 hunks)components/asana/actions/create-task-comment/create-task-comment.mjs
(1 hunks)components/asana/actions/create-task-from-template/create-task-from-template.mjs
(1 hunks)components/asana/actions/create-task/create-task.mjs
(3 hunks)components/asana/actions/delete-task/delete-task.mjs
(1 hunks)components/asana/actions/find-task-by-id/find-task-by-id.mjs
(1 hunks)components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs
(1 hunks)components/asana/actions/search-projects/search-projects.mjs
(1 hunks)components/asana/actions/search-sections/search-sections.mjs
(1 hunks)components/asana/actions/search-tasks/search-tasks.mjs
(2 hunks)components/asana/actions/search-user-projects/search-user-projects.mjs
(2 hunks)components/asana/actions/update-task/update-task.mjs
(2 hunks)components/asana/asana.app.mjs
(1 hunks)components/asana/package.json
(2 hunks)components/asana/sources/new-completed-task/new-completed-task.mjs
(1 hunks)components/asana/sources/new-project/new-project.mjs
(1 hunks)components/asana/sources/new-story/new-story.mjs
(1 hunks)components/asana/sources/new-subtask/new-subtask.mjs
(1 hunks)components/asana/sources/new-tag/new-tag.mjs
(1 hunks)components/asana/sources/new-task/new-task.mjs
(1 hunks)components/asana/sources/new-team/new-team.mjs
(1 hunks)components/asana/sources/new-user/new-user.mjs
(1 hunks)components/asana/sources/new-workspace/new-workspace.mjs
(1 hunks)components/asana/sources/tag-added-to-task/tag-added-to-task.mjs
(1 hunks)components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs
(1 hunks)components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs
(2 hunks)components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs
(1 hunks)components/asana/sources/task-updated-in-project/task-updated-in-project.mjs
(2 hunks)
✅ Files skipped from review due to trivial changes (15)
- components/asana/sources/new-story/new-story.mjs
- components/asana/actions/find-task-by-id/find-task-by-id.mjs
- components/asana/actions/create-task-comment/create-task-comment.mjs
- components/asana/actions/create-task-from-template/create-task-from-template.mjs
- components/asana/sources/new-completed-task/new-completed-task.mjs
- components/asana/actions/search-projects/search-projects.mjs
- components/asana/sources/tag-added-to-task/tag-added-to-task.mjs
- components/asana/sources/new-workspace/new-workspace.mjs
- components/asana/sources/new-task/new-task.mjs
- components/asana/sources/new-user/new-user.mjs
- components/asana/actions/add-task-to-section/add-task-to-section.mjs
- components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs
- components/asana/actions/delete-task/delete-task.mjs
- components/asana/actions/search-sections/search-sections.mjs
- components/asana/sources/new-subtask/new-subtask.mjs
🔇 Additional comments (20)
components/asana/sources/new-team/new-team.mjs (1)
9-9
: LGTM: Version bump is consistent with other Asana integration updates.
The version increment from 0.1.7 to 0.1.8 aligns with the coordinated update across the Asana integration components.
components/asana/sources/task-updated-in-project/task-updated-in-project.mjs (2)
44-46
: LGTM! Clean prop definition update.
The updated prop definition for the user/assignee field correctly utilizes the workspace context, which aligns with the PR's objective of fixing assignee-related issues. The code is more concise and maintains consistency with other Asana components.
Line range hint 89-116
: Implementation properly handles assignee filtering.
The task filtering logic in emitEvent
correctly handles assignee-related functionality:
- Proper null checking for
task.assignee
- Correct comparison of assignee GIDs
- Graceful handling when no user filter is set
This implementation aligns well with the PR's objective of fixing assignee-related issues.
components/asana/package.json (1)
3-3
: Verify platform dependency compatibility
The major version update of @pipedream/platform
from ^1.6.4
to ^3.0.3
is significant. While this might be necessary for fixing the Assignee property issue:
- Ensure all platform API changes are compatible with the current implementation
- Verify that the minor version bump (0.7.0) adequately reflects the scope of changes
Also applies to: 13-13
✅ Verification successful
Let me check the actual usage of the platform dependency to verify if there are any breaking changes.
The first command will help us see all platform imports to verify what features are being used, and the second command will show us the changes made in this PR to understand if they're related to the platform upgrade.
Let me check the actual changes in this PR to understand if they're related to the platform upgrade.
Based on the analysis of the platform usage in the Asana component, I can now generate the final response:
Platform update appears safe for current implementation
The component only uses basic platform features (axios
and DEFAULT_POLLING_SOURCE_TIMER_INTERVAL
) which are stable across major versions. The current implementation doesn't use any advanced platform features that might be affected by breaking changes in the major version update.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for breaking changes in platform dependency usage
rg -A 3 "@pipedream/platform" components/asana/
Length of output: 1520
Script:
#!/bin/bash
# Check the actual usage of platform imports
ast-grep --pattern 'import { $_ } from "@pipedream/platform"'
# Check git history for changes related to platform usage
git diff HEAD^1 components/asana/
Length of output: 65671
Script:
#!/bin/bash
# Check the changes made in this PR
git show HEAD components/asana/package.json
# Check for any breaking changes in platform usage
ast-grep --pattern 'import { $_ } from "@pipedream/platform"' components/asana/
Length of output: 591
components/asana/sources/new-tag/new-tag.mjs (1)
2-2
: Version bump appears unrelated to PR objective
The patch version increment and import reordering don't seem to contribute to fixing the Asana Create Task action's Assignee property issue. Consider whether this file needs to be included in this PR.
Also applies to: 9-9
components/asana/sources/new-project/new-project.mjs (2)
9-9
: Version update seems out of scope
This file handles project creation events and doesn't interact with task assignment functionality. The patch version increment appears unrelated to fixing the Assignee property issue in the Create Task action.
Line range hint 1-1
: Critical: Missing changes for Assignee property fix
The PR aims to fix a bug where the Asana Create Task action's Assignee property throws errors, but the changes shown are only version bumps and dependency updates. The actual fix for the Assignee property issue appears to be missing.
Expected to see changes in:
- The Create Task action implementation
- Assignee property handling logic
- Related test cases
Please include the necessary changes to address the core issue or clarify how the current changes fix the Assignee property bug.
components/asana/actions/search-user-projects/search-user-projects.mjs (2)
8-8
: Version bump follows semantic versioning
The version increment from 0.4.6 to 0.5.0 appropriately reflects the addition of new functionality (workspace context) without breaking changes.
28-30
: LGTM: Enhanced user prop with workspace context
The addition of workspace context to the user prop definition is a good improvement that ensures users are properly filtered by workspace. This change aligns with the broader effort to fix workspace-related issues across the Asana integration.
components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs (2)
8-8
: Version bump reflects feature addition
The version increment from 0.0.5 to 0.1.0 appropriately reflects the addition of workspace context functionality. The "New" prefix addition maintains consistency with other components.
Also applies to: 10-10
33-35
: LGTM: Enhanced user prop with workspace context
The addition of workspace context to the user prop definition is a good improvement that ensures proper user filtering by workspace. This change is particularly relevant as it demonstrates the pattern being used to fix assignee-related issues across the Asana integration.
Let's verify if this pattern is consistently applied across all user/assignee-related properties:
✅ Verification successful
Let me analyze the results of these broader searches to verify the consistency of the workspace context pattern.
Based on the results from our searches, particularly the ast-grep
pattern match for ({ workspace }) => ({ workspace })
, I can now generate the final response:
Workspace context pattern is consistently applied across user-related components
The workspace context pattern is properly implemented across multiple Asana components where user filtering is needed, including:
- Task-related components (task-assigned, task-updated)
- User-related actions (search-user-projects)
- Task management actions (create-task, create-subtask, update-task)
- Project management actions (create-project)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for user/assignee prop definitions in Asana components
rg -A 5 'propDefinition.*users' components/asana/
Length of output: 51
Script:
#!/bin/bash
# Let's try a broader search for user/assignee-related props in Asana components
rg -i "prop.*user|prop.*assign" components/asana/ -A 5
Length of output: 56
Script:
#!/bin/bash
# Search for workspace context in prop definitions
rg "workspace.*prop|prop.*workspace" components/asana/ -A 5
Length of output: 936
Script:
#!/bin/bash
# Let's also check the specific pattern using ast-grep
ast-grep --pattern '({ workspace }) => ({
workspace,
})'
Length of output: 3171
Script:
#!/bin/bash
# Let's search for assignee-related props specifically in the Asana components
rg -i "assignee.*prop|prop.*assignee" components/asana/ -A 5
Length of output: 62
Script:
#!/bin/bash
# Let's also check for any user-related props with a more specific pattern
ast-grep --pattern 'prop$_: {
$$$
type: "string",
$$$
label: /.*[Uu]ser.*|.*[Aa]ssignee.*/,
$$$
}'
Length of output: 110
components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs (1)
8-10
: LGTM: Minor version bump and name clarification
The changes are straightforward and improve clarity:
- Name updated to better reflect the event type
- Version incremented appropriately for minor changes
components/asana/actions/update-task/update-task.mjs (2)
8-8
: Improvement: Consistent workspace context pattern
The addition of workspace context to the assignee property follows the same pattern as in search-tasks.mjs, which helps resolve the assignee property error consistently across actions.
Let's verify this pattern is applied consistently across all relevant files:
Also applies to: 37-39
Line range hint 42-52
: Enhancement: New assignee_section property
Good addition of the assignee_section property with proper project context. This enhances task organization capabilities.
Let's verify the implementation is consistent with Asana's API requirements:
✅ Verification successful
The assignee_section implementation is consistent with Asana's API requirements
The implementation is correctly structured and consistent across the codebase:
- The property is properly defined with correct type, description, and optional flag
- It uses Asana's built-in sections propDefinition with project context
- The field is correctly passed in the API request payload
- The implementation is consistent with similar task-related actions (create-task, create-subtask)
- The property aligns with Asana's task organization model where sections are used to group tasks in "My Tasks" lists
The code demonstrates proper integration with Asana's task management features and API specifications.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for all assignee_section implementations
rg -U "assignee_section.*propDefinition" components/asana/actions/
Length of output: 68
Script:
#!/bin/bash
# Let's search for assignee_section usage in a broader context
rg -U "assignee_section" components/asana/ -A 5 -B 5
Length of output: 5731
Script:
#!/bin/bash
# Let's also check the Asana API schema or types
fd "asana.*\.(json|ts|js|mjs)" -x cat {}
Length of output: 14392
Script:
#!/bin/bash
# Check for any section-related implementations
rg "section" components/asana/actions/update-task/ -A 5 -B 5
Length of output: 2383
components/asana/actions/create-task/create-task.mjs (3)
8-8
: Version bump looks appropriate
The increment from 0.3.6 to 0.4.0 is justified as this change fixes a bug in the assignee functionality.
76-78
: Consistent workspace context added to followers property
Good consistency in also adding workspace context to the followers property, as it deals with user selection in the same way as assignee.
32-34
: Bug fix: Added workspace context to assignee property
This change fixes the root cause of issue #14726 by properly passing the workspace context when fetching users for the assignee field. This ensures that users are filtered by the correct workspace.
Let's verify the fix resolves the issue:
✅ Verification successful
Based on the search results, I can now generate the final response:
Workspace context is correctly implemented for assignee property
The code change properly implements the workspace context for the assignee property, and this pattern is consistently used across all relevant components:
- create-task.mjs
- update-task.mjs
- create-subtask.mjs
- search-tasks.mjs
All these components use the same pattern of passing the workspace context when fetching users for the assignee field:
propDefinition: [
asana,
"users",
({ workspace }) => ({
workspace,
}),
]
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that assignee property is consistently used with workspace context
# across the codebase to prevent similar issues
# Check for any other instances where users are fetched without workspace context
ast-grep --pattern 'propDefinition: [
asana,
"users",
$_
]'
Length of output: 67
Script:
#!/bin/bash
# Let's try a different approach to find user-related prop definitions in the Asana components
# Search for files containing "users" prop definitions
rg -l "users.*propDefinition" components/asana/
# Then examine the content of these files
for file in $(rg -l "users.*propDefinition" components/asana/); do
echo "=== $file ==="
cat "$file"
echo
done
Length of output: 100
Script:
#!/bin/bash
# Let's try a more general search for user-related properties in Asana components
# First, let's see the content of the create-task action to understand the context better
cat components/asana/actions/create-task/create-task.mjs
# Also search for any references to assignee in Asana components
rg -A 5 -B 5 "assignee" components/asana/
Length of output: 18598
components/asana/actions/create-subtask/create-subtask.mjs (1)
37-39
: Consistent implementation across subtask creation
Good consistency in implementing the workspace context for both assignee and followers properties in the subtask creation, matching the fix in the main task creation.
Also applies to: 81-83
components/asana/actions/create-project/create-project.mjs (1)
96-98
: Consistent workspace context for project-related user fields
Good consistency in implementing the workspace context for both followers and owner properties in project creation, aligning with the fix pattern across the codebase.
Also applies to: 115-117
components/asana/asana.app.mjs (1)
123-128
: LGTM! This change fixes the assignee error by filtering users by workspace.
The addition of the workspace
parameter to filter users in the API request is the correct fix for the assignee error. This ensures that only valid users from the selected workspace are available for task assignment, preventing the error mentioned in issue #14726.
Let's verify the fix by checking if other actions using the users
prop definition have been updated to pass the workspace parameter:
✅ Verification successful
The workspace parameter is correctly passed in all relevant actions
After reviewing the implementation, both the create-task
and update-task
actions are correctly passing the workspace parameter to the users prop definition for the assignee
and followers
fields. The changes in the Asana app component are properly integrated with all dependent actions, ensuring users are filtered by workspace consistently.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if other actions are correctly passing the workspace parameter to the users prop definition
# Search for actions using the users prop definition
rg -l "users.*propDefinition" components/asana/actions/
# Check the implementation of these actions to ensure they pass the workspace parameter
ast-grep --pattern 'propDefinition: {
$$$
users: {
$$$
workspace: $_
$$$
}
$$$
}'
Length of output: 161
Script:
#!/bin/bash
# Let's try a different approach to find actions using the users prop
# First, let's find all action files
fd "\.mjs$" components/asana/actions/
# Then let's search for any references to users in prop definitions
rg -A 5 -B 5 "users.*prop" components/asana/actions/
Length of output: 1067
Script:
#!/bin/bash
# Let's check the content of create-task action since it's the one mentioned in the bug report
cat components/asana/actions/create-task/create-task.mjs
# Also check update-task as it might use assignee
cat components/asana/actions/update-task/update-task.mjs
Length of output: 8431
components/asana/sources/task-updated-in-project/task-updated-in-project.mjs
Show resolved
Hide resolved
components/asana/sources/task-updated-in-project/task-updated-in-project.mjs
Outdated
Show resolved
Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…in-project.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.
LGTM!
Resolves #14726
Summary by CodeRabbit
Release Notes
New Features
assignee_section
property in task update action to group tasks in the assignee's list.Version Updates
Bug Fixes
These updates enhance the usability and functionality of the Asana integration, providing users with more context-aware options and refined event handling.