Skip to content

feat(backend): Simplify location ownership#172

Merged
devsjc merged 2 commits into
mainfrom
devsjc/org-groups
Jun 11, 2026
Merged

feat(backend): Simplify location ownership#172
devsjc merged 2 commits into
mainfrom
devsjc/org-groups

Conversation

@devsjc

@devsjc devsjc commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Adds a much simpler model for handling location ownership. Removes the iam schema entirely and replaces it with an entities table in the location schema that stores the owning entities.

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-06-11T15:12:59Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      61	  18545514 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     264	   4367151 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     894	   1298880 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      87	  13186921 ns/op
BenchmarkPostgresClient/small/StreamForecastData-4              	      12	  90244235 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	73.495s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]
Benchmark vs base branch
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
                                                   │ bench-main.txt │     bench-devsjc-org-groups.txt      │
                                                   │     sec/op     │    sec/op     vs base                │
PostgresClient/small/GetForecastAsTimeseries-4         15.76m ± ∞ ¹   18.55m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetForecastAtTimestamp-4          4.155m ± ∞ ¹   4.367m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetObservationsAsTimeseries-4     1.249m ± ∞ ¹   1.299m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/CreateForecast-4                  12.73m ± ∞ ¹   13.19m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/StreamForecastData-4              83.44m ± ∞ ¹   90.24m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                9.723m         10.46m        +7.58%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

@devsjc devsjc merged commit c31dd76 into main Jun 11, 2026
4 checks passed
@devsjc devsjc deleted the devsjc/org-groups branch June 11, 2026 15:14
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