Skip to content

[22850] Fix python code generation for bounded strings (backport #440)#443

Merged
MiguelCompany merged 4 commits into3.3.xfrom
mergify/bp/3.3.x/pr-440
Sep 25, 2025
Merged

[22850] Fix python code generation for bounded strings (backport #440)#443
MiguelCompany merged 4 commits into3.3.xfrom
mergify/bp/3.3.x/pr-440

Conversation

@mergify
Copy link

@mergify mergify bot commented Feb 26, 2025

Description

This PR introduces the following improvements on the code generated for SWIG interfaces:

  1. A setter for fixed_string members receiving a standard string is added.
  2. A %template for each fixed_string member is generated.

This allows setting bounded string members with either of the following alternatives:

  1. struct_name.member_name("string value")
  2. fixed_str = fixed_string_16("string value")
    struct_name.member_name(fixed_str)
    

@Mergifyio backport 4.0.x

Contributor Checklist

  • Commit messages follow the project guidelines.

  • 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

  • N/A: New feature has been documented/Current behavior is correctly described in the documentation.

  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

This is an automatic backport of pull request #440 done by [Mergify](https://mergify.com).

@mergify mergify bot added the conflicts label Feb 26, 2025
@mergify
Copy link
Author

mergify bot commented Feb 26, 2025

Cherry-pick of 8eaca9a has failed:

On branch mergify/bp/3.3.x/pr-440
Your branch is up to date with 'origin/3.3.x'.

You are currently cherry-picking commit 8eaca9a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/main/java/com/eprosima/fastcdr/idl/templates/TypesSwigInterface.stg

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@MiguelCompany MiguelCompany added this to the v3.3.2 milestone Feb 26, 2025
@github-actions github-actions bot added the ci-pending PR which CI is running label Feb 26, 2025
@MiguelCompany
Copy link
Member

@Mergifyio rebase

@mergify
Copy link
Author

mergify bot commented Apr 25, 2025

rebase

✅ Branch has been successfully rebased

@MiguelCompany MiguelCompany force-pushed the mergify/bp/3.3.x/pr-440 branch from 7fbc3dd to c71d8de Compare April 25, 2025 09:00
@MiguelCompany MiguelCompany requested review from MiguelCompany and removed request for richiware April 25, 2025 09:01
@MiguelCompany
Copy link
Member

@Mergifyio rebase

@mergify
Copy link
Author

mergify bot commented Sep 23, 2025

rebase

✅ Branch has been successfully rebased

@MiguelCompany MiguelCompany force-pushed the mergify/bp/3.3.x/pr-440 branch from c71d8de to 2607dea Compare September 23, 2025 09:15
@MiguelCompany MiguelCompany requested review from MiguelCompany and removed request for MiguelCompany September 23, 2025 09:15
@MiguelCompany MiguelCompany self-requested a review September 25, 2025 08:50
@MiguelCompany
Copy link
Member

@Mergifyio rebase

* Refs #22835. SWIG extend to set fixed_string from std::string.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22835. SWIG export template for fixed_string members.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22835. Fix access to typecode.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22835. Fix max size typo.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22835. Fix exported template name.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22835. Fix extend code.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22850. Apply suggestions from review.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
(cherry picked from commit 8eaca9a)

# Conflicts:
#	src/main/java/com/eprosima/fastcdr/idl/templates/TypesSwigInterface.stg
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
@mergify
Copy link
Author

mergify bot commented Sep 25, 2025

rebase

✅ Branch has been successfully rebased

@MiguelCompany MiguelCompany force-pushed the mergify/bp/3.3.x/pr-440 branch from 2607dea to 726aa91 Compare September 25, 2025 13:14
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
@MiguelCompany MiguelCompany requested review from MiguelCompany and removed request for MiguelCompany September 25, 2025 13:16
Copy link
Member

@MiguelCompany MiguelCompany 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

@MiguelCompany MiguelCompany merged commit b0208ca into 3.3.x Sep 25, 2025
7 checks passed
@MiguelCompany MiguelCompany deleted the mergify/bp/3.3.x/pr-440 branch September 25, 2025 15:17
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.

1 participant