Skip to content

PM-6175 - allow copilot to trigger ai workflow - #2511

Merged
vas3a merged 1 commit into
devfrom
PM-6175_allow-copilot-to-trigger-workflow
Oct 16, 2026
Merged

vas3a merged 1 commit into
devfrom
PM-6175_allow-copilot-to-trigger-workflow

Conversation

@vas3a

@vas3a vas3a commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-6175

What's in this PR?

This pull request updates the permissions logic for triggering (queueing or re-running) AI workflow runs in the AiReviewsTable component. The main change is to allow both admins and challenge copilots to perform these actions, instead of restricting them to admins only. The tests and mocks have also been updated to reflect this new logic.

Permissions and Actions Logic:

  • Added a new canTriggerWorkflows variable in AiReviewsTable.tsx to allow both admins and challenge copilots to manually queue or re-run AI workflows, updating the relevant logic in the buildRowAction callback. [1] [2]
  • Updated the dependencies of buildRowAction to use canTriggerWorkflows instead of isAdmin.
  • Removed outdated comments that referred to admin-only actions, clarifying that both admins and copilots can now trigger workflows.

Test and Mock Updates:

  • Refactored the useRolePermissions mock in the test file to use a mutable mockRolePermissions object, making it easier to test different permission scenarios. [1] [2]
  • Improved the IconOutline mock to allow querying for specific icon names in tests, enabling more precise assertions.
  • Updated the AiWorkflowRunStatus mock to accept and render an optional action prop, matching the real component signature.
  • Added and updated tests to verify that only admins or copilots see the re-run action, and that users without these roles do not.

@vas3a
vas3a merged commit e6811f2 into dev Oct 16, 2026
7 of 8 checks passed
@vas3a
vas3a deleted the PM-6175_allow-copilot-to-trigger-workflow branch October 16, 2026 16:30
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.

1 participant