Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare Annotation Key Column Rename #3402

Merged
merged 3 commits into from
Aug 24, 2023
Merged

Conversation

FloThinksPi
Copy link
Member

@FloThinksPi FloThinksPi commented Aug 22, 2023

This change introduces views on all annotation tables where the column
key has the alias key_name. The coding then uses these Views and all
occurences of 'key' are replaced by 'key_name' in the CCs code.

Later on on can then change the column name of the 'key' column in all
annotations tabels to 'key_name' transparently without downtime and
remove the view in a third step.

This change is a refactoring to streamline annotations and labels
and finish tasks proposed in
/decitions/0004-adding-key-prefix-to-annotations.md

Also see this ADR for more information https://github.com/cloudfoundry/cloud_controller_ng/blob/main/decisions/0011-make-labels-and-annotations-unique.md

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch 3 times, most recently from 05be117 to 22b6ce7 Compare August 23, 2023 09:12
@FloThinksPi FloThinksPi marked this pull request as ready for review August 23, 2023 09:20
@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch from 22b6ce7 to 089fee6 Compare August 23, 2023 09:23
FloThinksPi added a commit that referenced this pull request Aug 23, 2023
These ADRs document the canges conducted in:
- #3402
- #3400
- #3394
- #3401
FloThinksPi added a commit that referenced this pull request Aug 23, 2023
These ADRs document the canges conducted in:
- #3402
- #3400
- #3394
- #3401
- #3399
@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch from 089fee6 to acc8a4a Compare August 23, 2023 10:26
FloThinksPi added a commit that referenced this pull request Aug 23, 2023
These ADRs document the canges conducted in:
- #3402
- #3400
- #3394
- #3401
- #3393
This change introduces views on all annotation tables where the column
key has the alias key_name. The coding then uses these Views and all
occurences of 'key' are replaced by 'key_name' in the CCs code.

Later on on can then change the column name of the 'key' column in all
annotations tabels to 'key_name' transparently without downtime and
remove the view in a third step.

This change is a refactoring to streamline annotations and labels
and finish tasks proposed in
/decitions/0004-adding-key-prefix-to-annotations.md
@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch 2 times, most recently from f6febf2 to 18f4963 Compare August 23, 2023 15:29
FloThinksPi added a commit that referenced this pull request Aug 23, 2023
These ADRs document the canges conducted in:
- #3402
- #3400
- #3394
- #3401
- #3393
FloThinksPi added a commit that referenced this pull request Aug 23, 2023
These ADRs document the canges conducted in:
- #3402
- #3400
- #3394
- #3401
- #3393
FloThinksPi added a commit that referenced this pull request Aug 23, 2023
These ADRs document the canges conducted in:
- #3402
- #3400
- #3394
- #3401
- #3393
@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch from 18f4963 to 9c0749c Compare August 24, 2023 06:58
This change fixes the migration tests for the streamlining of annotation
keys. The previous test would leave the db in a half migrated state and
then following tests would fail due to the rest of the migrations beeing
missing.

It may make sense to move the begin and after part of the migration test
into a helper to make this a proper workflow for every migration test
since we must make sure we start the test before the migration we`d like
to test. Then just apply one single migration(and not all migrations),
then expect certain behaviour and lastly complete the migration to not
destroy the DB. This should be in a helper as currently it also requires
working down migrations which is not always the case.
@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch from 9c0749c to e477cca Compare August 24, 2023 07:14
This is to prevent warnings due to redefinition of a variable since
it looks like the migrations get mashed together inside the sequel
library
@FloThinksPi FloThinksPi force-pushed the prepare_annotation_key_rename branch from e477cca to c10eb1f Compare August 24, 2023 07:49
@FloThinksPi FloThinksPi merged commit be17eac into main Aug 24, 2023
@FloThinksPi FloThinksPi deleted the prepare_annotation_key_rename branch August 24, 2023 08:16
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