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

Fixes offenses raised by Rails/UnusedRenderContent #12582

Merged

Conversation

cyrillefr
Copy link
Contributor

What? Why?

Contributes to #11482

The: Rails/UnusedRenderContent Cop checks offenses when both sending some content AND a non-content status code.

In any cases, adding status: :no_content (with content) drops content from response
So, I replaced with head :no_content ( that is: HTTP code 204)

What should we test?

Nothing.
Automatic specs should all pass.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

- in any cases, adding status: :no_content dropes content from response
- replaced by head :no_content (HTTP 204)
@sigmundpetersen sigmundpetersen mentioned this pull request Jun 18, 2024
23 tasks
@rioug rioug added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Jun 18, 2024
Copy link
Collaborator

@rioug rioug 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 am wondering if we need to flag this as API changes as well ?

@mkllnk
Copy link
Member

mkllnk commented Jun 19, 2024

I am wondering if we need to flag this as API changes as well ?

It looks like there's no change to the API:

In any cases, adding status: :no_content (with content) drops content from response

So the content was already dropped and not sent to the client. The response should look exactly the same now.

@mkllnk mkllnk merged commit af2e7db into openfoodfoundation:master Jun 19, 2024
52 checks passed
@cyrillefr cyrillefr deleted the FixRails_UnusedRenderContentIssues branch June 22, 2024 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants