Skip to content

Conversation

@cedric-cordenier
Copy link
Contributor

…of goose_migrations

Requires

Supports

@cedric-cordenier cedric-cordenier requested a review from a team as a code owner December 18, 2025 14:37
Copilot AI review requested due to automatic review settings December 18, 2025 14:37
@cedric-cordenier cedric-cordenier requested a review from a team as a code owner December 18, 2025 14:37
@github-actions
Copy link
Contributor

👋 cedric-cordenier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an environment variable CL_MIGRATIONS_SCHEMA_OVERRIDE to address schema resolution issues with the goose_migrations table in Goose 3.23.0+. The fix allows explicit schema specification for NOPs where current_schema() differs from "public" but the migrations table resides in the "public" schema.

Key Changes

  • Added CL_MIGRATIONS_SCHEMA_OVERRIDE environment variable support for explicit schema control
  • Implemented conditional schema prefixing for the goose_migrations table name
  • Added comprehensive inline documentation explaining the Goose version-specific behavior change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// This can cause issues with some NOPs where current_schema() != "public", but the `goose_migrations` table
// is still created in "public".
// For those NOPs, we can set CL_MIGRATIONS_SCHEMA_OVERRIDE=public to ensure Goose correctly resolves the table.
schemaOverride := os.Getenv("CL_MIGRATIONS_SCHEMA_OVERRIDE")
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The schema override from environment variable lacks input validation. Malicious or malformed schema names could lead to SQL injection vulnerabilities when constructing the qualified table name. Validate the schema name against a whitelist or use proper SQL identifier escaping.

Copilot uses AI. Check for mistakes.
schemaOverride := os.Getenv("CL_MIGRATIONS_SCHEMA_OVERRIDE")
tableName := "goose_migrations"
if schemaOverride != "" {
tableName = fmt.Sprintf("%s.%s", schemaOverride, tableName)
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The schema name is directly interpolated into the table name string without sanitization or escaping. This could allow SQL injection if the environment variable contains malicious input. Use proper SQL identifier quoting or validation before constructing the qualified table name.

Copilot uses AI. Check for mistakes.
@cl-sonarqube-production
Copy link

@trunk-io
Copy link

trunk-io bot commented Dec 18, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

Flaky Test Failure Summary Logs
Test_CRE_V2_EVM_WriteReport_Invalid_Gas_Regression/[v2]_EVM.WriteReport_-_invalid_gas_fails_with_low The test failed during the EVM write regression due to an error in deploying or configuring the workflow. Logs ↗︎
Test_CRE_V2_EVM_WriteReport_Invalid_Gas_Regression/[v2]_EVM.WriteReport_-_invalid_gas_fails_with_low The test failed without a specific error message indicating what went wrong. Logs ↗︎
Test_CRE_V2_EVM_WriteReport_Invalid_Gas_Regression/[v2]_EVM.WriteReport_-_invalid_gas_fails_with_low The test failed during the EVM write regression due to an invalid gas amount causing the transaction to fail. Logs ↗︎
Test_CRE_V2_EVM_WriteReport_Invalid_Gas_Regression/[v2]_EVM.WriteReport_-_invalid_gas_fails_with_low The test failed during the EVM write regression due to an invalid gas value that caused the transaction to fail. Logs ↗︎

View Full Report ↗︎Docs

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.

3 participants