Skip to content

[WIP] Refactor: right align metrics email#1943

Draft
MarceloRobert wants to merge 1 commit into
kernelci:mainfrom
MarceloRobert:refactor/right-align-metrics
Draft

[WIP] Refactor: right align metrics email#1943
MarceloRobert wants to merge 1 commit into
kernelci:mainfrom
MarceloRobert:refactor/right-align-metrics

Conversation

@MarceloRobert

Copy link
Copy Markdown
Contributor

Readjusts the email formatting so that the larger number sections have a right-aligned text.

Changes

  • Turned left-aligned text in metrics email's sections "COVERAGE" and "TEST LAB ACTIVITY" into right-aligned text;
  • Adjusted spacing for some columns;
  • Changed double space before change percentage into a single space (that's 123 (+99%) into 123 (+99%));
  • Removed percentage sign if the metric diff is 0. This was done because many labs don't have tests, so the (+0%) can clutter the change column.
  • WIP - use dynamic spacing in order to avoid large empty spaces on all-small numbers and also avoid lack of space for larger-than-usual numbers

How to test

  • Have data in the database, I used /backend/tests_submissions/submissions.zip for testing
  • Run poetry run python3 manage.py notifications --action metrics_summary and compare with the older version

Visual Reference

Example of new format:

KernelCI Metrics Summary
========================
Period: 2026-06-11 12:42 UTC to 2026-06-18 12:42 UTC


  COVERAGE
  --------
                          This week    Last week              Change
                          ─────────    ─────────           ─────────
  Trees monitored                 4            0                  +4
  Checkouts                      32            0                 +32
  Builds                        103            0                +103
  Tests                      15,720            0             +15,720

  BUILD REGRESSIONS
  -----------------
  A "regression" is defined as a reported problem affecting 0 or multiple builds.

  Origin    Regressions       Affected           Affected builds by top issues
            (known + new)     Builds (total)     #1      #2      #3
  ─────────────────────────────────────────────────────────────────────────
  maestro   0   + 1   = 1     1                  1       
  ─────────────────────────────────────────────────────────────────────────
  Total     0   + 1   = 1     1


  TOP REGRESSIONS PER ORIGIN
  --------------------------
  maestro:
    #1 (1 occurrences) -  in vmlinux (Makefile:1220) [logspec:kbuild,kbuild.other]
      Dashboard: https://d.kernelci.org/issue/maestro:5dd754a8374e1b44291f37f6a3510603dcbc6348?iv=1
  

  TEST LABS ACTIVITY
  ------------------
  13 labs reported results this week (13 more than last week).

  Labs marked with an asterisk (*) are new.

  Lab                     Covered builds    Boots        Tests      Change (tests)
  ────────────────────────────────────────────────────────────────────────────────
  lava-baylibre *                      1        1            0                   0
  lava-broonie *                      41        8        3,467              +3,467
  lava-cip *                           1        1            0                   0
  lava-clabbe *                        3        3            0                   0
  lava-collabora *                    82       29        1,805              +1,805
  lava-foundriesio *                   2        2            0                   0
  lava-kci-qualcomm *                  1        0            1                  +1
  lava-pengutronix *                   3        3            0                   0
  linaro *                           174      229       10,119             +10,119
  maestro *                            1        0            2                  +2
  microsoft *                          1        0            3                  +3
  opentest-ti *                        2        2            0                   0
  redhat *                             1        0           45                 +45
  ────────────────────────────────────────────────────────────────────────────────
  Total                              313      278       15,442             +15,442

--
This is an experimental report format. Please send feedback in!
Talk to us at kernelci@lists.linux.dev

Made with love by the KernelCI team - https://kernelci.org

Closes #1938

Readjusts the email formatting so that the larger number sections have a right-aligned text

Closes kernelci#1938
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.

Right-align number columns on plaintext reports

1 participant