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

Add data migration to nullify target fields on bs_request_actions #17324

Conversation

eduardoj
Copy link
Member

@eduardoj eduardoj commented Jan 31, 2025

Nullify target_project_id and target_package_id in bs_request_actions if the project or/and package no longer exist.

Follow-up to #17310.

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Jan 31, 2025
@eduardoj eduardoj force-pushed the refactoring/data_migration_nullify_target_prjs_and_packs branch from 304b696 to 0176bd9 Compare January 31, 2025 11:58
@eduardoj eduardoj marked this pull request as ready for review January 31, 2025 11:59
@eduardoj eduardoj force-pushed the refactoring/data_migration_nullify_target_prjs_and_packs branch 2 times, most recently from 9e2204c to da95a70 Compare January 31, 2025 14:34
@eduardoj eduardoj force-pushed the refactoring/data_migration_nullify_target_prjs_and_packs branch from da95a70 to dbf6713 Compare February 3, 2025 09:25
@adrianschroeter
Copy link
Member

adrianschroeter commented Feb 3, 2025 via email

@eduardoj
Copy link
Member Author

eduardoj commented Feb 3, 2025

On Montag, 3. Februar 2025, 11:17:56 CET Eduardo J. wrote: @eduardoj commented on this pull request.

Hm... Do we really want to skip remote projects?

you can never have a remote target project at least.

Ok, then we are safe with applying Project.find_by(name: action.target_project)

Also, be sure not to loose informations. We must keep the information about the request source/target, even when the projects or packages get removed.

That information will be kept (and never touched) in the string fields source_project, source_package, target_project and target_package. The only fields which will be modified are source_project_id, source_package_id, target_project_id and target_package_id, for searching purposes. So we are safe there.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Nullify `target_project_id` and `target_package_id` in
`bs_request_actions` if the project or/and package no longer exist.
@eduardoj eduardoj force-pushed the refactoring/data_migration_nullify_target_prjs_and_packs branch from dbf6713 to 928524f Compare February 3, 2025 10:38
@hennevogel hennevogel merged commit ce8311f into openSUSE:master Feb 3, 2025
22 checks passed
@eduardoj eduardoj deleted the refactoring/data_migration_nullify_target_prjs_and_packs branch February 3, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants