Devtoberfest Signups report: readable week axis, total KPI, region breakdown (#2047) - #2050
Merged
Merged
Conversation
…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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2047.
The Devtoberfest Signups Analytical List Page (
/admin-ui/#/devtoberfestSignups) opened chart-first with the chart X-axis bound to the internal integerweekIndex— meaningless to users. This addresses all three asks in the issue.What changed
weekMonday : Datecolumn so the chart groups on it and the axis shows the week's Monday date (e.g. Sep 7, 2026) instead ofweekIndex. No single date-add expression is portable across HANA and SQLite, soweekMondayis supplied per dialect via the CAP-documented pattern:db/sqlite/native.cds(strftime) +db/hana/native.cds(ADD_DAYS), wired throughcds.requires.db.[profile].model. The analytics view is split into a JOIN-bearing facts view + a JOIN-free public projection because the compiler refuses toextenda view containing a JOIN.@UI.KPIheader card (SUM(signups), unfiltered grand total). The AnalyticalTable also renders its own grand-total row for the measure.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/cumulativeSignupsfrom the realweekMondaywhen present, falling back toweekIndex— so existingweekIndex-grouped reads keep working. TheweekLabel'YYYY-Www' string stays a read-time field (no portable ISO-week SQL function).Verification
cds build --production: HANA hdbview usesADD_DAYS; the precompiledgen/srv/csn.jsonbakes the HANAweekMondaycalc (addeddb/hanato the nodejs build task's model list).$applygroupby(weekMonday)returns readable Monday dates + correct enrichment.weekMondaycolumn (unit + hybrid-HANA) and theweekMonday-keyed enrichment path.Notes / reviewer attention
requires.db.modeldefeats cds's compiled-model fast path, so a coldcds.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 intest/unit/rebuild-trigger.test.js, fixed there by mockingresolveTenantSettingsso the dispatch unit does no real DB work (proper isolation).weekMondayHANA column materialization is a schema change — deploy is a full build (cds build --production+ MTA), not--skip-build.