Skip to content

feat(runs): act as a run's team on its run page - #2944

Merged
camielvs merged 1 commit into
cvs/submit-as-teamfrom
cvs/team-run-page
Oct 31, 2026
Merged

camielvs merged 1 commit into
cvs/submit-as-teamfrom
cvs/team-run-page

Conversation

@camielvs

@camielvs camielvs commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Human Words

Welcome to the top of the stack for the Workspaces x Secrets feature.

How it works

This stack builds on top of the Team Impersonation system to allow users to create Workspace-level secrets and execute Pipeline Runs using them.

Workspaces are now associated 1:1 with a Team and through a static config on the backend that Team grants basic roles to users based on their Team membership. Users with Team permissions are then able to create, edit and manage secrets on the entire Workspace, and add them to pipelines within that Workspace.

When a pipeline is submitted with a Workspace secret the initiating user must have team permissions. That Run will then be Attributed to the team and utilise its secrets. It is not possible to mix user-personal secrets and workspace secrets in one pipeline. Additionally, for runs that do not use secrets the user will have a choice of submitting as themselves or the team. It is also not possible to run a pipeline that uses Workspace secrets from outside of that Workspace.

Note: agents cannot use or read workspace secrets locally due to known tangent-shell limitations in the existing agent workflow.

Screenshots

image image image image image image

Testing

  1. Set up a Workspace with a team id you have permissions in
  2. Create a project in the workspace
  3. You should now see a new window for "Workspace Secrets"
  4. Confirm you can add/edit/delete workspace secrets
  5. Make a pipeline inside the Project
  6. Confirm you can add the Workspace secrets to the pipeline and run it

Agent Words

Description

A run's team is the team of the projects it's filed under, read from its annotations by the new useRunTeam. The run page now uses it in three places.

  • Cancel and run notes. The backend only lets a run's creator annotate it, and only its creator or someone with wider rights, such as an admin, cancel it. A run the team created can now be cancelled, and its notes edited, by a member who can write to the team, and both requests carry the team header. A run you created keeps working as before, without the header, even when it's filed under a team's project. The rule lives in runManagement.
  • Rerun. A rerun keeps the identity of the run it repeats. A run the team created reruns as the team, straight away, so its secrets resolve the same way. Someone who can't act as the team, because they aren't in it or can't impersonate it, can't rerun it: the rerun button and the run menus are disabled and say why. Any other run reruns by the same rule as a submit (feat(runs): submit as yourself or as the project's team #2943): as you, unless only the team has a secret it uses. A rerun whose arguments use secrets missing for whoever it goes as, or whose secrets are split, asks first, says why and offers the same Run as choice. Rerun waits for the team and the secrets check, and is refused for projects on different teams. When the run's team can't be checked, only the run's creator can rerun it.
  • One rerun implementation. The rerun button and the run menus had two copies of the rerun logic. The button now uses the menus' useRerunPipelineRun, so the team rules live in one place. The button's unused runId prop is gone.

Cancel and annotation failures now show the backend's reason instead of "Access denied (403)". They read the response the way creating a run does. As before, a request a sign-in redirect intercepted fails rather than passing for a success. A failed notes save used to be silent and now shows a toast.

useTeamForRunAnnotations (#2929) had no callers. useRunTeam replaces it, and also waits for the annotations and reports when they can't be read. Without the team header configured, it's none straight away and reads no annotations, so cancel, notes and rerun behave as on master.

Related Issue and Pull requests

Type of Change

  • New feature
  • Cleanup/Refactor

Line Breakdown

Category Added Removed
Production code 365 168
Comments 0 1
Tests 808 37
Config / CI / tooling 2 0
Total 1175 206

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

None yet.

Test Instructions

pnpm vitest run src/components/PipelineRun src/routes/v2/pages/RunView src/services/teams src/services/pipelineRunService.test.ts

With the same setup as #2941, open a run submitted as the team (#2943):

  1. While it runs, cancel it from the Run menu or the Run Tools window. The cancel goes through.
  2. Edit its run notes in Details. They save.
  3. When it's done, rerun it. The new run's "Created by" is the team's id.
  4. Open the same run as someone outside the team, or as a member who can't act as it. There's no cancel, the notes are read-only, and Rerun is disabled, saying "Only someone who can act as the workspace can rerun it."
  5. Open a run you submitted yourself. It behaves as on master.

Additional Comments

  • The v1 run page (RunToolbar, RunDetails) isn't routed. It only picks up the shared rerun button.
  • RerunBlockedReason and RerunReviewDialog are added to react-compiler.config.js.

🤖 Generated with Claude Code

@camielvs
camielvs added this pull request to stack #2930 October 22, 2026 22:34
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: cvs/team-run-page/d6f8ee7

@camielvs
camielvs force-pushed the cvs/team-run-page branch 2 times, most recently from d257206 to d7c3946 Compare October 23, 2026 23:50
@camielvs
camielvs force-pushed the cvs/team-run-page branch 2 times, most recently from 53c49c7 to 7f26527 Compare October 27, 2026 00:59
@camielvs
camielvs force-pushed the cvs/team-run-page branch 2 times, most recently from 81146db to b2b3b4b Compare October 29, 2026 01:32
@camielvs
camielvs force-pushed the cvs/team-run-page branch 2 times, most recently from 2793b31 to da10892 Compare October 29, 2026 20:21
Comment thread src/services/pipelineRunService.ts Resolved
Comment thread src/services/teams/useRunTeam.ts Resolved
@camielvs camielvs mentioned this pull request Oct 30, 2026
1 of 3 tasks
@camielvs
camielvs marked this pull request as ready for review October 30, 2026 21:23
@camielvs
camielvs requested a review from a team as a code owner October 30, 2026 21:23
A run's team is the team of the projects it's filed under, read from its
annotations. The run page now uses it in three places.

Cancel and run notes: the backend only lets a run's creator cancel or
annotate it. A run the team created can now be cancelled and its notes
edited by a member who can write to the team, and both requests carry the
team header. A run you created keeps working as before, without the header,
even when it's filed under a team's project.

Rerun: a rerun keeps the identity of the run it repeats. A run the
team created reruns as the team, so its secrets resolve the same way.
Someone who can't act as the team can't rerun it, and the button and
the run menus say why. Any other run reruns by the same rule as a
submit: as you, unless only the team has a secret it uses. A rerun
whose arguments use secrets missing for whoever it goes as, or whose
secrets are split, asks first, says why and offers the same Run as
choice. Rerun waits for the team and the secrets check, and is refused
for projects on different teams. When the run's team can't be checked,
only the run's creator can rerun it. The rerun button and the run menus
shared two copies of the rerun logic. The button now uses the menus'
hook, so the team rules live in one place.

Cancel and annotation failures now show the backend's reason instead of
"Access denied (403)": they read the response the way creating a run
does. As before, a request a sign-in redirect intercepted fails rather
than passing for a success. A failed notes save used to be silent and
now shows a toast.

useTeamForRunAnnotations had no callers and is replaced by useRunTeam,
which also waits for the annotations and reports when they can't be read.
Without the team header configured, useRunTeam is "none" straight away
and reads no annotations, so cancel, notes and rerun behave as before.
The React Compiler covers the new RerunBlockedReason and
RerunReviewDialog.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@camielvs
camielvs merged commit 47c6edf into master Oct 31, 2026
18 checks passed
@camielvs
camielvs deleted the cvs/team-run-page branch October 31, 2026 00:25
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.

2 participants