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

Warn about migrations #15824

Merged
merged 2 commits into from Mar 18, 2024
Merged

Warn about migrations #15824

merged 2 commits into from Mar 18, 2024

Conversation

saraycp
Copy link
Contributor

@saraycp saraycp commented Mar 18, 2024

This PR drops the existing Isolated Migrations check which had some limitations. Among others, it failed when the migration was committed together with the corresponding annotations in models or with validations that fit the database consistency.

We don't need a check that passes or fails in those cases. It's enough with some warning (comment on the PR) when:

  • There is a migration together with other changes (except schema changes).
  • There is a db or data migration but its db or data schema is not present.

The comments look like this:

Screenshot 2024-03-11 at 23-16-05 WIP warn migration by saraycp · Pull Request #29 · saraycp_hello_world

Pull requests that come from a fork don't have write permissions, so we can't write comments to a PR from one single GitHub action. That's why this is split into two actions to make it work and be safe, according to this article.

Moreover, these actions should be in production to work. Otherwise, the second action/workflow will never run.

They write comments when:
  - there is a migration together with other changes (except schema
    changes),
  - there is a migration but not its corresponding db schema,
  - there is a data migration but not its corresponding data schema.

It is splitted into two actions, the first one stores the texts in
artifacts (text files) and the second one create the comments using
those texts. This is required to allow pull requests that come from
forks to write.
@github-actions github-actions bot added the Test Suite / CI 💉 Things related to our tests/CI label Mar 18, 2024
@saraycp saraycp marked this pull request as ready for review March 18, 2024 12:43
@saraycp saraycp merged commit 0a78d19 into openSUSE:master Mar 18, 2024
20 checks passed
@saraycp saraycp deleted the warn_about_migrations branch March 18, 2024 13:47
@saraycp saraycp mentioned this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Suite / CI 💉 Things related to our tests/CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants