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

Support empy v3 and v4. #1076

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Support empy v3 and v4. #1076

wants to merge 4 commits into from

Conversation

nuclearsandwich
Copy link
Contributor

This is the start of a PR to address #1014 and support empy v4.

I started by reviewing the changelog for differences in markup syntax and scanning our template corpus for affected usage and updating it.

Of the new constructs that are present in our code, these are the ones that I found doing basic token scanning:

The new extension markup syntax @((...)) is present via a grouping/one-tuple literal:
I'm honestly not sure whether this will be affected but it's one to watch.

 grep -F "@((" (fd -e em)
ros_buildfarm/templates/status/release_status_page.html.em:<td><span class="@pkg.status"@((' title="%s"' % pkg.status_description) if pkg.status_description else '')/></td>@

Use of : for “else” was already deprecated and has been removed. Use ! instead as in @(...?...!...)
The ! syntax is already usable in empy3 so it's been updated.

❯ rg "@\(.*\?.*\:.*\)" (fd -e em)
ros_buildfarm/templates/snippet/builder_parameterized-trigger.xml.em
13:              <failTriggerOnMissing>@(vars().get('missing_parameter_files_skip', False) ? 'true' : 'false')</failTriggerOnMissing>

I haven't expanded out these changes to include all files but am instead focusing on generate_release_script.py in order to smoke out issues and will then apply patches across all affected code before broader testing.

This is still very much a work-in-progress.

The `:` form is apparently deprecated and removed in EmPy v4.
The previous BANGPATH_OPT value expands to 'processBangpaths' in empy3
which is the inverse of the default `ignoreBangpaths` configuration
option in empy4.

It's unfortunate that these options are reversed since it complicates
our handling of 3 and 4.

I am not sure if this is cleaner than introspecting on the empy version
and sending the appropriate configuration but I'll start here and
iterate on review.
@nuclearsandwich nuclearsandwich self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant