Skip to content

convert postgres_config steps to go#164

Open
stevenolen wants to merge 1 commit intomainfrom
convert-step-postgres-config
Open

convert postgres_config steps to go#164
stevenolen wants to merge 1 commit intomainfrom
convert-step-postgres-config

Conversation

@stevenolen
Copy link
Collaborator

Description

Refactors the aws control room & workload and azure workload postgres_config steps from python to go. This has been tested with a control room and 2 workloads, producing no diffs.

Category of change

  • Bug fix (non-breaking change which fixes an issue)
  • Version upgrade (upgrading the version of a service or product)
  • New feature (non-breaking change which adds functionality)
  • Build: a code change that affects the build system or external dependencies
  • Performance: a code change that improves performance
  • Refactor: a code change that neither fixes a bug nor adds a feature
  • Documentation: documentation changes
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have reviewed my own diff and added inline comments on lines I want reviewers to focus on or that I am uncertain about

)
switch s.DstTarget.CloudProvider() {
case types.AWS:
return s.runAWSInlineGo(ctx, creds, envVars)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there's likely a little dry missing here aws vs. azure, but it's probably not so important


// --- Azure ---

// azurePostgresParams holds the pre-fetched data needed by the Azure deploy function.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unclear on the necessity of this, but it looks like a reasonable choice to me.

return runPulumi(ctx, stack, s.Options)
}

// --- Shared helpers ---
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this shared helper might belong elsewhere, but it feels pretty unique to this step to me.

componentType = "ptd:AWSControlRoomPostgresConfig"
}

// Helper to create alias pointing to old Python component parent URN.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we may want to figure out how to refactor this later to be very generic/work for all steps, since it's the real crux of how to convert these steps between languages without producing diffs/deltas

ctx.Export("grafana_db_name", grafanaDb.Name)
ctx.Export("grant_id", grant.ID())

// Extra databases (workload only, e.g. soleng for staging workloads)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

obviously, we shouldn't use this anymore. but i didn't want to have to clean up/migrate the existing databases prior to conversion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@stevenolen stevenolen requested review from Lytol and timtalbot March 5, 2026 20:04
@stevenolen stevenolen marked this pull request as ready for review March 5, 2026 20:05
@stevenolen stevenolen requested a review from a team as a code owner March 5, 2026 20:05
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