-
Notifications
You must be signed in to change notification settings - Fork 7
atlasaction: refactor logic exec and change default merge message #366
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
Conversation
giautm
commented
Mar 26, 2025
- atlasaction: ensure files are in the right order
- atlasaction: refactor logic exec and change default message
|
Atlas detected changes to the desired schemaMigration Plan (View on Atlas Cloud)-- Create "t1" table
CREATE TABLE `t1` (
`c1` integer NOT NULL
);
-- Create "t2" table
CREATE TABLE `t2` (
`c1` integer NOT NULL
);
-- Create "t3" table
CREATE TABLE `t3` (
`c1` integer NOT NULL,
`c2` integer NOT NULL
); Atlas lint results
📝 Steps to edit this migration plan1. Run the following command to pull the generated plan to your local workstation: atlas schema plan pull --url "atlas://atlas-action/plans/pr-366-R1cGcSfo" > pr-366-R1cGcSfo.plan.hcl 2. Open 3. Push the updated plan to the registry using the following command: atlas schema plan push --pending --file pr-366-R1cGcSfo.plan.hcl 4. Re-trigger the gh run rerun 14089735265 |
atlasaction/action_test.go
Outdated
@@ -998,7 +998,7 @@ func TestMigrateAutorebase(t *testing.T) { | |||
require.Equal(t, []string{"merge", "--no-ff", "origin/rebase-branch"}, mockExec.ran[5].args) | |||
require.Equal(t, []string{"diff", "--name-only", "--diff-filter=U"}, mockExec.ran[6].args) | |||
require.Equal(t, []string{"add", "testdata/need_rebase"}, mockExec.ran[7].args) | |||
require.Equal(t, []string{"commit", "-m", "Rebase migrations in testdata/need_rebase"}, mockExec.ran[8].args) | |||
require.Equal(t, []string{"commit", "-m", "testdata/need_rebase: rebase migration files"}, mockExec.ran[8].args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testdata/need_rebase: rebase migration files
This is our format for commits
|
||
# Ensure files are in the right order | ||
hashFile ./migrations/atlas.sum | ||
stdout '\[\d{14}_v1\.sql \d{14}_v2\.sql \d{14}_v3\.sql\]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need ensure this order correctly, if not. It will causes incident on the user database.
f81e899
to
2ee796b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testscript King