Background
One of the outcomes of T346153: Decision request – Toolforge (re)architecture is that we have decided to move forward with consolidating all the existing Toolforge CLIs into a single one. This is a follow-on decision request to decide on the details of how this should be done.
The CLIs are:
- jobs
- webservice
- build
- envvars
- additionally, there's the toolforge wrapper
Decision Record
Risks & Constraints
- We should avoid breaking the current user experience and overall CLI semantics
- Regardless of the option chosen, care must be taken to not introduce or carry over technical debt that could complicate future development
- Each option will require varying levels of development effort and time, which should be considered in the context of other ongoing projects and priorities
Option 1
Merge the existing Python CLIs
Option 2
Rewrite a CLI from scratch in Go
Option 3
Create a unified Open API definition for the CLI first, then autogenerate a Go client from it
Option 4
Create a unified Open API definition for the CLI first, then autogenerate a Python client from it
Note: This option was added during the decision meeting
Option N
Add your option here
The Pros & Cons for each option will be added after discussion, but before voting.
Edit: summary of pros/cons
1. Merge Existing Python CLIs
Pros:
- Uses existing Python code and expertise
- Potentially quicker to implement due to familiarity
- More accessible to new and less experienced contributors
Cons:
- Python's performance is generally slower compared to Go (cli speed is however not a bottleneck)
- Lacks single-binary packaging which can be a limitation
- Might require more effort for packaging and distribution
2. Rewrite CLI from Scratch in Go
Pros:
- Benefits from Go's performance and efficiency
- Enables single binary packaging, simplifying distribution
- Full control over design and implementation from the start
Cons:
- Inability to reuse existing Python codebase
- Go's ecosystem is less rich compared to Python, which may limit certain functionalities
- Potentially longer development time due to Go's relative verbosity and learning curve
3. Create a Unified Open API Definition, Autogenerate a Go Client
Pros:
- Lowers long-term maintenance due to autogeneration
- Unified API could provide broader benefits and standardization
- Reduces human error in coding
- Ensures comprehensive API documentation
Cons:
- Time-intensive to create a complete and effective Open API specification
- Autogenerated code may not fully leverage Go's features, possibly leading to less optimized solutions
- Reliance on specific tooling and technologies for autogeneration
- Like option 2, inability to reuse the existing Python codebase