-
Notifications
You must be signed in to change notification settings - Fork 73
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
RFE: Make the toolbox idempotent #81
Comments
In the beginning I was not convinced about this feature of offering a way for create or update out of the box. After a productive discussion with @mikz, I implemented OpenAPI spec importing command this way. I am now quite satisfied with the resulting behavior. It's idempotent and CLI user does not deal with Indeed, I now think this is the pattern to go with copy service command. It would merge |
Making One proposition would be to deprecate
WDYT @mikz @nmasse-itix, should we break backwards compatibility and change Maybe |
@eguzki yep, the name is quite unfortunate, but that can be worked out. How working with system_name breaks backwards compatibility? It is extending the functionality, but not breaking anything no? What is the difference between copy and update, that sync would unify? For example:
And when designing new commands I'd seriously consider not having the verb first, but rather the object (eg. |
The idea behind the improvement is twofold:
WRT, |
I agree with @mikz that object, verb is a better order. Naming-wise, I was playing with the idea that copy, update and import could all be combined in one: the source can be a service or a specification. In the end the goal is to create or update a service. @nmasse-itix & @mikz what do you think? |
@eguzki but how is requiring We could start unifying |
I would prefer something like this: with named parameters: 3scale service copy --from 3scale-dev/my-service --to 3scale-prod/my-service or with positional parameters 3scale service copy 3scale-dev/my-service 3scale-prod/my-service syntax for If the target service is already there, it is created otherwise just updated and this should be the default behavior. @mikz I would like the 3scale toolbox to be as idempotent as possible and do not require special options to differentiate between create and update. Otherwise, it clutters the CI/CD pipeline with:
See the tasks/steps folder for concrete exemple of this. |
@nmasse-itix I understand. That is still doable without any breaking change with a single flag to 3scale copy service --allow-create --source=some --destination=other Sure, we eventually want better UX, but for a start to explore the ideas, this is enough IMO. |
I find confusing something like this
And for implementation details, toolbox first tries to find service with that system name, if it fails, tries with I like the design of @nmasse-itix it is very clear
We can modify |
@eguzki implementation wise it is easy, id is numerical and system_name contains other characters, so just try to find it by ID if it is numerical and fall back to system_name otherwise. But eventually, this should be provided by the porta API and transparent for the toolbox. I agree that the design suggested in |
Ok, I will proceed changing
This somehow deprecates |
The 3scale toolbox is being improved to become the recommended way to configure and deploy services in 3scale. This fits in a broader approach of Continuous Delivery that has been started by several customers / communities (I personally maintain the threescale-cicd ansible role. Those approaches are using different means to drive the 3scale admin portal, some are using the 3scale-cli other (like the threescale-cicd role) are using the 3scale REST APIs.
If we want to make the 3scale_toolbox the de facto standard for interacting with 3scale, we need it to be usable in a CI/CD approach.
At a glance, here are the features I expect from the 3scale toolbox :
oc cmd -o yaml
)Idempotency
When continuous delivering an API, the delivery pipeline needs to create or update the 3scale service definition in addition to each linked object.
Forcing the user to specify if the service needs to be created or updated leads to a lots of code in the pipeline (list existing services, create is missing, update if existing).
Proposition
The 3scale_toolbox does not enforce the user to choose between create or update operations. Instead, if the object exists, it updates it, otherwise it creates it.
Example
=> If the service exists, it is updated
=> Otherwise it is created
This feature needs to be in the toolbox's core so that every plugin can leverage this feature.
The text was updated successfully, but these errors were encountered: