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

Trim whitespace on external status codes for response templates #3997

Merged
merged 1 commit into from Jul 1, 2022

Conversation

nephila-nacrea
Copy link
Contributor

@nephila-nacrea nephila-nacrea commented Jun 27, 2022

Whitespace was not being trimmed from external status codes, which meant that, if a user accidentally included leading or trailing whitespace, their code would not work in Confirm, etc.

Stemmed from a Bucks ticket (https://mysocietysupport.freshdesk.com/a/tickets/2146) but is a change that applies to all cobrands.

Closes https://github.com/mysociety/societyworks/issues/2818.

@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #3997 (01b7dbe) into master (e8c63b3) will decrease coverage by 8.90%.
The diff coverage is n/a.

❗ Current head 01b7dbe differs from pull request most recent head ac325aa. Consider uploading reports for the commit ac325aa to get more accurate results

@@            Coverage Diff             @@
##           master    #3997      +/-   ##
==========================================
- Coverage   82.54%   73.63%   -8.91%     
==========================================
  Files         362       55     -307     
  Lines       25025     4752   -20273     
  Branches     3777        0    -3777     
==========================================
- Hits        20656     3499   -17157     
+ Misses       3185     1253    -1932     
+ Partials     1184        0    -1184     
Impacted Files Coverage Δ
web/cobrands/fixmystreet/assets.js 89.13% <0.00%> (-0.67%) ⬇️
perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
perllib/Integrations/SCP.pm
perllib/FixMyStreet/SendReport/Email.pm
perllib/FixMyStreet/Roles/BoroughEmails.pm
perllib/FixMyStreet/DB/Schema.pm
perllib/Integrations/Bartec.pm
perllib/OIDC/Lite/Client/WebServer/AuthCodeFlow.pm
perllib/FixMyStreet/DB/ResultSet/Secret.pm
perllib/FixMyStreet/DB/Result/Alert.pm
... and 298 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8c63b3...ac325aa. Read the comment docs.

@nephila-nacrea nephila-nacrea force-pushed the strip-surrounding-whitespace-from-ext-status-code branch from 0693a5a to 8274657 Compare June 28, 2022 08:33
@nephila-nacrea nephila-nacrea marked this pull request as ready for review June 28, 2022 08:36
@dracos dracos removed the request for review from MorayMySoc June 28, 2022 09:44
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Looks good, I suggest different functions it might be better to override, if I've understood it correctly.

perllib/FixMyStreet/DB/Result/ResponseTemplate.pm Outdated Show resolved Hide resolved
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Looks good :)

@dracos dracos force-pushed the strip-surrounding-whitespace-from-ext-status-code branch from ea7a55c to ac325aa Compare July 1, 2022 08:34
@dracos dracos merged commit ac325aa into master Jul 1, 2022
@github-pages github-pages bot temporarily deployed to github-pages July 1, 2022 09:05 Inactive
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.

None yet

2 participants