robotcode icon indicating copy to clipboard operation
robotcode copied to clipboard

[Enhancement] Extend documentation for `robot.toml` and describe the differences between normal settings and settings that can be `extend-` better

Open johndoorzon opened this issue 1 year ago • 4 comments

Describe the bug When I use multiple profiles with matching sections (for example variables) the second profile completely overwrites the first profile section. In my case I had profiles with different variables and only the variable of the second profile was used. This is not what I expect. When using robot with arguments, I can use an argument several times with different values and only the last will count (robot -v ENV:dev -v ENV:test . will run with variable ENV set to test) Using a robot.toml should have the same behavior, so I expect the corresponding sections to be merged. If an item in the section is repeated in the next profile, the value should be overwritten with the latter.

Steps To Reproduce Attached a robot file and a toml file. run this in the terminal: robotcode -p one -p two -p three robot .

This test logs 0-0-3 in the console

Expected behavior I expect it to log 1-2-3, but the variables section in profiles one and two are overwritten so the default values are logged. It should behave the same as: robot -v One:1 -v TWO:2 -v THREE:3 .

Desktop (please complete the following information):

  • VS Code Version 1.95.0
  • RobotCode Version 0.96.0
  • OS: macOS 15.1
  • Python Version 3.12.5
  • RobotFramework Version 7.1

Attachment: Archive.zip

johndoorzon avatar Nov 07 '24 20:11 johndoorzon

To add to an existing setting, such as variables, without overwriting those already defined in the default or other profiles, use the extend- prefix as shown below:

[profiles.one]
extend-variables = {ONE = "1"}

[profiles.two]
extend-variables = {TWO = "2"}

[profiles.three]
extend-variables = {THREE = "3"}

Currently, this feature is undocumented but will be included in the official documentation in the coming weeks. Meanwhile, you can refer to this video tutorial for more details: RobotCode Tutorial.

d-biehl avatar Nov 11 '24 21:11 d-biehl

@johndoorzon did you try it? Can I close this issue?

d-biehl avatar Nov 19 '24 11:11 d-biehl

It works if I use extend-variables in stead of variables. But the documentation is misleading: The variables documentation says: "corresponds to the -v --variable name:value * option of robot" (this is what I expected, but no mention of overwriting everything)

extend-variables has the same documentation, but they work differently.

So please update the documentation so the difference between them is clear.

johndoorzon avatar Nov 19 '24 12:11 johndoorzon

Hi @johndoorzon,

Thank you for your feedback! As mentioned earlier, the updated documentation is already in progress and will be published as soon as possible.

I’d like to take a moment to explain that I’m the sole developer maintaining this project, while also working a full-time job and taking care of my family. This means I have limited time to dedicate to the project, and while I strive to address issues and feedback as quickly as possible, implement new features and so on, sometimes other priorities take precedence.

Since this is not a bug but rather an enhancement to improve the documentation, I’ll reclassify it as such and keep it open until the update is made. That said, if this is a priority for you, I’d encourage you to contribute directly—whether by proposing specific wording for the documentation or submitting a pull request. Community contributions are incredibly valuable and help move the project forward for everyone!

Thank you again for your understanding, patience, and for helping make RobotCode better. 😊

Best regards, d-biehl

d-biehl avatar Nov 19 '24 15:11 d-biehl