Skip to content

Deprecate using arguments starting with $, @, & and % as literal values #4909

Description

@pekkaklarck

We are planning to support $var syntax in addition to ${var} in the future (#4674). The plan was to do that already in RF 7.0, but it turned out that this would be too badly backwards incompatible. Probably the biggest problem would be that the Browser library accepts passwords in format $secret and resolves the variable value internally to avoid the value being logged automatically. After the planned change $secret, would be considered exactly the same as ${secret} meaning that a confidential value could leak.

We still believe that supporting the $var syntax is a good idea, but we need to first deprecate using values starting with $ or any other variable identifier. That means that using, for example,

Log Many    $value    @another

will cause a deprecation warning and the value needs to be escaped like

Log Many    \$value    \@another

Activity

  1. added this to the v7.0 milestone on Oct 23, 2023
  2. pekkaklarck commented on Nov 13, 2023

    @pekkaklarck
    MemberAuthor

    This is actually pretty complicated to do. The problem is that we in general want to deprecate usages like

    Keyword    $foo
    

    but there are special case like

    Evaluate    $foo
    

    and

    IF    $foo
    

    where it absolutely shouldn't be done.

    In practice we'd need to separate the above cases somehow. It's doable and we need to do that before adding support for the $var syntax anyway, but we don't have time for that now. Moving this issue forward.

  3. modified the milestones: v7.0, v7.1 on Nov 13, 2023
  4. sebastianciupinski commented on Feb 12, 2024

    @sebastianciupinski

    @pekkaklarck before that, consider please CLI switch to keep old behavior.

  5. damies13 commented on Mar 19, 2024

    @damies13

    I am curious if the goal is to get to a point where

    • ${var} --> $var
    • @{list} --> @list
    • &{dict} --> &dict
    • %{env} --> %env

    Why do you have to deprecate arguments starting with $, @, & and % first? so this means for a period of time both formats will not work, what will the new temporary variable syntax be?

    Perhaps I've misunderstood this change? I don't see why new and old variable syntax can't be supported for a few releases and then old style removed after a few releases with the deprecation warning.

  6. pekkaklarck commented on Mar 19, 2024

    @pekkaklarck
    MemberAuthor

    The problem is that if someone nowadays uses

    Keyword    $xxx
    

    so that $xxx is a literal value, the behavior will change and the usage needs to be changed to

    Keyword    \$xxx
    

    As a concrete example, Browser library uses the $name style with passwords ro avoid their values being accidentally disclosed.

  7. damies13 commented on Mar 19, 2024

    @damies13

    Ah so it's only literal values not variables that start with those characters that are being depreciated and now need to be escaped? That wasn't clear, I thought this was deprecating variables (e.g. ${xxx}) that started with those characters, and that had me worried.

  8. modified the milestones: v7.1, v8.0 on Mar 25, 2024
  9. modified the milestones: v8.0, v7.2 on Sep 9, 2024
  10. pekkaklarck commented on Sep 10, 2024

    @pekkaklarck
    MemberAuthor

    As already mentioned above, the Browser.Fill Secret keyword requires using $secret syntax to avoid passwords being accidentally logged. If we deprecate the $var syntax, existing Fill Secret usages will cause deprecation warnings. Here are some options how to handle that:

    1. Do nothing and require users to escape the syntax like \$secret.
    2. Change the keyword so that it accepts secrets also in some other format. Possibly it could be just secret.
    3. Implement a built-in way to create and pass variables so that their actual value is never logged. We already have Support creating "secret" variables that hide their values in data and log files #4537 about that, but it's targeted for RF 8.0 and we haven't yet agreed on the design.

    What do you @Snooz82 think about this? Is it fine for Browser users to use the \$secret syntax or are you interested to enhance Fill Secret? Built-in "secret variable" support in Robot would be best, but then we needed to do some design decisions related to #4537. Regardless the design, that functionality shouldn't be too complicated to implement and could probably included in RF 7.2 as well.

  11. modified the milestones: v7.2, v7.3 on Nov 29, 2024
  12. pekkaklarck commented on Nov 29, 2024

    @pekkaklarck
    MemberAuthor

    This requires more discussion and design. We decided to move it RF 7.3 to be able to get RF 7.2 out soon.

  13. modified the milestones: v7.3, v7.4 on Apr 4, 2025
  14. modified the milestones: v7.4, v7.5 on Jun 24, 2025
  15. modified the milestones: v7.5, v8.0 on Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions