Skip to content

Conversation

@jgraham
Copy link
Member

@jgraham jgraham commented Dec 19, 2025

Checklist for reviewer:

  • Commits should reference a bug or github issue, if relevant (if a bug is
    referenced, the pull request should include the bug number in the title)
  • Scan the PR and verify that no changes (particularly to
    .circleci/config.yml) will cause environment variables (particularly
    credentials) to be exposed in test logs
  • Ensure the container image will be using permissions granted to
    telemetry-airflow
    responsibly.

Note for deployments: In order to push images built by this PR, the user who merges the PR
must be in the telemetry Github team.
This is because deploys depend on the
data-eng-airflow-gcr CircleCI context.
See DENG-8850 for additional discussion.

@jgraham jgraham requested a review from ksy36 December 19, 2025 11:08
@jgraham jgraham changed the title Rescore New workflow for updating schema when rescoring metrics Dec 19, 2025
@jgraham
Copy link
Member Author

jgraham commented Dec 19, 2025

This currently depends on a lot of smaller PRs that are open; once they are merged I can rebase this one and just have the features it adds.

@jgraham jgraham marked this pull request as ready for review January 7, 2026 16:27
@jgraham jgraham requested a review from a team as a code owner January 7, 2026 16:27
@scholtzan
Copy link
Contributor

fyi We migrated docker-etl to GHA, so you should now be able to merge the PRs yourself without the deploy steps failing.

@scholtzan
Copy link
Contributor

Also since it seems related, there is a metric-hub with metric definitions, which look similarish to some definitions in this PR: https://github.com/mozilla/metric-hub

@jgraham jgraham closed this Jan 9, 2026
@jgraham jgraham reopened this Jan 9, 2026
Rather than being part of the ETL.

These are still rather broken after the schema data changes, but this
is the first step in refactoring them to work in the new world.
Now that we have the schemas scored in-tree we don't want to directly
deploy tables for prospective rescores. Instead the approach we take
is to make the metric-rescore command do two things:

* Create templates for the post-rescore scored_site_reports, any
routines that need to be updated as part of the rescore, and a
template for a delta view that selects bugs that are changed by the
rescore.

* Replace: update the scored site reports templates with the new
version from a rescore, and move the current version to an archive
dataset, and similarly for routines modified by the rescore.

The idea is that one first deploys the new scored site reports, to
allow the change to be audited, and then deploys the change that
replaces the original scored site reports with the new one once the
rescore is ready to go.
This means that the `webcompat-site-rank-update` command will
automatically generate the right schema templates rather than actually
trying ot update prod.
If we deploy a rescore we want to first record the delta between the
old scores and the new scores. This is a bit tricky because we want
the update to the templates to go through the PR process and be
deployed by the ETL, but we want to record the rescores before we
actually update the schema.

To solve this we add an extra lifecycle point in the schema update for
tasks that run before deploying the schema. Here we call into
metric_rescore to check for a metric rescore that a) isn't marked as
staging and b) isn't deployed. If that's found we assume we're about
to deploy it and record the score updates resulting from that change
to the metric.

This isn't a perfect system since the changes aren't at all
atomic (e.g. the rescore could succeed, but the deploy fail), but it's
probably good enough for something we do relatively rarely.
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.

4 participants