cloudfoundry / cloud_controller_ng

Cloud Foundry Cloud Controller
Apache License 2.0
194 stars 360 forks source link

Remove Mysql5.7 support / remove Mysql5.7 from PR validation #3949

Open kathap opened 2 months ago

kathap commented 2 months ago

Mysql5.7 is not supported any more, remove support for Mysql5.7

MySQL@5.7 is not supported any more upstream and also not in cf-deployment. PR validation could be sped up by removing the checks for MySQL5.7. Extra lines in migrations, that are needed to be compliant with Mysql5.7, would not be necessary (e.g. removing unique constraint in MySQL 5.7 does not include removing the corresponding index, in higher versions it does).

Steps to Reproduce

Write a migration to drop a unique constraint, like

Sequel.migration do
  up do
    if self.class.name.match?(/mysql/i)
      alter_table :quota_definitions do
        drop_constraint :name, if_exists: true
      end
    elsif self.class.name.match?(/postgres/i)
      alter_table :quota_definitions do
        drop_constraint :quota_definitions_name_key, if_exists: true
      end
    end
  end

  down do
    if self.class.name.match?(/mysql/i)
      alter_table :quota_definitions do
        add_unique_constraint :name, name: :name, if_not_exists: true
      end
    elsif self.class.name.match?(/postgres/i)
      alter_table :quota_definitions do
        add_unique_constraint :name, name: :quota_definitions_name_key, if_not_exists: true
      end
    end
  end
end

and open a PR. It will fail with Mysql2::Error: Duplicate key name 'name' for MySQL5.7.

Expected result

PR validation runs without check for MySQL5.7, same for Backwards Compatibility Unit Tests.

Current result

Migrations and migration specs need to be compliant for MySQL5.7

Possible Fix

Remove support for MySQL5.7 and the MySQL5.7 PR validation checks.

Gerg commented 2 months ago

It's worth noting that some MySQL vendors still offer extended support for 5.7, notably Amazon RDS (until at least 2025).

I'm not saying we couldn't drop testing for it, but EoL for upstream MySQL doesn't necessarily mean that people can't get an in-support version of it.