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

ci: add alteration scripts compatibility test jobs #4627

Merged

Conversation

simeng-li
Copy link
Contributor

@simeng-li simeng-li commented Oct 9, 2023

Summary

To address the issue of production errors caused by incompatible database alterations, we're introducing a new CI job dedicated to ensuring the compatibility of alteration scripts with our production code. This job aims to prevent altered data from breaking our production systems when the production DB has been altered but the new release code is launched to staging only.

  1. returns directly if no alteration script changes are detected
  2. pull the base branch codebase and init logto
  3. run the db alteration from the current branch
  4. run the integration tests on the base branch logto server

This PR refactors the integration test, all the shared integration steps are extracted to the latest created custom GitHub actions:

PLEASE review the above actions as well.

Testing

Happy test

test based on the PR #4616.

WX20231009-174634@2x

Failing test

Simulate the PR #4582

  • old head branch-based integration test:
image
  • new base branch-based integration test with db alteration:
image image

Checklist

  • .changeset
  • unit tests
  • integration tests
  • docs

OR

  • This PR is not applicable for the checklist

@linear
Copy link

linear bot commented Oct 9, 2023

LOG-7144 CI: Add integration for staging period

目前 staging 时的测试还未被覆盖。
staging 时,db 是最新(alteration 之后)的状态,但是代码还是旧的版本。
这个时候 db 应该兼容旧的代码,需要新增 旧代码 + 新 db 的场景的场景的测试。

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

COMPARE TO master

Total Size Diff 📉 -61 Bytes

Diff by File
Name Diff
.github/workflows/alteration-compatibility-integration-test.yml 📉 -2.21 KB
.github/workflows/integration-test.yml 📉 -2.26 KB

@github-actions github-actions bot added the size/m label Oct 9, 2023
@simeng-li simeng-li force-pushed the simeng-log-7144-ci-add-integration-for-staging-period branch from e39295b to 505f56d Compare October 9, 2023 10:13
@simeng-li simeng-li requested review from xiaoyijun, charIeszhao, a team and wangsijie and removed request for a team October 9, 2023 10:19
@simeng-li simeng-li requested review from a team October 10, 2023 02:58
- refactor the integration-test ci job using custom action
- add db alteration integration-tests
@simeng-li simeng-li force-pushed the simeng-log-7144-ci-add-integration-for-staging-period branch from 9f7b66f to 0909bc4 Compare October 16, 2023 08:04
fix the detection git diff
@simeng-li simeng-li force-pushed the simeng-log-7144-ci-add-integration-for-staging-period branch from 92b4a44 to d45d9c7 Compare October 16, 2023 08:22
should not throw error if grep statement return empty
update the action reference
update the integration test action ref
@simeng-li simeng-li merged commit 735dcb6 into master Oct 23, 2023
19 checks passed
@simeng-li simeng-li deleted the simeng-log-7144-ci-add-integration-for-staging-period branch October 23, 2023 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants