Skip to content

Conversation

@gfyrag
Copy link
Contributor

@gfyrag gfyrag commented Nov 19, 2025

No description provided.

@gfyrag gfyrag requested a review from a team as a code owner November 19, 2025 12:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

A new ChartVersion field is added to the PostgreSQL installation configuration and threaded into the component arguments so the Helm chart Version is taken from configuration instead of a hard-coded value.

Changes

Cohort / File(s) Summary
PostgreSQL Chart Configuration
deployments/pulumi/pkg/config/config.go
Added public ChartVersion (string) to PostgresInstall with JSON/YAML tags.
PostgreSQL Installation Component
deployments/pulumi/pkg/storage/component_postgres.go
Added ChartVersion pulumix.Input[string] to PostgresInstallArgs, defaulted when nil, and replaced the hard-coded chart version with args.ChartVersion when constructing the Helm chart Version.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Config as Config (PostgresInstall)
    participant Component as Component (PostgresInstallArgs)
    participant Helm as Helm Chart deploy

    rect rgb(230, 245, 255)
    Config->>Component: pass ChartVersion (string) into PostgresInstallArgs
    end

    rect rgb(245, 255, 230)
    Component->>Helm: provide Chart values (including Version from ChartVersion)
    Helm->>Helm: deploy chart using provided Version
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Small, localized changes (two files) and consistent propagation pattern.
  • Pay attention to:
    • Defaulting behavior for ChartVersion in SetDefaults.
    • Correct type propagation between config (string) and pulumix.Input[string] usages.

Possibly related PRs

Suggested reviewers

  • paul-nicolas

Poem

🐰
I hopped through configs, neat and spry,
Replaced the hard-code with a sky-high try.
ChartVersion now whispers where to go,
Charts deploy with the version you show. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the motivation for making the chart version configurable and any relevant context.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: making the Pulumi postgres chart version configurable instead of hard-coded.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/pulumi-postgres-chart-version

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

@gfyrag gfyrag force-pushed the fix/pulumi-postgres-chart-version branch from 5ffbf3a to a44053e Compare November 19, 2025 12:36
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.35%. Comparing base (fba221d) to head (2887a4f).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1139      +/-   ##
==========================================
- Coverage   78.38%   78.35%   -0.03%     
==========================================
  Files         190      190              
  Lines        9408     9408              
==========================================
- Hits         7374     7372       -2     
- Misses       1305     1307       +2     
  Partials      729      729              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
deployments/pulumi/pkg/storage/component_postgres.go (1)

65-84: Add default value handling for ChartVersion.

The SetDefaults() method sets defaults for Username and Password, but not for ChartVersion. Without a default, an empty chart version will be passed to Helm if users don't specify it in their configuration, causing deployment failures.

Apply this diff to add default handling:

 	args.Password = pulumix.Apply(args.Password, func(password string) string {
 		if password == "" {
 			return "password"
 		}
 		return password
 	})
+	if args.ChartVersion == nil {
+		args.ChartVersion = pulumix.Val("")
+	}
+	args.ChartVersion = pulumix.Apply(args.ChartVersion, func(version string) string {
+		if version == "" {
+			return "16.4.7"
+		}
+		return version
+	})
 }
🧹 Nitpick comments (1)
deployments/pulumi/pkg/config/config.go (1)

160-162: Consider using lowercase naming for consistency.

The JSON/YAML tag chartVersion uses camelCase, while other fields in the same struct (username, password) use lowercase. For consistency within the struct, consider using lowercase chartversion.

Apply this diff if you prefer consistency:

-	// ChartVersion is the bitnami/postgres chart version
-	ChartVersion string `json:"chartVersion" yaml:"chartVersion"`
+	// ChartVersion is the bitnami/postgres chart version
+	ChartVersion string `json:"chartversion" yaml:"chartversion"`
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a53d9a7 and a44053e.

📒 Files selected for processing (2)
  • deployments/pulumi/pkg/config/config.go (2 hunks)
  • deployments/pulumi/pkg/storage/component_postgres.go (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Tests
🔇 Additional comments (2)
deployments/pulumi/pkg/storage/component_postgres.go (2)

62-62: Field addition looks good, but needs default value handling.

The ChartVersion field is properly added to the struct. However, ensure the SetDefaults() method (see comment on lines 65-84) is updated to provide a default value.


102-102: Good change to enable configurable chart version.

The switch from a hardcoded version to the configurable ChartVersion field properly enables dynamic chart version selection. The .ToOutput().Untyped() pattern is standard for Pulumi input conversions.

paul-nicolas
paul-nicolas previously approved these changes Nov 19, 2025
@gfyrag gfyrag enabled auto-merge November 19, 2025 12:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a44053e and 2887a4f.

📒 Files selected for processing (1)
  • deployments/pulumi/pkg/storage/component_postgres.go (2 hunks)
🔇 Additional comments (2)
deployments/pulumi/pkg/storage/component_postgres.go (2)

59-63: LGTM! Field addition follows existing patterns.

The ChartVersion field is properly added to the struct and follows the same pattern as the existing Username and Password fields.


105-105: Chart version properly propagated through configuration layer.

Verification confirms that ChartVersion is correctly threaded from the configuration layer to the component. The PostgresDatabase.toInput() method in deployments/pulumi/pkg/config/config.go (line 191) explicitly maps a.Install.ChartVersion to storage.PostgresInstallArgs.ChartVersion using pulumix.Val(), converting it from a string to pulumix.Input[string]. The type assertion pattern used on line 105 aligns with idiomatic usage in this codebase.

@gfyrag gfyrag added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 0870634 Nov 20, 2025
12 of 14 checks passed
@gfyrag gfyrag deleted the fix/pulumi-postgres-chart-version branch November 20, 2025 17:01
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.

4 participants