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

prevent running migration CI check if removal label is present #5075

Merged
merged 11 commits into from
Apr 30, 2024

Conversation

cgoodfred
Copy link
Contributor

@cgoodfred cgoodfred commented Apr 30, 2024

Jira Ticket

COST-4947

Description

This change will allow skipping the migration check if we are removing fields from a model since the fields should be removed prior to the migration to drop those fields running.

Adding this allows us to follow along with the flow for removing fields suggested in this gist: https://gist.github.com/majackson/493c3d6d4476914ca9da63f84247407b#removing-fields-or-tables

Testing

  1. This branch has run a few different times with and without the label with a model change. With the label the unit tests check runs smoothly and succeeds, without the label the unit tests fail similar to
Migrations for 'api':
  koku/api/migrations/0063_remove_providerinfrastructuremap_infrastructure_account_and_more.py
    - Remove field infrastructure_account from providerinfrastructuremap
    - Remove field infrastructure_region from providerinfrastructuremap
Migrations are out of sync with the models. Run 'make make-migrations' to update.

Release Notes

  • proposed release note
* [COST-4947](https://issues.redhat.com/browse/COST-4947) Update CI check to allow removing model fields prior to migration

@cgoodfred cgoodfred added skip-migration-check Skip migration test in CI. Useful for separating model changes from the migration. and removed model-removal labels Apr 30, 2024
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (91b0ffb) to head (5d38837).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5075     +/-   ##
=======================================
- Coverage   94.1%   94.1%   -0.0%     
=======================================
  Files        377     377             
  Lines      31346   31346             
  Branches    3715    3715             
=======================================
- Hits       29507   29503      -4     
- Misses      1173    1176      +3     
- Partials     666     667      +1     

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Co-authored-by: Sam Doran <sdoran@redhat.com>
@cgoodfred cgoodfred closed this Apr 30, 2024
@cgoodfred cgoodfred reopened this Apr 30, 2024
@cgoodfred cgoodfred marked this pull request as ready for review April 30, 2024 14:28
@cgoodfred cgoodfred requested review from a team as code owners April 30, 2024 14:28
@cgoodfred cgoodfred merged commit 5ac84cc into main Apr 30, 2024
11 checks passed
@cgoodfred cgoodfred deleted the no-ci-migration-check-if-label branch April 30, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-skip-smokes skip-migration-check Skip migration test in CI. Useful for separating model changes from the migration.
Projects
None yet
3 participants