Skip to content

Implement the ability to squash individual changes when merging a branch #198

@jeremystretch

Description

@jeremystretch

Plugin Version

v0.5.2

Proposed functionality

When a branch is being merged, enable the user to select specific changes to "squash." Squashing collapses one or more successive operations within a branch into the first operation for the affected object.

For example, consider the following set of actions performed within a branch:

  1. Create a site named "Site 1" with status "Active"
  2. Create a device within the site
  3. Change the site's status to "Planned"
  4. Assign the site to a region
  5. Add another device to the site

In this example, changes 1, 3, and 4, can be safely collapsed into a single create operation. We can expose this ability by including a "squash" checkbox next to each planned change when merging a branch. (It might also make sense to include a "squash all" option, but feasibility needs to be explored further.)

Use case

The primary driver for this functionality is to enable users to rectify conflicts preventing a branch from being merged. (This issue is largely captured under #32.) For example, consider the following series of events:

  1. Branch A is created.
  2. A new site named Site 1 is created in Branch A.
  3. A new site with the same name is created in the main database.
  4. A user attempts to merge Branch A. This fails due to the duplicate site name.
  5. The user renames Site 1 to Site 2 within the branch.
  6. The user attempts again to merge Branch A. This still fails because the change set is replayed in chronological order: The initial creation of the site will always fail before the following update is processed.

With the ability to squash changes, the update to the site object can be squashed into the original create action, rectifying the conflict and allowing the branch to be merged successfully.

External dependencies

N/A

Metadata

Metadata

Assignees

Labels

app: branchingcomplexity: highExpected to require a large amont of time and effort to implement relative to other tasksneeds milestoneAwaiting prioritization for inclusion with a future releasestatus: backlogtype: featureA new feature or functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions