-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Configuration file support #5337
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
Comments
What is this configuration for? |
Hello @pekkaklarck any updates on this ? Will there be a toml / yaml file for configuration settings ? What purpose will it serve ? |
I finally updated the description so hopefully it now answers your questions @rinatagishev and @LucianCrainic. While updating the description I realized now many design decisions there are to be made and how much getting all this implemented does. In addition to the support for finding and loading configuration files, we need to integrate it with the current code for parsing command line options and handling settings internally. Unfortunately most of the current code is pretty bad, and I believe we should rewrite it as part of this project. That allows us to design this properly, but it also increases the development effort. My current thinking is that this is so big task that it's better to move it to RF 8.0 scope. Doing this in a major release would also help a little if we needed to make some backwards incompatible changes. If you feel that this should be implemented earlier, please comment this issue. In that case you need to be prepared to help with the design and implementation work, though. |
Not sure if you are aware: Robotcode introduced Maybe, the efforts could be less when adopting the approach of Robotcode. That would save design and implementation efforts. Until then, users can already use configuration files by utilizing Robotcode. |
Hi Pekka, Your point 3 sounds good and, in fact, it pretty much follows what is being done in https://docs.pyinvoke.org/en/stable/concepts/configuration.html#config-hierarchy In point 5 the configuration could come from pyproject.toml if robot.toml is not found. I also think that while configuration is being processed it would be quite easy to handle environment variables and including them as one source of configuration as well. |
Robot Framework should get support for configuration files. Configuration files should be loaded automatically (unless disabled) and allow specifying same settings that can be given from the command line. This would make it possible to, for example, to automatically enable the RPA mode, specify listeners that should always be used, and so on. This would be especially useful with features that require more complex configuration such as custom settings (#4409).
The main reason Robot currently doesn't support configuration files is that it has its own argument file concept that has many of the same benefits. Argument files aren't loaded automatically, though, and them being a Robot-only solution means that you cannot have all project configuration in one place.
Although the basic idea is clear, there are lot of design decisions to be made:
pyproject.toml
or a customrobot.toml
? I believe we should support both. Actual settings should also be exactly the same regardless the file, but the top level table structure is naturally different.pyproject.toml
should be only looked from the current directory, but with ourrobot.toml
it would probably make sense to support system wide, user wide, project wide, and custom configuration so that the latter ones have precedence over earlier ones. System wide and user wide configs would be loaded from an OS specific configuration file locations, project wide configuration from the current directory, and custom configs could be given using a command like option like--config path/to/custom.toml
. There should also be a way to disable loading configuration files automatically.The text was updated successfully, but these errors were encountered: