Notes here from our discussion at Jenkins World.
TL;DR: Would be nice to support switching from commit to edge server cleanly for sync only operations.
We recently set up an edge server for our commit server. Ideally we would like to be able to update the P4Port value for the same credential used for our Pipeline jobs so that we don't need to configure all of them to point to a new credential. The jobs would be using the same workspace. There is an issue though that if we only update the P4Port value from the commit to the edge server, then the workspace is still tied to the commit server and the sync will fail. It would be nice if the P4 Plugin could handle the switch from the commit server to edge server if the P4Port value on the credential has been changed.
We had discussed about using p4 reload to do this, however, this requires super permissions for the account (if the -f force flag is used), which our account does not have.
The other possible solution we had mentioned was to:
- Record the changelist the workspace is currently sync'd to on the commit server
- Delete the client from the commit server
- Recreate the client on the edge server
- Perform a p4 flush / p4 sync -k to the changelist value
- Perform a reconcile to the new changelist value being sync'd to