Skip to content

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

Merged
merged 4 commits into from
Mar 26, 2025

Conversation

giautm
Copy link
Member

@giautm giautm commented Mar 26, 2025

  • atlasaction: ensure files are in the right order
  • atlasaction: refactor logic exec and change default message

Copy link

github-actions bot commented Mar 26, 2025

atlas migrate lint on atlasaction/testdata/migrations

Status Step Result
No migration files detected  
ERD and visual diff generated View Visualization
No issues found View Report
Read the full linting report on Atlas Cloud

Copy link

github-actions bot commented Mar 26, 2025

Atlas detected changes to the desired schema

Migration 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

Status Step Result
Detect schema changes3 new statements detected
No issues found

📝 Steps to edit this migration plan

1. 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 pr-366-R1cGcSfo in your editor and modify it as needed. Note that the result of the plan should align
the database with the desired state. Otherwise, Atlas will report a schema drift.

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 schema/plan action to update this comment:

gh run rerun 14089735265

@giautm giautm changed the title g/rebase test atlasaction: refactor logic exec and change default merge message Mar 26, 2025
@@ -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)
Copy link
Member Author

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\]'
Copy link
Member Author

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.

@giautm giautm force-pushed the g/rebase-test branch 2 times, most recently from f81e899 to 2ee796b Compare March 26, 2025 17:26
Copy link
Member

@ronenlu ronenlu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testscript King

@giautm giautm merged commit ad4c76f into master Mar 26, 2025
23 checks passed
@giautm giautm deleted the g/rebase-test branch March 26, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants