Skip to content

Centralize logic for moving to neighboring commits in a Vuex action

Thomas Randolph requested to merge 18140-move-commit-action into master

What does this MR do?

For #18140 (closed).

Adds an action that allows any consumer to request that the current commit in state be swapped to a neighboring commit (either previous or next).

We already have an action for moving to a specific commit, but this requires knowing the correct commit. That means that anywhere in a UI that wants to move among commits (for example: when viewing a MR diff commit-by-commit), will need to calculate what the correct next or previous commit SHA is. This spreads that logic around the codebase too much as soon as there's more than one spot.

This single spot for that logic handles figuring out what the next or previous commit is and then defers actually moving to that commit to the changeCurrentCommit action already available.

Screenshots

N/A, all ~backstage

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports