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

[19505] Process environment variables on XML #3841

Merged
merged 25 commits into from
Sep 20, 2023
Merged

Conversation

MiguelCompany
Copy link
Member

@MiguelCompany MiguelCompany commented Sep 12, 2023

Description

This PR adds environment variables processing on the text values of XML.
This way the user could write something like the following:

# In bash terminal
export ROBOT_IP_ADDRESS=192.168.0.1

# In XML profile
<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
    <participant profile_name="env_var_parsing_example">
        <rtps>
            <builtin>
                <initialPeersList>
                    <locator>
                        <udpv4>
                            <address>${ROBOT_IP_ADDRESS}</address>
                        </udpv4>
                    </locator>
                </initialPeersList>
            </builtin>
        </rtps>
    </participant>
</profiles>

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • New feature has been added to the versions.md file (if applicable).
  • New feature has been documented/Current behavior is correctly described in the documentation.
    Related documentation PR: [19583] Add documentation for environment variables expansion on XML Fast-DDS-docs#556
  • N/A Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@MiguelCompany MiguelCompany added doc-pending Issue or PR which is pending to be documented versions-pending labels Sep 12, 2023
@MiguelCompany MiguelCompany added this to the v2.12.0 milestone Sep 12, 2023
@MiguelCompany MiguelCompany changed the title Process environment variables on XML [19505] Process environment variables on XML Sep 12, 2023
@MiguelCompany
Copy link
Member Author

@richiprosima Please test this

@MiguelCompany
Copy link
Member Author

@richiprosima Please test this

Signed-off-by: Miguel Company <[email protected]>
@MiguelCompany
Copy link
Member Author

@richiprosima Please test mac.

@MiguelCompany
Copy link
Member Author

@richiprosima Please test this

@MiguelCompany MiguelCompany added the needs-review PR that is ready to be reviewed label Sep 13, 2023
@MiguelCompany
Copy link
Member Author

@richiprosima Please test this

src/cpp/rtps/xmlparser/XMLElementParser.cpp Show resolved Hide resolved
src/cpp/rtps/xmlparser/XMLElementParser.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/xmlparser/XMLElementParser.cpp Outdated Show resolved Hide resolved
test/unittest/xmlparser/XMLElementParserTests.cpp Outdated Show resolved Hide resolved
test/unittest/xmlparser/XMLElementParserTests.cpp Outdated Show resolved Hide resolved
Copy link

@EduPonz EduPonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

@EduPonz
Copy link

EduPonz commented Sep 19, 2023

@richiprosima please test this

@EduPonz EduPonz added ci-pending PR which CI is running and removed needs-review PR that is ready to be reviewed labels Sep 19, 2023
@EduPonz EduPonz merged commit 5ecfe18 into master Sep 20, 2023
11 of 14 checks passed
@EduPonz EduPonz deleted the feature/xml-environment branch September 20, 2023 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-pending PR which CI is running
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants