Skip to content

ci: use nix for lint, e2e, quickstart - #3209

Merged
turip merged 5 commits into
mainfrom
ci/generate-lint-nix
Aug 12, 2025
Merged

turip merged 5 commits into
mainfrom
ci/generate-lint-nix

Conversation

@turip

@turip turip commented Aug 11, 2025 •

Copy link
Copy Markdown
Member

Linters

make lint: runs all linters (go, api spec, openapi.yaml, helm)
make lint-api-spec: runs typespec linters
make lint-openapi: runs openapi.yaml validators (spectral)
make lint-helm: runs helm linters

Generation

make gen-api generates the API + javascript client
make update-openapi generates the API, but now javascript client generation happens
make generate-all generates all artifacts
CI validates that generators are ran on the PR

E2E + QuickStart

Both docker-compose setups rely on the base docker compose file.
The base docker-compose file now reusable.
There's no port conflict between dev, quickstart and e2e docker compose environments.

CI relies on the artifacts to be published by the CI to execute e2e and quickstart tests.

make etoe is the equivalent of dagger call etoe
e2e: skip testcases that are sleeping for minutes. Those should be implemented as unit tests and rely on time-travel. (discussed with @GAlexIHU )

NIX

Add spectral, corepack as dependencies.

Other fixes

Remove dagger code that was replaced by nix based equivaltents.
Add missing binaries to dockerfile
TODO: helm charts should be also updated
make ci executes generators and all the tests/e2e/linters etc. (it's pretty slow, but if you want to make sure you can use this target)
Regenerate JS library as we seem to have forgotten to regenerate that.

Summary by CodeRabbit

  • New Features

    • Added billing worker and notification service to the container image.
    • Introduced a reusable Docker Compose base stack for local dev and tests.
    • Published Depot container image URL as a workflow output.
  • Tests

    • Switched quickstart and E2E to Makefile- and Compose-based runs with health checks and logs.
    • Added slow-test gating to stabilize timing-sensitive tests.
  • Documentation

    • Updated quickstart examples to new ports.
  • Chores

    • Migrated CI, linting, and code generation to Nix/Make workflows.
    • Standardized local ports to 30000–49000 ranges and added ignores for local overrides/logs.

@coderabbitai

coderabbitai Bot commented Aug 11, 2025 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Removes Dagger-based dev/lint/build/test code and replaces CI/test orchestration with Makefiles, Nix, and Docker Compose. Adds base Compose stack and e2e/quickstart Compose setups, revises workflows, updates ports, adjusts E2E tests with slow gating, and modifies Dockerfile binaries. Introduces Corepack/Spectral in flake.nix.

Changes

Cohort / File(s) Summary of changes
Dagger removal and utils refactor
.dagger/build.go, .dagger/dev.go, .dagger/generate.go, .dagger/lint.go, .dagger/test.go, .dagger/test_e2e.go, .dagger/utils.go
Removes Dagger-based cross-build, dev, generate (OpenAPI/JS/server), lint, quickstart/e2e tests; adds private helpers diff and goModuleCross.
CI workflows
.github/workflows/artifacts.yaml, .github/workflows/ci.yaml, .github/workflows/sdk-javascript-release.yaml
Exposes Depot image URL; adds generators job; migrates lint/tests to Nix/Make/Compose; updates outputs to GITHUB_OUTPUT.
Make orchestration
Makefile, api/spec/Makefile, api/client/javascript/Makefile
Replaces Dagger invocations with Make targets for OpenAPI, JS SDK, lint; adds generate-all/ci; introduces self-documenting Makefiles for spec and JS client.
Dockerfile binaries
Dockerfile
Replaces balance-worker with notification-service; adds billing-worker; packages new binaries; adds shell directive.
Compose base and consolidation
docker-compose.base.yaml, docker-compose.yaml
Introduces centralized base stack (kafka, clickhouse, redis, kafka-ui, wiretap, postgres, svix); top-level Compose extends base for services.
E2E stack and runner
e2e/docker-compose.infra.yaml, e2e/docker-compose.openmeter.yaml, e2e/docker-compose.openmeter-local.yaml, e2e/docker-compose.openmeter-latest.yaml, e2e/Makefile, e2e/.gitignore
Adds infra and OpenMeter Compose files with port remaps and healthchecks; Makefile for local e2e run; ignores logs/overrides.
E2E tests adjustments
e2e/e2e_test.go, e2e/entitlement_test.go, e2e/productcatalog_test.go, e2e/setup_test.go
Removes TestMain; adds slow-test gating via RUN_SLOW_TESTS; reduces concurrency using semaphore; adds timing logs; introduces helper shouldRunSlowTests.
Quickstart updates
quickstart/docker-compose.yaml, quickstart/docker-compose.ci.yaml, quickstart/README.md, quickstart/.gitignore, .vscode/settings.json
Remaps ports to 48xxx/40xxx; removes CI compose services; updates README endpoints; ignores override; updates test env OPENMETER_ADDRESS.
Nix environment
flake.nix
Adds Corepack 0.31.0 and Spectral wrapper; restructures shell via let-binding; adjusts PATH/env, packages, and hooks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32b19e8 and f963b2d.

📒 Files selected for processing (32)
  • .dagger/build.go (0 hunks)
  • .dagger/dev.go (0 hunks)
  • .dagger/generate.go (0 hunks)
  • .dagger/lint.go (0 hunks)
  • .dagger/test.go (0 hunks)
  • .dagger/test_e2e.go (0 hunks)
  • .dagger/utils.go (1 hunks)
  • .github/workflows/artifacts.yaml (3 hunks)
  • .github/workflows/ci.yaml (5 hunks)
  • .github/workflows/sdk-javascript-release.yaml (1 hunks)
  • .vscode/settings.json (1 hunks)
  • Dockerfile (2 hunks)
  • Makefile (3 hunks)
  • api/client/javascript/Makefile (1 hunks)
  • api/spec/Makefile (1 hunks)
  • docker-compose.base.yaml (1 hunks)
  • docker-compose.yaml (1 hunks)
  • e2e/.gitignore (1 hunks)
  • e2e/Makefile (1 hunks)
  • e2e/docker-compose.infra.yaml (1 hunks)
  • e2e/docker-compose.openmeter-latest.yaml (1 hunks)
  • e2e/docker-compose.openmeter-local.yaml (1 hunks)
  • e2e/docker-compose.openmeter.yaml (1 hunks)
  • e2e/e2e_test.go (1 hunks)
  • e2e/entitlement_test.go (2 hunks)
  • e2e/productcatalog_test.go (3 hunks)
  • e2e/setup_test.go (1 hunks)
  • flake.nix (1 hunks)
  • quickstart/.gitignore (1 hunks)
  • quickstart/README.md (5 hunks)
  • quickstart/docker-compose.ci.yaml (0 hunks)
  • quickstart/docker-compose.yaml (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/generate-lint-nix

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@turip
turip force-pushed the ci/generate-lint-nix branch 29 times, most recently from 8d1cd4d to 22e521b Compare August 12, 2025 12:00
@turip
turip force-pushed the ci/generate-lint-nix branch 2 times, most recently from 86ca710 to a5bbc36 Compare August 12, 2025 13:20
@turip turip changed the title Ci/generate lint nix ci: use nix for lint, e2e, quickstart Aug 12, 2025
@turip
turip force-pushed the ci/generate-lint-nix branch from a5bbc36 to 5e9ba8b Compare August 12, 2025 13:35
@turip
turip marked this pull request as ready for review August 12, 2025 13:36
@turip
turip requested a review from a team as a code owner August 12, 2025 13:36
@turip
turip force-pushed the ci/generate-lint-nix branch 5 times, most recently from fdf9307 to 66bcea4 Compare August 12, 2025 14:03
@turip turip added the release-note/ignore Ignore this change when generating release notes label Aug 12, 2025
@turip
turip requested a review from chrisgacsal August 12, 2025 14:31
@openmeterio openmeterio deleted a comment from coderabbitai Bot Aug 12, 2025
@openmeterio openmeterio deleted a comment from coderabbitai Bot Aug 12, 2025
@turip

turip commented Aug 12, 2025

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🔭 Outside diff range comments (2)
Makefile (2)

42-44: Fix or remove the incomplete migrate-check target.

The migrate-check target contains a dagger call that contradicts the PR's objective of removing Dagger-based tooling. This should either be updated to use a Nix-based approach or removed if no longer needed.

 .PHONY: migrate-check
-migrate-check: ## Validate migrations
-	$(call print-target)
-	dagger call migrate check
+migrate-check: ## Validate migrations
+	$(call print-target)
+	# TODO: Implement migrate check using Nix-based tooling
+	@echo "migrate-check not yet implemented with Nix tooling"
+	@false

47-50: Consider migrating generate-sqlc-testdata to Nix tooling.

This target still uses Dagger, which is inconsistent with the PR's goal of moving away from Dagger-based tooling.

Since this appears to be development tooling for generating test data, consider implementing this using Nix-based tooling or documenting it as a known exception if Dagger usage is intentional here.

🧹 Nitpick comments (9)
api/client/javascript/src/client/schemas.ts (1)

2780-2784: Confirm BillingParty.key write semantics; consider readonly for consistency.

BillingParty has readonly id?: string. If this type is primarily used as a response model, key should be readonly to match. If it is used as an input model as well, ensure the spec distinguishes read/write models so the generator can set readOnly accurately.

Suggested local change if this is response-only:

-      key?: string
+      readonly key?: string
api/client/javascript/src/zod/index.ts (3)

5517-5522: Trim supplier.key to prevent whitespace-only inputs.

Same rationale as for customer.key; trimming avoids accidental " " values.

Apply this diff:

-        key: zod.coerce
-          .string()
+        key: zod.coerce
+          .string()
+          .trim()
           .min(1)
           .max(updateInvoiceBodySupplierKeyMax)
           .optional()
           .describe('An optional unique key of the party (if available)'),

6050-6054: Trim supplier.key (createBillingProfileBody). Also clarify precedence vs supplier.id.

  • Add .trim() to avoid whitespace-only keys.
  • Consider documenting precedence (or adding a refinement) when both supplier.id and supplier.key are provided to avoid ambiguity at ingestion.

Apply this diff for trimming:

-        key: zod.coerce
-          .string()
+        key: zod.coerce
+          .string()
+          .trim()
           .min(1)
           .max(createBillingProfileBodySupplierKeyMax)
           .optional()
           .describe('An optional unique key of the party (if available)'),

Optional follow-up (outside this hunk): add a refinement on the parent supplier object to either document or enforce precedence when both id and key are present.


6408-6412: Trim supplier.key (updateBillingProfileBody).

Keeps behavior consistent with other key fields and avoids whitespace-only entries.

Apply this diff:

-        key: zod.coerce
-          .string()
+        key: zod.coerce
+          .string()
+          .trim()
           .min(1)
           .max(updateBillingProfileBodySupplierKeyMax)
           .optional()
           .describe('An optional unique key of the party (if available)'),
e2e/e2e_test.go (1)

1042-1046: Consider reducing or eliminating the hardcoded sleep durations.

The test includes multiple hardcoded sleep statements (time.Sleep(time.Minute) and time.Sleep(time.Second * 10)) which can make tests brittle and slow. Consider using polling mechanisms or event-driven approaches where possible.

Apply this approach to reduce hardcoded sleeps:

-		// we have to wait after the reset
-		time.Sleep(time.Minute)
-		time.Sleep(time.Second * 10)
+		// Poll for reset completion instead of fixed sleep
+		assert.EventuallyWithT(t, func(t *assert.CollectT) {
+			// Check for reset completion by verifying entitlement state
+			// Implementation depends on available reset status APIs
+		}, 2*time.Minute, 5*time.Second)
e2e/Makefile (2)

9-13: Consider adding a timeout to the curl health check.

The health check loop could potentially run indefinitely if the service fails to start properly. While --retry-max-time 120 provides some protection, consider adding an explicit timeout using --max-time for individual requests.

-	curl --retry 10 --retry-max-time 120 --retry-all-errors http://localhost:30000/healthz
+	curl --retry 10 --retry-max-time 120 --max-time 10 --retry-all-errors http://localhost:30000/healthz

34-37: Address static analysis warnings about missing standard phony targets.

The static analysis tool flagged missing standard Makefile targets. While not critical for this specialized e2e Makefile, consider adding empty implementations to satisfy tooling expectations.

+.PHONY: all clean test
+all: ## Default target (no-op for e2e)
+	@echo "No default target for e2e Makefile. Use 'make help' to see available targets."
+
+clean: ## Clean up local environment
+	$(call print-target)
+	$(MAKE) env-local-down
+
+test: test-local ## Alias for test-local
+
 .PHONY: help
Makefile (1)

175-179: Performance consideration for the ci target.

Running make -j 10 lint test etoe in parallel might overwhelm system resources, especially since e2e tests typically require exclusive access to ports and services. Consider if this level of parallelism is appropriate.

-	$(MAKE) -j 10 lint test etoe
+	$(MAKE) lint
+	$(MAKE) -j 2 test etoe

This would run linting first (which is fast), then run tests and e2e in parallel with reduced concurrency to avoid resource conflicts.

.github/workflows/ci.yaml (1)

91-91: Potential redundancy in go module cache restore keys.

The go module cache restore keys include the same key twice in the restore-keys list. This is harmless but redundant.

           restore-keys: |
-            ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
             ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-
             ${{ runner.os }}-openmeter-go-modules-main-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
             ${{ runner.os }}-openmeter-go-modules-main

Also applies to: 141-141, 209-209, 305-305

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e9ba8b and 32b19e8.

📒 Files selected for processing (34)
  • .dagger/build.go (0 hunks)
  • .dagger/dev.go (0 hunks)
  • .dagger/generate.go (0 hunks)
  • .dagger/lint.go (0 hunks)
  • .dagger/test.go (0 hunks)
  • .dagger/test_e2e.go (0 hunks)
  • .dagger/utils.go (1 hunks)
  • .github/workflows/artifacts.yaml (3 hunks)
  • .github/workflows/ci.yaml (5 hunks)
  • .github/workflows/sdk-javascript-release.yaml (1 hunks)
  • .vscode/settings.json (1 hunks)
  • Dockerfile (2 hunks)
  • Makefile (3 hunks)
  • api/client/javascript/Makefile (1 hunks)
  • api/client/javascript/src/client/schemas.ts (3 hunks)
  • api/client/javascript/src/zod/index.ts (8 hunks)
  • api/spec/Makefile (1 hunks)
  • docker-compose.base.yaml (1 hunks)
  • docker-compose.yaml (1 hunks)
  • e2e/.gitignore (1 hunks)
  • e2e/Makefile (1 hunks)
  • e2e/docker-compose.infra.yaml (1 hunks)
  • e2e/docker-compose.openmeter-latest.yaml (1 hunks)
  • e2e/docker-compose.openmeter-local.yaml (1 hunks)
  • e2e/docker-compose.openmeter.yaml (1 hunks)
  • e2e/e2e_test.go (1 hunks)
  • e2e/entitlement_test.go (2 hunks)
  • e2e/productcatalog_test.go (3 hunks)
  • e2e/setup_test.go (1 hunks)
  • flake.nix (1 hunks)
  • quickstart/.gitignore (1 hunks)
  • quickstart/README.md (5 hunks)
  • quickstart/docker-compose.ci.yaml (0 hunks)
  • quickstart/docker-compose.yaml (3 hunks)
💤 Files with no reviewable changes (7)
  • .dagger/test.go
  • .dagger/dev.go
  • quickstart/docker-compose.ci.yaml
  • .dagger/generate.go
  • .dagger/test_e2e.go
  • .dagger/lint.go
  • .dagger/build.go
✅ Files skipped from review due to trivial changes (3)
  • e2e/.gitignore
  • quickstart/.gitignore
  • .vscode/settings.json
🚧 Files skipped from review as they are similar to previous changes (12)
  • e2e/docker-compose.openmeter-latest.yaml
  • .dagger/utils.go
  • .github/workflows/sdk-javascript-release.yaml
  • e2e/docker-compose.openmeter.yaml
  • quickstart/README.md
  • e2e/entitlement_test.go
  • e2e/productcatalog_test.go
  • quickstart/docker-compose.yaml
  • .github/workflows/artifacts.yaml
  • docker-compose.yaml
  • flake.nix
  • Dockerfile
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-03-07T12:17:43.129Z
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.

Applied to files:

  • e2e/e2e_test.go
🧬 Code Graph Analysis (1)
e2e/e2e_test.go (5)
api/api.gen.go (4)
  • ResetEntitlementUsageJSONRequestBody (8508-8508)
  • EntitlementMeteredCreateInputs (2823-2860)
  • RecurringPeriodCreateInput (5900-5906)
  • CreateEntitlementJSONRequestBody (8499-8499)
openmeter/ent/db/grant/where.go (1)
  • EffectiveAt (105-107)
openmeter/ent/db/usagereset/where.go (1)
  • Anchor (100-102)
pkg/convert/ptr.go (1)
  • ToPointer (10-12)
openmeter/ent/db/entitlement/where.go (1)
  • IssueAfterReset (120-122)
🪛 checkmake (0.2.2)
api/client/javascript/Makefile

[warning] 11-11: Missing required phony target "all"

(minphony)


[warning] 11-11: Missing required phony target "clean"

(minphony)


[warning] 11-11: Missing required phony target "test"

(minphony)

api/spec/Makefile

[warning] 17-17: Missing required phony target "all"

(minphony)


[warning] 17-17: Missing required phony target "clean"

(minphony)


[warning] 17-17: Missing required phony target "test"

(minphony)

e2e/Makefile

[warning] 34-34: Missing required phony target "all"

(minphony)


[warning] 34-34: Missing required phony target "clean"

(minphony)


[warning] 34-34: Missing required phony target "test"

(minphony)

🪛 Gitleaks (8.27.2)
docker-compose.base.yaml

123-123: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.

(jwt)

🪛 Checkov (3.2.334)
docker-compose.base.yaml

[MEDIUM] 121-122: Basic Auth Credentials

(CKV_SECRET_4)

🔇 Additional comments (30)
api/client/javascript/src/zod/index.ts (3)

4522-4522: Constants for party key max length look good and consistent (256).

Using explicit per-context constants mirrors the existing style in this file and keeps future changes localized.

Also applies to: 4531-4531


5916-5916: Supplier key max length (createBillingProfile) set to 256 — consistent with other key fields.

No issues spotted.


6302-6302: Supplier key max length (updateBillingProfile) set to 256 — consistent and fine.

Matches creation model and invoice model.

e2e/setup_test.go (1)

26-30: LGTM!

The shouldRunSlowTests helper is well-implemented with proper test helper marking and provides a clean way to gate slow tests based on environment configuration.

e2e/e2e_test.go (3)

1005-1010: LGTM! Well-structured slow test gating.

The slow test wrapper appropriately uses the shouldRunSlowTests helper to conditionally skip time-consuming tests. The skip message clearly explains the reasoning and provides guidance for when to re-enable these tests.


1012-1040: LGTM! Proper reset test implementation.

The reset test correctly waits for time to advance before performing the reset operation and validates the grants before proceeding. The implementation properly handles the timing constraints mentioned in the comments.


1047-1076: LGTM! Comprehensive entitlement creation test.

The test properly validates the creation of an entitlement with automatic grant issuing, verifies the correct subject assignment, and confirms that grants are created as expected. The test structure is clear and follows good testing practices.

api/client/javascript/Makefile (4)

1-1: LGTM! Good documentation reference.

The reference to the self-documenting Makefile pattern provides helpful context for maintainers and follows the same approach used across other Makefiles in the repository.


4-9: LGTM! Well-structured JavaScript SDK generation pipeline.

The generate target follows a logical sequence: install dependencies with frozen lockfile, generate code, build, and test. The use of --frozen-lockfile ensures reproducible builds, and the inclusion of testing validates the generated output.


13-14: LGTM! Standard help target implementation.

The help target correctly implements the self-documenting Makefile pattern with proper formatting and color output for improved usability.


20-22: LGTM! Consistent print-target macro.

The print-target macro provides consistent visual feedback across all Makefiles in the repository and improves the developer experience by clearly indicating which target is executing.

api/spec/Makefile (5)

1-1: LGTM! Consistent documentation approach.

The reference to the self-documenting Makefile pattern maintains consistency with other Makefiles in the repository.


4-9: LGTM! Proper OpenAPI spec generation workflow.

The generate target correctly installs dependencies, compiles the specs, and copies the output files to their expected locations in the repository root. The use of --frozen-lockfile ensures reproducible builds.


12-15: LGTM! Clean linting target.

The lint target follows the same pattern as generate with dependency installation and proper linting execution.


19-20: LGTM! Standard help implementation.

The help target maintains consistency with the self-documenting pattern used across the repository.


26-28: LGTM! Consistent macro implementation.

The print-target macro matches the implementation used in other Makefiles, maintaining consistency across the repository.

docker-compose.base.yaml (5)

4-25: LGTM! Comprehensive Kafka configuration.

The Kafka service is properly configured for development use with appropriate environment variables, JMX monitoring, and a robust healthcheck. The configuration supports both internal and external connectivity patterns.


27-42: LGTM! Well-configured ClickHouse service.

The ClickHouse configuration includes proper authentication, database setup, and ulimits for file descriptors. The healthcheck uses a reliable HTTP ping endpoint.


59-66: LGTM! Appropriate Redis configuration for development.

The Redis service is configured with sensible memory limits and eviction policies for development use. The healthcheck properly validates Redis availability.


98-114: LGTM! Proper PostgreSQL setup with initialization.

The PostgreSQL service includes proper authentication configuration, logical replication support, and initialization script mounting. The healthcheck validates database readiness.


131-136: LGTM! Proper database initialization script.

The svix SQL configuration properly creates the user, database, and grants appropriate privileges. This is a clean approach for development environment setup.

e2e/docker-compose.openmeter-local.yaml (1)

1-11: LGTM! Well-documented docker-compose configuration.

The file provides clear documentation about proper usage and intentional design decisions. The configuration correctly defines the required services for local e2e testing.

e2e/docker-compose.infra.yaml (1)

1-41: LGTM! Excellent port management for environment separation.

The configuration correctly uses the 30000+ port range to avoid conflicts with the main dev environment. The service extensions are properly configured, and the inline SQL configuration for Svix is appropriate for testing scenarios.

Makefile (3)

26-30: Makefile generate target verified in api/client/javascript
The api/client/javascript/Makefile exists and defines the generate: target as expected:

generate: ## Generate JavaScript SDK
	$(call print-target)
	pnpm --frozen-lockfile install
	pnpm run generate
	pnpm build
	pnpm test

No changes required.


23-24: Confirmed: generate target exists in api/spec/Makefile

Ran a quick check and found this definition in api/spec/Makefile:

generate: ## Generate OpenAPI spec
	$(call print-target)
	pnpm --frozen-lockfile install
	pnpm compile
	cp output/openapi.OpenMeter.yaml ../openapi.yaml
	cp output/openapi.OpenMeterCloud.yaml ../openapi.cloud.yaml

The generate target is present and correctly set up. No further action needed.


162-162: .spectral.yaml and OpenAPI spec validated

  • ✓ .spectral.yaml exists and extends [spectral:oas, recommended] with the expected rule overrides
  • ✓ api/openapi.yaml is present

Please ensure that the spectral CLI is provided in your Nix environment (e.g. via shell.nix or default.nix) so that the lint-openapi target can invoke spectral lint successfully.

.github/workflows/ci.yaml (4)

107-165: LGTM! Excellent addition of code generation validation.

The generators job properly ensures that all code generation is up-to-date by running make generate-all and checking for uncommitted changes. The logic correctly handles both modified files (git diff) and new untracked files (git status --porcelain).


267-352: Excellent migration from Dagger to Nix-based linting.

The lint job has been successfully migrated to use Nix tooling with several improvements:

  • Smart caching: Base-commit aware lint caching will significantly improve performance
  • Modular approach: Separate steps for different linters improve debuggability
  • Proper environment: GOLANGCI_LINT_CACHE environment variable ensures consistent cache usage

391-470: Well-implemented artifact-driven quickstart testing.

The quickstart job correctly:

  • Depends on artifacts for container images
  • Creates dynamic override files to use the built images
  • Uses proper health checks and timeouts
  • Runs tests with the correct environment variables

471-562: Robust e2e testing implementation.

The e2e job follows the same excellent pattern as quickstart:

  • Artifact-driven container images
  • Proper service orchestration
  • Health checks and readiness validation
  • Log collection for debugging

The timeout of 3 minutes for e2e tests is appropriate given that long-sleep test cases are being skipped as mentioned in the PR objectives.

Comment thread api/client/javascript/src/zod/index.ts Resolved
Comment thread docker-compose.base.yaml Resolved
Comment thread docker-compose.base.yaml Resolved
@turip
turip force-pushed the ci/generate-lint-nix branch from 32b19e8 to f963b2d Compare August 12, 2025 15:12
@turip
turip enabled auto-merge (squash) August 12, 2025 15:13
@turip
turip merged commit 6f78002 into main Aug 12, 2025
@turip
turip deleted the ci/generate-lint-nix branch August 12, 2025 15:16
@coderabbitai coderabbitai Bot mentioned this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/ignore Ignore this change when generating release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants