Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeremystretch opened this issue Jan 22, 2025 · 0 comments
Labels
type: feature A new feature or functionality

Comments

@jeremystretch
Copy link
Contributor

jeremystretch commented Jan 22, 2025

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

@jeremystretch jeremystretch added the type: feature A new feature or functionality label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature or functionality
Projects
None yet
Development

No branches or pull requests

1 participant