Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Conversation

@safwanrahman
Copy link
Contributor

It seems like the most efficiant fix with current configuration.
@jwhitlock small PR, r?

jinja2/base.html Outdated
{% elif settings.DOMAIN == 'localhost' %}
{% set favicon_suffix = '-local' %}
{% else %}
{% set favicon_suffix = '' %}
Copy link
Contributor

Choose a reason for hiding this comment

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

The specific cases are production and staging, the fallback should be the -local - see the previous version:

https://github.com/mozilla/kuma/blob/14521cb18ad486575b8aeb1459ecb03a3ff6e9dc/jinja2/base.html#L64-L71

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jwhitlock In current configuration, there are nothing specific for production. But there are specific case for dev and stage. So I thought to have specific case for dev and stage and fallback to production

Copy link
Contributor

Choose a reason for hiding this comment

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

The point of the different favicon.ico is to have one that only appears in production, one that only appears in staging, and everywhere else gets the dev icon. It's not OK for the production icon to be the default.

settings.PRODUCTION_DOMAIN should probably be added, and PRODUCTION_URL should be built from that rather than PROTOCOL and DOMAIN. Research is needed to see why it was done this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed! 👍

@codecov-io
Copy link

Codecov Report

Merging #4650 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4650   +/-   ##
=======================================
  Coverage   95.32%   95.32%           
=======================================
  Files         260      260           
  Lines       23534    23534           
  Branches     1688     1688           
=======================================
  Hits        22434    22434           
  Misses        888      888           
  Partials      212      212

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 27b77dc...7aca60e. Read the comment docs.

@safwanrahman
Copy link
Contributor Author

safwanrahman commented Feb 6, 2018

@jwhitlock I have fixed the thing. It should be exclusive to staging and production, and inclusive for all other instance.
The PRODUCTION_URL was used for serving the local media in local environment, but I think the naming convention should not be PRODUCTION_URL, I have changed the use case with SITE_URL as both are same, and added PRODCUTION_DOMAIN
r?

Copy link
Contributor

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

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

I checked locally, and I got the red development favicon. Looking at the code, I believe this will pick the right icon in staging and production.

There are favicons above this line in jinja2/base.html. We don't have alternate versions of these, so we don't want to customize for different domains for now.

I searched the code, and PRODUCTION_URL is unused outside of the settings, so 👍 to the change to PRODUCTION_DOMAIN.

Thanks @safwanrahman!

@jwhitlock jwhitlock merged commit 36f1266 into mdn:master Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants