Redirect with the error when a pipeline trigger token update fails

What does this MR do and why?

Projects::TriggersController#update rendered the edit action when Ci::PipelineTriggers::UpdateService failed, but the controller has no edit template, so a failed update raised a missing template error instead of showing the error. The action now redirects back to the CI/CD settings page with the service message as a flash alert, matching the create and destroy actions in the same controller.

The UI edits trigger tokens through GraphQL, so this path is only reached by direct HTML requests. It was found while adding a rate limit to the trigger token services (!267781 (merged)), which gives the service a new way to fail.

References

Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/636907

Screenshots or screen recordings

No UI change on the success path.

How to set up and validate locally

  1. As a Maintainer who does not own a pipeline trigger token, send a PUT to /<namespace>/<project>/-/triggers/<trigger_id> with a trigger[description] parameter and the CSRF token (for example from the browser console on the CI/CD settings page).
  2. Before this change the request fails with a missing template error. Now it redirects to Settings > CI/CD and shows the service's error message.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading