Skip to content

Insights dashboard: move KEY_PROJECT_SLUGS to env, remove dashes, reformat dashboard css - #4338

Open
functionzz wants to merge 3 commits into
mozilla:mainfrom
functionzz:dashboard_changes
Open

Insights dashboard: move KEY_PROJECT_SLUGS to env, remove dashes, reformat dashboard css#4338
functionzz wants to merge 3 commits into
mozilla:mainfrom
functionzz:dashboard_changes

Conversation

@functionzz

@functionzz functionzz commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

This PR contains small requested changes to Insights dashboard and CHS snapshot collection code.

These changes include:

  • moving KEY_PROJECT_SLUGS to base.py as an env
  • removing dashes representing 0 delta in Insights dashboard
  • changing css for better design of Insights dashboard
  • renaming tooltip Enabled Projects to Enabled Key Projects

@functionzz
functionzz requested a review from mathjazz July 25, 2026 17:16
@mathjazz

Copy link
Copy Markdown
Collaborator

This PR contains small requested changes to Insights dashboard and CHS snapshot collection code.

Could you please describe the intended changes here or file an issue?

Comment thread pontoon/insights/templates/insights/widgets/community_health_table.html Outdated
…able.html

Co-authored-by: Matjaž Horvat <matjaz.horvat@gmail.com>
@functionzz
functionzz requested a review from mathjazz July 27, 2026 15:01
@mathjazz mathjazz changed the title Insights dashboard: move KEY_FORMAT_SLUGS to env, remove dashes, reformat dashboard css Insights dashboard: move KEY_PROJECT_SLUGS to env, remove dashes, reformat dashboard css Jul 27, 2026
Comment thread pontoon/settings/base.py Outdated
"firefox,"
"mozilla-accounts,"
"mozilla-vpn-client",
).split(",")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • That's not very readable - the order of , and " is easy to get wrong.
  • The order of project slugs also appears to be pretty random.
  • It also doesn't prevent whitespace and empty entries from causing subtle bugs. KEY_PROJECT_SLUGS="firefox, firefox-for-ios" yields firefox-for-ios, which matches no project and silently under-counts.
  • Setting KEY_PROJECT_SLUGS="" gives [""] rather than [], so len(KEY_PROJECT_SLUGS) is 1 — which feeds both the base_threshold and the divisor in chs.py.

Something like this would be a big improvement:

DEFAULT_KEY_PROJECT_SLUGS = (
    "firefox",
    "firefox-for-android",
    "firefox-for-ios",
    "firefox-relay-website",
    "mozilla-accounts",
    "mozilla-monitor-website",
    "mozilla-vpn-client",
)

KEY_PROJECT_SLUGS = [
    slug.strip()
    for slug in os.environ.get(
        "KEY_PROJECT_SLUGS",
        ",".join(DEFAULT_KEY_PROJECT_SLUGS),
    ).split(",")
    if slug.strip()
]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah that makes alot of sense

Comment thread pontoon/settings/base.py
"mozilla-accounts",
"mozilla-monitor-website",
"mozilla-vpn-client",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, that looks good now, except... Should we avoid shipping Mozilla-specific project slugs in the codebase? Pontoon runs outside Mozilla too, and those instances would silently compute a CHS against seven slugs that don't exist rather than a visibly unconfigured one.

I suggest the default is an empty list or all priority=HIGHEST projects instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

right...probably an empty list makes sense. But does that mean the project slugs need to be manually inputted by the superuser on Mozilla's Pontoon instance?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Correct. The alternative would be to add a Project.is_key_project field and set it in the admin.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I kind of like the idea of defining CHS projects (wouldn't call them key projects though) as part of the project object.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How would you call them (and the corresponding DB field)?

@flodolo flodolo Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I thought I left a suggestion, but that was just in my head. is_chs_project should work and avoid confusion?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good.

I wonder where does the confusion come from, though. The colum header also reads "Enabled Key Projects".

You mean it might confuse 3rd party users? We could also use help_text for that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Key projects out of context sounds too opinionated to me, or at least open to interpretation. The header is literally in the Community Health Score section, so there is context and it's fine.

These are just projects that we chose to use for CHS, they might not even be key (I wouldn't call Monitor/Relay key these days 😓).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK. Please comment above if we should also change the "Enabled Key Projects" to something else then, e.g. "Enabled Tracked Projects" or something.

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.

3 participants