Skip to content

Remove unused semver column on ci_runners

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR addresses #365250 (closed) by doing the following:

  • removing the unused semver column and related index from the ci_runners table, introduced in !89023 (merged);

  • removing the Gitlab::BackgroundMigration::BackfillCiRunnerSemver background migration, which had already been deleted in %15.2 by the DeleteBackfillCiRunnerSemverMigration post-migration (not sure if this is the correct way to do things, so would appreciate feedback);

  • fixing the ignore_column milestone, which was set to the N+1 milestone instead of N+2, as specified in the documentation:

    image

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Database migration output

Migrate up
main: == 20220719165537 RemoveCiRunnersSemverColumn: migrating ======================
main: -- remove_column(:ci_runners, :semver)
main:    -> 0.0029s
main: == 20220719165537 RemoveCiRunnersSemverColumn: migrated (0.0036s) =============

ci: == 20220719165537 RemoveCiRunnersSemverColumn: migrating ======================
ci: -- remove_column(:ci_runners, :semver)
ci:    -> 0.0017s
ci: == 20220719165537 RemoveCiRunnersSemverColumn: migrated (0.0017s) =============
Migrate down
main: == 20220719165537 RemoveCiRunnersSemverColumn: reverting ======================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- add_column(:ci_runners, :semver, :text, {:null=>true})
main:    -> 0.0007s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- current_schema()
main:    -> 0.0001s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("ALTER TABLE ci_runners\nADD CONSTRAINT check_a4f24953fd\nCHECK ( char_length(semver) <= 16 )\nNOT VALID;\n")
main:    -> 0.0004s
main: -- current_schema()
main:    -> 0.0001s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0001s
main: -- execute("ALTER TABLE ci_runners VALIDATE CONSTRAINT check_a4f24953fd;")
main:    -> 0.0002s
main: -- execute("RESET statement_timeout")
main:    -> 0.0001s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:ci_runners, "id, (semver::cidr)", {:name=>"index_ci_runners_on_id_and_semver_cidr", :algorithm=>:concurrently})
main:    -> 0.0043s
main: -- add_index(:ci_runners, "id, (semver::cidr)", {:name=>"index_ci_runners_on_id_and_semver_cidr", :algorithm=>:concurrently})
main:    -> 0.0019s
main: == 20220719165537 RemoveCiRunnersSemverColumn: reverted (0.0234s) =============

ci: == 20220719165537 RemoveCiRunnersSemverColumn: reverting ======================
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- add_column(:ci_runners, :semver, :text, {:null=>true})
ci:    -> 0.0006s
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- current_schema()
ci:    -> 0.0001s
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- execute("ALTER TABLE ci_runners\nADD CONSTRAINT check_a4f24953fd\nCHECK ( char_length(semver) <= 16 )\nNOT VALID;\n")
ci:    -> 0.0004s
ci: -- current_schema()
ci:    -> 0.0001s
ci: -- execute("SET statement_timeout TO 0")
ci:    -> 0.0001s
ci: -- execute("ALTER TABLE ci_runners VALIDATE CONSTRAINT check_a4f24953fd;")
ci:    -> 0.0004s
ci: -- execute("RESET statement_timeout")
ci:    -> 0.0001s
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- index_exists?(:ci_runners, "id, (semver::cidr)", {:name=>"index_ci_runners_on_id_and_semver_cidr", :algorithm=>:concurrently})
ci:    -> 0.0041s
ci: -- add_index(:ci_runners, "id, (semver::cidr)", {:name=>"index_ci_runners_on_id_and_semver_cidr", :algorithm=>:concurrently})
ci:    -> 0.0013s
ci: == 20220719165537 RemoveCiRunnersSemverColumn: reverted (0.0206s) =============

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Pedro Pombeiro

Merge request reports

Loading