Commit Graph

24 Commits

Author SHA1 Message Date
alex.soh 72843c06f9 refactor: add code coverage, cover CLI commands with tests 2022-01-04 13:40:33 +01:00
Régis Behmo d82546adde fix: breaking "config save"
"config save" was not loading the full configuration prior to saving the
environment.
2021-12-20 21:19:10 +01:00
Régis Behmo c40e682f5d refactor: clarify configuration management
Previously, configuration management was very confusing because we kept mixing
"base" and "defaults" configuration:

- It was difficult to make the difference between core settings that were
  necessary (e.g: passwords) as opposed to others that could simply be
  defaulted to.
- The order of settings in config.yml mattered: config entries that depended on
  other needed to be defined later. As a consequence, Tutor was not compatible
  with Python 3.5, where dict entries are not sorted.
2021-12-20 21:19:10 +01:00
Shimul Chowdhury 31a41f81c3 feat: env only mode for config generation
chore: added -e flag to the changelog
2021-06-22 12:25:29 +02:00
Régis Behmo 336cb79fa8 refactor: better config type checking
I stumbled upon a bug that should have been detected by the type
checking. Turns out, considering that config is of type Dict[str, Any]
means that we can use just any method on all config values -- which is
terrible. I discovered this after I set `config["PLUGINS"] = None`:
this triggered a crash when I enabled a plugin.
We resolve this by making the Config type more explicit. We also take
the opportunity to remove a few cast statements.
2021-04-18 18:02:02 +02:00
Régis Behmo 0a670d7ead refactor: add type annotations
Annotations were generated with pyannotate:
https://github.com/dropbox/pyannotate

We are running in strict mode, which is awesome!

This affects a large part of the code base, which might be an issue for
people running a fork of Tutor. Nonetheless, the behavior should not be
affected. If anything, this process has helped find and resolve a few
type-related bugs. Thus, this is not considered as a breaking change.
2021-03-15 21:46:55 +01:00
Régis Behmo 070b75caa4 fix: parsing of YAML config params with "=" signs
Close #405.
2021-03-08 12:24:40 +01:00
Régis Behmo daabbdc3b6 Simplify quickstart by using save.callback 2020-11-12 15:31:13 +01:00
Régis Behmo 998dec7149 Fix template name separator for Windows users
See: https://github.com/overhangio/tutor/issues/381
2020-11-07 16:37:43 +01:00
Régis Behmo 7eb99a3811 Minor code refactoring, for naming clarity 2020-02-27 17:14:00 +01:00
Régis Behmo 731de6a747 Fix incorrectly parsed empty strings in `config save --set ...=...`
When running `config save --set KEY=""`, KEY was incorrectly interpreted
as null.
2020-01-21 18:32:34 +01:00
Régis Behmo 72e23f3f96 Add `config render` command
This is going to be useful for using custom themes with user-defined
variables.
2020-01-16 17:15:55 +01:00
Régis Behmo 13de3c8adc Move "-r/--root" option to parent command level 2019-12-15 18:52:58 +01:00
Régis Behmo ce8a0315cb Add ``-U/--unset`` option to ``config save`` 2019-07-08 06:29:24 +08:00
Régis Behmo bc21102cf4 Make configuration silent (non-interactive) by default
Thus, we remove the -y/--yes options, which were kind of unintuitive,
and we add instead `-i/--interactive`. The quickstart commands remain
interactive by default, but can be silenced with `-I/--non-interactive`.
2019-06-07 22:49:45 +02:00
Régis Behmo 6a68c4cc20 Progress on the plugins/k8s front
This commit introduces many changes:
- a fully functional minio plugin for local installation
- an almost-functional native k8s deployment
- a new way to process configuration, better suited to plugins

There are still many things to do:
- get rid of all the TODOs
- get a fully functional minio plugin for k8s
- add documentation for pluginso
- ...
2019-06-07 22:49:45 +02:00
Régis Behmo f5c225231f Move config logic to dedicated non-command module 2019-06-07 22:49:45 +02:00
Régis Behmo 3b108d21de 🔌 Introduce a plugin system for tutor
This adds the basic feratures that we need for a working plugin system,
but there are still many TODOs in the codebase.
2019-06-07 22:49:45 +02:00
Régis Behmo 58d2af30a0 Minor formatting 2019-05-29 11:20:37 +02:00
Régis Behmo d8bea87a2f Fix autocomplete for some commands
Auto-completing commands that were imported with `name=...` option was
incorrect.
2019-05-29 10:31:53 +02:00
Régis Behmo 65dce18908 Add TUTOR_VERSION to template variables 2019-05-29 09:53:54 +02:00
Régis Behmo 0199a1e916 Add convenient fmt.echo_* functions 2019-05-29 09:53:54 +02:00
Régis Behmo 407659ff06 Major refactoring of config module
Configuration loading was overly complex. Here, we simplify it
drastically with reasonable defaults. Hacky additional variables are
unncessary now that we use custom jinja2 filters.
2019-05-29 09:53:54 +02:00
Régis Behmo 754da2f06f Move command modules to dedicated directory 2019-05-29 09:53:54 +02:00