Skip to content

feat: scope config property updates by creator#2171

Closed
adityathebe wants to merge 2 commits into
mainfrom
feat/properties-owner
Closed

feat: scope config property updates by creator#2171
adityathebe wants to merge 2 commits into
mainfrom
feat/properties-owner

Conversation

@adityathebe
Copy link
Copy Markdown
Member

@adityathebe adityathebe commented Apr 28, 2026

Config item property writes previously replaced the entire JSON array, which could clobber manually added properties or properties owned by other scrapers.

Route scraper property writes through duty's creator-scoped update helper so each scraper replaces only its own property slice. Empty observed properties now remove stale scraper-owned properties while preserving user-created, other-scraper, and legacy unowned entries.

This draft depends on the duty creator-scoped property helper being merged and released first.

resolves: flanksource/duty#1933

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@adityathebe has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 17 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4d8c7f1f-c39e-455b-96f7-4462a3c047d4

📥 Commits

Reviewing files that changed from the base of the PR and between 71d2456 and 82d8b7e.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • bench/config_items_save_results_bench_test.go
  • db/config.go
  • db/models/config_item.go
  • db/update.go
  • go.mod
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/properties-owner
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/properties-owner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adityathebe adityathebe force-pushed the feat/properties-owner branch from 2d5d697 to 02a31be Compare April 28, 2026 15:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Benchstat

Base: 71d2456e82ac5b60a79044c089e46ff115c3c7bb
Head: 82d8b7e39c34312be56f450f53fb90d8e16686f0

⚠️ 8 regression(s) detected (threshold: >5%)

Benchmark Base Head Change p-value
BenchSaveResultsUpdateUnchanged/N=1000-4 32.29Mi 1275.15Mi +3849.56% 🔴 0.002
BenchSaveResultsUpdateUnchanged/N=1000-4 3.298 8.024 +143.31% 🔴 0.002
BenchSaveResultsSeed/N=1000-4 4.122 7.386 +79.21% 🔴 0.002
BenchSaveResultsUpdateChanged/N=1000-4 797.3Mi 1317.2Mi +65.22% 🔴 0.002
BenchSaveResultsUpdateUnchanged/N=1000-4 404.6k 632.3k +56.26% 🔴 0.002
BenchSaveResultsUpdateChanged/N=1000-4 7.314 11.241 +53.69% 🔴 0.002
BenchSaveResultsSeed/N=1000-4 446.4k 661.8k +48.23% 🔴 0.002
BenchSaveResultsUpdateChanged/N=1000-4 1.002M 1.155M +15.31% 🔴 0.002
✅ 1 improvement(s)
Benchmark Base Head Change p-value
BenchSaveResultsSeed/N=1000-4 1.277Gi 1.248Gi -2.33% 0.002

Failed: 8 benchmark(s) regressed by more than 5%:
BenchSaveResultsUpdateUnchanged/N=1000-4: 32.29Mi -> 1275.15Mi (+3849.56%)
BenchSaveResultsUpdateUnchanged/N=1000-4: 3.298 -> 8.024 (+143.31%)
BenchSaveResultsSeed/N=1000-4: 4.122 -> 7.386 (+79.21%)
BenchSaveResultsUpdateChanged/N=1000-4: 797.3Mi -> 1317.2Mi (+65.22%)
BenchSaveResultsUpdateUnchanged/N=1000-4: 404.6k -> 632.3k (+56.26%)
BenchSaveResultsUpdateChanged/N=1000-4: 7.314 -> 11.241 (+53.69%)
BenchSaveResultsSeed/N=1000-4: 446.4k -> 661.8k (+48.23%)
BenchSaveResultsUpdateChanged/N=1000-4: 1.002M -> 1.155M (+15.31%)

Full benchstat output
goos: linux
goarch: amd64
pkg: github.com/flanksource/config-db/bench
cpu: AMD EPYC 7763 64-Core Processor                
                                         │ bench-base.txt │            bench-head.txt             │
                                         │     sec/op     │    sec/op      vs base                │
BenchSaveResultsSeed/N=1000-4                 4.122 ± 10%    7.386 ±   2%   +79.21% (p=0.002 n=6)
BenchSaveResultsUpdateUnchanged/N=1000-4      3.298 ±  1%    8.024 ± 520%  +143.31% (p=0.002 n=6)
BenchSaveResultsUpdateChanged/N=1000-4        7.314 ±  3%   11.241 ±   1%   +53.69% (p=0.002 n=6)
geomean                                       4.633          8.734          +88.53%

                                         │ bench-base.txt │           bench-head.txt           │
                                         │      MB/s      │    MB/s     vs base                │
BenchSaveResultsSeed/N=1000-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
BenchSaveResultsUpdateUnchanged/N=1000-4     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
BenchSaveResultsUpdateChanged/N=1000-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                 ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                         │ bench-base.txt │             bench-head.txt              │
                                         │      B/op      │      B/op       vs base                 │
BenchSaveResultsSeed/N=1000-4                1.277Gi ± 0%     1.248Gi ± 0%     -2.33% (p=0.002 n=6)
BenchSaveResultsUpdateUnchanged/N=1000-4     32.29Mi ± 0%   1275.15Mi ± 0%  +3849.56% (p=0.002 n=6)
BenchSaveResultsUpdateChanged/N=1000-4       797.3Mi ± 1%    1317.2Mi ± 1%    +65.22% (p=0.002 n=6)
geomean                                      322.9Mi          1.260Gi        +299.44%

                                         │ bench-base.txt │           bench-head.txt            │
                                         │   allocs/op    │  allocs/op    vs base               │
BenchSaveResultsSeed/N=1000-4                446.4k ±  0%   661.8k ±  0%  +48.23% (p=0.002 n=6)
BenchSaveResultsUpdateUnchanged/N=1000-4     404.6k ±  0%   632.3k ±  0%  +56.26% (p=0.002 n=6)
BenchSaveResultsUpdateChanged/N=1000-4       1.002M ± 13%   1.155M ± 11%  +15.31% (p=0.002 n=6)
geomean                                      565.6k         784.8k        +38.75%

@adityathebe adityathebe force-pushed the feat/properties-owner branch 4 times, most recently from 58273b9 to a549deb Compare May 5, 2026 08:13
@adityathebe adityathebe marked this pull request as ready for review May 5, 2026 08:14
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 5, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​flanksource/​duty@​v1.0.1301 ⏵ v1.0.1302-0.20260505080647-4f6025d9782475 +1100100100100

View full report

Config item property writes previously replaced the whole JSON array, so scraper updates could clobber manual properties or properties from other scrapers.

Route scraper property writes through duty's creator-scoped update helper. Scraper updates now replace only their own property slice, preserve other creators and legacy properties, and send empty observed properties to remove stale scraper-owned entries.
@adityathebe adityathebe force-pushed the feat/properties-owner branch from a549deb to 82d8b7e Compare May 5, 2026 08:57
@adityathebe adityathebe linked an issue May 5, 2026 that may be closed by this pull request
@adityathebe
Copy link
Copy Markdown
Member Author

Abandoning this approach due to high performance hit.
Follow up here: flanksource/duty#1955

@adityathebe adityathebe closed this May 5, 2026
@adityathebe adityathebe deleted the feat/properties-owner branch May 5, 2026 17: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.

Config Insertion Benchmark Config_item_properties

1 participant