Skip to content

refactor(frontend): preserve config source in GuiConfigService instead of one flat map#5673

Open
Ma77Ball wants to merge 20 commits into
apache:mainfrom
Ma77Ball:isolate-config-sources-5669
Open

refactor(frontend): preserve config source in GuiConfigService instead of one flat map#5673
Ma77Ball wants to merge 20 commits into
apache:mainfrom
Ma77Ball:isolate-config-sources-5669

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Stacked on #5545 (adds the /config/amber endpoint and the amber config source this PR namespaces). Base diff includes #5545 until it merges; review the last commit only, or after #5545 lands.

What changes were proposed in this PR?

  • Changed GuiConfigService to store each endpoint's payload under its own key in a configBySource map (preLogin, gui, amber, userSystem) instead of spreading them all into one flat object, so the origin of every config value is preserved (addresses the review comment on refactor(config): unify default-data-transfer-batch-size into one config key #5545).
  • Derived the existing flat env getter from configBySource on read, keeping its shape identical so the ~50 existing guiConfigService.env.<flag> call sites are untouched.
  • Memoized env so it returns a stable object reference (rebuilt only when a source loads). This preserves the two-way [(ngModel)] write-through at menu.component.html, which only persists when the same object identity is held across change-detection reads.
  • Added a source(name) accessor that returns one endpoint's payload in isolation.
  • Added unit tests for: source isolation (each source retrievable alone, no key bleed across sources, empty object for an unloaded source), env reference stability (stable across reads, rebuilt after a new source loads, in-memory write discarded on reload), and merge precedence (later source wins on a shared key).

Any related issues, documentation, discussions?

Closes: #5669

How was this PR tested?

  • Run cd frontend && npx ng test --include="src/app/common/service/gui-config.service.spec.ts" and expect 15 passed (the 8 existing merge/orchestration tests plus 7 new tests covering source isolation, env reference stability, and merge precedence).
  • Confirm the merged view is unchanged: service.env.defaultDataTransferBatchSize still resolves after post-login load, while service.source("amber") returns only the amber payload and service.source("gui") does not contain defaultDataTransferBatchSize.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.8 in compliance with ASF

@github-actions github-actions Bot added frontend Changes related to the frontend GUI common platform Non-amber Scala service paths labels Jun 13, 2026
@codecov-commenter

codecov-commenter commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.95%. Comparing base (dfa0434) to head (036179f).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5673      +/-   ##
============================================
+ Coverage     52.91%   52.95%   +0.03%     
  Complexity     2626     2626              
============================================
  Files          1090     1090              
  Lines         42188    42243      +55     
  Branches       4531     4533       +2     
============================================
+ Hits          22324    22368      +44     
- Misses        18555    18563       +8     
- Partials       1309     1312       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 70.91% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from 7ae9b35
amber 53.00% <ø> (-0.02%) ⬇️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 57.35% <100.00%> (+0.63%) ⬆️
file-service 57.06% <ø> (ø)
frontend 47.93% <100.00%> (-0.01%) ⬇️
pyamber 90.78% <ø> (+0.05%) ⬆️ Carriedforward from 7ae9b35
python 90.73% <ø> (ø) Carriedforward from 7ae9b35
workflow-compiling-service 58.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 3 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main dfa0434 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 433 0.264 22,946/28,301/28,301 us 🔴 +12.3% / 🟢 -19.1%
bs=100 sw=10 sl=64 938 0.573 105,454/133,418/133,418 us ⚪ within ±5% / 🟢 -6.1%
bs=1000 sw=10 sl=64 1,128 0.688 894,484/947,677/947,677 us ⚪ within ±5% / 🟢 +8.4%
Baseline details

Latest main dfa0434 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 433 tuples/sec 461 tuples/sec 410.82 tuples/sec -6.1% +5.4%
bs=10 sw=10 sl=64 MB/s 0.264 MB/s 0.281 MB/s 0.251 MB/s -6.0% +5.3%
bs=10 sw=10 sl=64 p50 22,946 us 20,430 us 23,785 us +12.3% -3.5%
bs=10 sw=10 sl=64 p95 28,301 us 31,414 us 34,980 us -9.9% -19.1%
bs=10 sw=10 sl=64 p99 28,301 us 31,414 us 34,980 us -9.9% -19.1%
bs=100 sw=10 sl=64 throughput 938 tuples/sec 954 tuples/sec 891.94 tuples/sec -1.7% +5.2%
bs=100 sw=10 sl=64 MB/s 0.573 MB/s 0.582 MB/s 0.544 MB/s -1.5% +5.3%
bs=100 sw=10 sl=64 p50 105,454 us 104,196 us 112,277 us +1.2% -6.1%
bs=100 sw=10 sl=64 p95 133,418 us 134,840 us 139,802 us -1.1% -4.6%
bs=100 sw=10 sl=64 p99 133,418 us 134,840 us 139,802 us -1.1% -4.6%
bs=1000 sw=10 sl=64 throughput 1,128 tuples/sec 1,099 tuples/sec 1,041 tuples/sec +2.6% +8.4%
bs=1000 sw=10 sl=64 MB/s 0.688 MB/s 0.671 MB/s 0.635 MB/s +2.5% +8.3%
bs=1000 sw=10 sl=64 p50 894,484 us 917,226 us 972,714 us -2.5% -8.0%
bs=1000 sw=10 sl=64 p95 947,677 us 955,629 us 1,023,057 us -0.8% -7.4%
bs=1000 sw=10 sl=64 p99 947,677 us 955,629 us 1,023,057 us -0.8% -7.4%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,461.69,200,128000,433,0.264,22946.39,28301.25,28301.25
1,100,10,64,20,2131.91,2000,1280000,938,0.573,105453.55,133418.07,133418.07
2,1000,10,64,20,17730.65,20000,12800000,1128,0.688,894483.97,947677.09,947677.09

Ma77Ball added 2 commits June 13, 2026 16:44
  a stable reference

  The env getter rebuilt a fresh object on every read,
  breaking the
  two-way [(ngModel)] binding for
  workflowEmailNotificationEnabled
  (menu.component.html) since writes landed on a
  discarded object.
  Memoize the merged view and invalidate it on source
  load. Add
  regression tests for reference stability and
  write-through.
@Ma77Ball Ma77Ball marked this pull request as ready for review June 14, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common frontend Changes related to the frontend GUI platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve config source isolation in GuiConfigService instead of merging all endpoints into one flat map

2 participants