Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Dec 3, 2024

Resolves #14726

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced user selection functionality in project and task creation actions with workspace context.
    • Added assignee_section property in task update action to group tasks in the assignee's list.
    • Updated naming conventions for several actions to clarify their purposes.
  • Version Updates

    • Incremented version numbers across various Asana actions and sources to reflect updates.
  • Bug Fixes

    • Improved event filtering logic for task assignments and updates to ensure accurate emissions based on user context.

These updates enhance the usability and functionality of the Asana integration, providing users with more context-aware options and refined event handling.

Actions
 - Create Project
 - Create Task
 - Create Subtask
 - Search Task
 - Search User Projects
 - Update Task

Sources
 - Task Assigned In Project
 - Task Uploaded In Project
Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Dec 3, 2024 9:15pm
pipedream-docs ⬜️ Ignored (Inspect) Dec 3, 2024 9:15pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Dec 3, 2024 9:15pm

Copy link
Contributor

coderabbitai bot commented Dec 3, 2024

Walkthrough

The 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 assignee, followers, and owner. The changes do not alter the existing functionality, logic, or control flow of the components.

Changes

File Path Change Summary
components/asana/actions/add-task-to-section/add-task-to-section.mjs Version updated from 0.2.6 to 0.2.7.
components/asana/actions/create-project/create-project.mjs Version updated from 0.9.6 to 0.10.0; added workspace parameter to followers and owner propDefinitions.
components/asana/actions/create-subtask/create-subtask.mjs Version updated from 0.3.6 to 0.4.0; added workspace parameter to assignee and followers propDefinitions.
components/asana/actions/create-task/create-task.mjs Version updated from 0.3.6 to 0.4.0; added workspace parameter to assignee, followers, and assignee_section.
components/asana/actions/create-task-comment/create-task-comment.mjs Version updated from 0.2.6 to 0.2.7.
components/asana/actions/create-task-from-template/create-task-from-template.mjs Version updated from 0.0.1 to 0.0.2.
components/asana/actions/delete-task/delete-task.mjs Version updated from 0.0.7 to 0.0.8.
components/asana/actions/find-task-by-id/find-task-by-id.mjs Version updated from 0.2.6 to 0.2.7.
components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs Version updated from 0.0.4 to 0.0.5.
components/asana/actions/search-projects/search-projects.mjs Version updated from 0.2.6 to 0.2.7.
components/asana/actions/search-sections/search-sections.mjs Version updated from 0.2.6 to 0.2.7.
components/asana/actions/search-tasks/search-tasks.mjs Version updated from 0.2.6 to 0.3.0; added workspace context to assignee and section propDefinitions.
components/asana/actions/search-user-projects/search-user-projects.mjs Version updated from 0.4.6 to 0.5.0; added workspace parameter to user propDefinition.
components/asana/actions/update-task/update-task.mjs Version updated from 0.3.6 to 0.4.0; added assignee_section property and updated assignee for workspace context.
components/asana/asana.app.mjs Updated users method signature to include workspace parameter.
components/asana/package.json Version updated from 0.6.4 to 0.7.0; updated @pipedream/platform dependency from ^1.6.4 to ^3.0.3.
components/asana/sources/new-completed-task/new-completed-task.mjs Version updated from 0.1.6 to 0.1.7.
components/asana/sources/new-project/new-project.mjs Version updated from 0.1.6 to 0.1.7.
components/asana/sources/new-story/new-story.mjs Version updated from 0.1.6 to 0.1.7.
components/asana/sources/new-subtask/new-subtask.mjs Version updated from 1.0.6 to 1.0.7.
components/asana/sources/new-tag/new-tag.mjs Version updated from 0.0.8 to 0.0.9; adjusted import statement order.
components/asana/sources/new-task/new-task.mjs Version updated from 0.1.6 to 0.1.7.
components/asana/sources/new-team/new-team.mjs Version updated from 0.1.7 to 0.1.8; adjusted import statement order.
components/asana/sources/new-user/new-user.mjs Version updated from 0.1.6 to 0.1.7.
components/asana/sources/new-workspace/new-workspace.mjs Version updated from 0.1.7 to 0.1.8; adjusted import statement order.
components/asana/sources/tag-added-to-task/tag-added-to-task.mjs Version updated from 0.1.6 to 0.1.7.
components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs Version updated from 0.0.5 to 0.0.6; updated name property.
components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs Version updated from 0.0.5 to 0.1.0; updated name property and user prop definition.
components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs Version updated from 0.0.5 to 0.0.6; updated name property.
components/asana/sources/task-updated-in-project/task-updated-in-project.mjs Version updated from 1.1.5 to 1.1.6; updated name property and user prop definition.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AsanaAPI
    User->>AsanaAPI: Create Task with Assignee
    AsanaAPI-->>User: Task Created
Loading

Assessment against linked issues

Objective Addressed Explanation
Fix the Assignee prop error in Create Task action (#14726) Unclear if the changes resolve the error.

Possibly related issues

Possibly related PRs

Suggested labels

action

Suggested reviewers

  • jcortes

Poem

🐰 In the land of tasks and teams,
A version change brings new dreams.
With props refined, our work's in sight,
Asana's magic shines so bright!
Hop along, let's celebrate,
For every task, we elevate! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between eedf12e and 4abe8d3.

📒 Files selected for processing (2)
  • components/asana/sources/new-team/new-team.mjs (1 hunks)
  • components/asana/sources/task-updated-in-project/task-updated-in-project.mjs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/asana/sources/new-team/new-team.mjs
  • components/asana/sources/task-updated-in-project/task-updated-in-project.mjs

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 update

The 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 property

The 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 Pattern

The consistent addition of workspace context to user-related properties appears to be the key fix for the assignee property error. Consider:

  1. Documenting this requirement in the component's README
  2. Adding validation to ensure workspace context is always provided for user properties
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4cfcfc6 and eedf12e.

⛔ 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:

  1. Ensure all platform API changes are compatible with the current implementation
  2. 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

luancazarine and others added 2 commits December 3, 2024 18:14
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>
Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Asana Create Task action - Assignee prop always throw error
2 participants