Skip to content

Migrate legacy notes actions spec to Pinia

What does this MR do and why?

This MR migrates Legacy Notes Vuex actions spec to Pinia. The Legacy Notes store has been migrated in this MR.

This MR also introduces a tryStore helper for Pinia stores to avoid circular dependencies. Circular dependencies in stores are a sign of a flawed design of the stores, which demands refactoring. In this example legacyNotes actions and getters were depending on legacyDiffs actions and getters and vice versa. This shouldn't happen in a properly designed store. To mitigate that I've introduced a tryStore helper which accesses the store through Pinia internals, thus avoiding this problem. This approach should only be used during migration and removed after the stores are refactored.

Part of Migrate Diffs and Notes Vuex stores to Pinia (#474653 - closed).

How to set up and validate locally

  1. Run this spec: spec/frontend/notes/store/legacy_notes/actions_spec.js

Merge request reports

Loading