pvillard31 opened a new pull request, #10994:
URL: https://github.com/apache/nifi/pull/10994
# Summary
NIFI-15696 - Add Rebase operation for versioned process groups
When a versioned process group is at version N with local modifications
(state LOCALLY_MODIFIED_AND_STALE), upgrading to a newer version requires
reverting all local changes first, then changing version, then manually
re-applying every customization. This is error-prone, causes unnecessary
downtime, and discourages users from upgrading.
This change adds a "Rebase" operation that upgrades a versioned process
group to a newer registry version while automatically preserving compatible
local changes — analogous to git rebase.
**How it works:**
The rebase operation has two phases:
- Analysis (read-only): Computes a three-way diff between the local flow,
the base registry version (N), and the target registry version. Each local
change is classified as Compatible (will be preserved), Conflicting (same field
changed both locally and upstream to different values), or Unsupported (change
type not yet supported by a rebase handler). Rebase is only allowed when all
local changes are compatible.
- Execution: Deep-clones the target version snapshot, overlays compatible
local changes onto it to produce a merged snapshot, then synchronizes the
process group to the merged snapshot using the existing FlowUpdateResource
async infrastructure. The VCI is set to the clean target version so that
subsequent state checks correctly report LOCALLY_MODIFIED.
Supported change types (for this first iteration, this will evolve over
time):
- POSITION_CHANGED, SIZE_CHANGED, BENDPOINTS_CHANGED — cosmetic, always
compatible (local wins)
- PROPERTY_CHANGED, PROPERTY_ADDED — compatible unless upstream changed the
same property on the same component to a different value (convergent changes
where both sides set the same value are accepted)
- COMMENTS_CHANGED — compatible unless upstream also changed comments on the
same component
Unsupported change types (examples: COMPONENT_ADDED, COMPONENT_REMOVED)
block the rebase with a clear message. The handler architecture is extensible —
adding support for a new change type requires only implementing a single
RebaseHandler class.
We follow a similar approach as what already exists for the new API
endpoints:
- GET /versions/rebase-analysis/process-groups/{id}?targetVersion={version}
returns the three-way analysis
- POST /versions/rebase-requests/process-groups/{id}
initiates async rebase execution
- GET/DELETE /versions/rebase-requests/{id}
polling and cleanup (reuses FlowUpdateResource)
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue
created
### Pull Request Tracking
- [ ] Pull Request title starts with Apache NiFi Jira issue number, such as
`NIFI-00000`
- [ ] Pull Request commit message starts with Apache NiFi Jira issue number,
as such `NIFI-00000`
- [ ] Pull request contains [commits
signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
with a registered key indicating `Verified` status
### Pull Request Formatting
- [ ] Pull Request based on current revision of the `main` branch
- [ ] Pull Request refers to a feature branch with one commit containing
changes
# Verification
Please indicate the verification steps performed prior to pull request
creation.
### Build
- [ ] Build completed using `./mvnw clean install -P contrib-check`
- [ ] JDK 21
- [ ] JDK 25
### Licensing
- [ ] New dependencies are compatible with the [Apache License
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License
Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE`
files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]