Skip to content

Devtoberfest Signups report: readable week axis, total KPI, region breakdown (#2047) - #2050

Merged
jung-thomas merged 1 commit into
DEVfrom
feat/2047-devtoberfest-signups-report
Aug 27, 2026
Merged

Devtoberfest Signups report: readable week axis, total KPI, region breakdown (#2047)#2050
jung-thomas merged 1 commit into
DEVfrom
feat/2047-devtoberfest-signups-report

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Closes #2047.

The Devtoberfest Signups Analytical List Page (/admin-ui/#/devtoberfestSignups) opened chart-first with the chart X-axis bound to the internal integer weekIndex — meaningless to users. This addresses all three asks in the issue.

What changed

  • Readable week on the chart axis. Added a real, groupable weekMonday : Date column so the chart groups on it and the axis shows the week's Monday date (e.g. Sep 7, 2026) instead of weekIndex. No single date-add expression is portable across HANA and SQLite, so weekMonday is supplied per dialect via the CAP-documented pattern: db/sqlite/native.cds (strftime) + db/hana/native.cds (ADD_DAYS), wired through cds.requires.db.[profile].model. The analytics view is split into a JOIN-bearing facts view + a JOIN-free public projection because the compiler refuses to extend a view containing a JOIN.
  • Overall total registrations. Added a @UI.KPI header card (SUM(signups), unfiltered grand total). The AnalyticalTable also renders its own grand-total row for the measure.
  • Region breakdown. Added a By Region SelectionPresentationVariant (chart grouped by region), selectable via the page's variant management. Every groupable dimension (region / role / edition) is also reachable through the chart's built-in dimension drill-down.

The read-time enrichment now derives weekLabel/cumulativeSignups from the real weekMonday when present, falling back to weekIndex — so existing weekIndex-grouped reads keep working. The weekLabel 'YYYY-Www' string stays a read-time field (no portable ISO-week SQL function).

Verification

  • cds build --production: HANA hdbview uses ADD_DAYS; the precompiled gen/srv/csn.json bakes the HANA weekMonday calc (added db/hana to the nodejs build task's model list).
  • SQLite $apply groupby(weekMonday) returns readable Monday dates + correct enrichment.
  • Production-profile model resolution loads cleanly (no duplicate-definition/re-merge crash).
  • Unit suite: 8990 passed, 0 failed. New coverage for the real weekMonday column (unit + hybrid-HANA) and the weekMonday-keyed enrichment path.

Notes / reviewer attention

  • Dev/test cost: specifying requires.db.model defeats cds's compiled-model fast path, so a cold cds.connect.to('db') in dev/tests recompiles the model (~500ms vs ~120ms). This is dev/test-only — production uses the precompiled csn. It exposed a latent 30ms timing race in test/unit/rebuild-trigger.test.js, fixed there by mocking resolveTenantSettings so the dispatch unit does no real DB work (proper isolation).
  • Please verify on DEV after deploy (I can't render Fiori Elements here): the chart axis shows dates, the Total Registrations KPI card renders, the By Region variant works, and the srv boots cleanly against HANA. Rollback = revert this PR.
  • The weekMonday HANA column materialization is a schema change — deploy is a full build (cds build --production + MTA), not --skip-build.

…vtoberfest Signups (#2047)

The Devtoberfest Signups Analytical List Page opened chart-first with the
X-axis bound to the internal integer weekIndex — meaningless to users. This
makes the report readable and adds the requested breakdowns:

- Readable week axis: add a real, GROUPABLE weekMonday:Date column so the
  chart groups on it and shows the week's Monday date instead of weekIndex.
  No portable date-add exists across HANA/SQLite, so weekMonday is supplied
  per dialect (db/sqlite/native.cds via strftime, db/hana/native.cds via
  ADD_DAYS) — the CAP-documented per-DB model pattern. The analytics view is
  split into a JOIN-bearing facts view + a JOIN-free public projection because
  the compiler refuses to `extend` a view containing a JOIN.
- Overall total: @UI.KPI #totalSignups header card (SUM(signups), unfiltered);
  the AnalyticalTable also renders its grand-total row.
- Region breakdown: a "By Region" SelectionPresentationVariant (chart grouped
  by region); every GroupableProperty (region/role/edition) is also reachable
  via the chart's built-in dimension drill-down.

enrich now derives weekLabel/cumulative from the real weekMonday when present,
falling back to weekIndex — keeping weekIndex-grouped reads working.

Wiring notes:
- package.json requires.db.[development].model=db/sqlite, [hybrid]/[production]=db/hana.
- .cdsrc nodejs build task also lists db/hana so the precompiled gen/srv/csn.json
  bakes the HANA weekMonday (verified: gen csn carries the ADD_DAYS calc).
- Specifying requires.db.model defeats cds's compiled-model fast path, so a cold
  cds.connect.to('db') in dev/tests recompiles the model (~500ms). This is
  dev/test-only (prod uses the precompiled csn). It exposed a latent 30ms race in
  test/unit/rebuild-trigger.test.js, fixed there by mocking resolveTenantSettings
  so the dispatch unit does no real DB work.

Verified: cds build --production (HANA hdbview uses ADD_DAYS; runtime csn has
weekMonday), sqlite $apply groupby(weekMonday) returns readable dates, prod-profile
model resolution loads cleanly, unit suite 8990 passed / 0 failed.
@jung-thomas
jung-thomas merged commit 4dc6b87 into DEV Aug 27, 2026
8 checks passed
@jung-thomas
jung-thomas deleted the feat/2047-devtoberfest-signups-report branch August 27, 2026 14:07
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.

1 participant