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

Publish enterprise website with https:// #12410

Merged
merged 3 commits into from Apr 29, 2024

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Apr 23, 2024

What? Why?

Related to:

We strip all http:// and https:// from enterprise URLs and add http:// in the frontend. While we should fix the data model, I added a quick fix to the DFC API to publish the website URL with https:// so that it can be used in links straight away.

What should we test?

  • Nothing, specs are enough.

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

@mkllnk mkllnk self-assigned this Apr 23, 2024
@mkllnk mkllnk added the api changes These pull requests change the API and can break integrations label Apr 23, 2024
@mkllnk mkllnk marked this pull request as ready for review April 23, 2024 04:33
Comment on lines 24 to 27
websites: [enterprise.website].compact,
).tap do |e|
# The model strips the protocol and we need to add it:
e.websites = e.websites.map { |url| "https://#{url}" }
Copy link
Member

Choose a reason for hiding this comment

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

Could this be done above on line 24?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but I would need to add a new method because of the conditionals. The website may be blank and we can't just add "https://" to it in that case. Or do you mean adding the map on that line? Yes, it would probably fit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if the website could be an empty string, but it might be worth using compact_blank to cater for that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I'll update that.

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

👍

@dacook
Copy link
Member

dacook commented Apr 29, 2024

Single review is sufficient

@dacook dacook merged commit 1dc5a1a into openfoodfoundation:master Apr 29, 2024
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api changes These pull requests change the API and can break integrations
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants