App push mode should be immutable
We will soon introduce a "gitops" mode. It is better UX wise if develpers can't implicitly change the "mode" of the application through epinio push. For example, if an application was set up with GitJob to track a remote repository, a developer shouldn't be able to do an epinio push using a directory. That's because it would be unexpected for other developers using the same application.
We could allow the developers to explicitly change mode but they can as well just create a new application with the new mode. For now, we will completely disable other modes once an application is created.
Acceptance Criteria
- All new applications have their "mode" stored somewhere when they are first pushed
- Users can't push the application using a different mode after the first push.
cc @agracey
I think that makes a lot of sense.
Do you think it might be good to allow a —force override?
I'd leave it out until someone asks for it. What should epinio do when "gitops mode" it enabled, thus a repository is being tracked and all, and someone pushes from a directory with --force? Should "gitops mode" be permanently disabled? Should the settings for the remote tracking be deleted or simple disabled? Disabling requires additional flags and checks in the code.
Simply ignoring everything and just pushing the code, leaving everything else as it was before may be simple to do. But still, we could implement this in 2 steps.