Skip to content

Conversation

jonthegeek
Copy link
Contributor

Added a simple helper to escape curly braces for glue (ui_escape_glue() in utils-ui.R), then applied it in the relevant pr_*() functions. I used Positron Assistant (with Claude) and Google Gemini (using my personal setup) on this to test Positron Assistant, then revised their fixes significantly.

@jennybc Should I add a test for this in manual-pr-functions.R? Or I could automate this stuff with mocked github API calls if you want to go that far.

Fixes #2107

Added a simple helper to escape curly braces for glue (`ui_escape_glue()` in `utils-ui.R`), then applied it in the relevant `pr_*()` functions. I used Positron Assistant and Google Gemini as a test on this, then revised their fixes significantly.

Do you want to add a test for this in `manual-pr-functions.R`? Or I could automate this stuff with mocked github API calls if you want to go that far.

Fixes r-lib#2107
@jennybc
Copy link
Member

jennybc commented Sep 19, 2025

Thanks! I'd be happy with just a small direct test of the ui_escape_glue() utility, probably using the offending duckplyr tidyverse.org PR title as fodder. Looks like it was this: tidyverse/tidyverse.org#723.

Then I'd also love to hear that you've done an experiment with a relevant pr_*() function with a PR with a title that contains curly braces and you experience success fetching it or whatever. But you don't need to preserve this as a manual test and certainly no need to mock the GitHub API. We do not have automated tests of the functions that hit the live API and I just accept that situation.

@jonthegeek jonthegeek changed the title Escape curly braces in pr_title Escape curly braces in pr_title Sep 19, 2025
@jonthegeek
Copy link
Contributor Author

jonthegeek commented Sep 19, 2025

Fixed in #2171.

@jonthegeek jonthegeek closed this Sep 19, 2025
@jonthegeek jonthegeek deleted the fix-2107-escape_curlies branch September 19, 2025 16:14
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.

pr_fetch() missing escaping
2 participants