Skip to content
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

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

Open
johndoorzon opened this issue Nov 7, 2024 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@johndoorzon
Copy link

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 johndoorzon added the bug Something isn't working label Nov 7, 2024
@d-biehl
Copy link
Member

d-biehl commented Nov 11, 2024

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
Copy link
Member

d-biehl commented Nov 19, 2024

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

@johndoorzon
Copy link
Author

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.

@d-biehl
Copy link
Member

d-biehl commented Nov 19, 2024

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 d-biehl changed the title [BUG] robot.toml configuration: When using multiple profiles, corresponding sections should be merged in stead of overwritten [Enhancement] Extend documentation for robot.toml and describe the differences between normal settings and settings that can be extend- better Nov 19, 2024
@d-biehl d-biehl added documentation Improvements or additions to documentation enhancement New feature or request and removed bug Something isn't working labels Nov 19, 2024
@d-biehl d-biehl self-assigned this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants