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

atlasexec(schema/push): rename Repo to Name #99

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions atlasexec/atlas_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type (
Context *RunContext
DevURL string

Repo string // Repository name.
Name string // Name of the schema (repo) to push to.
Tag string // Tag to push the schema with
Version string // Version of the schema to push. Defaults to the current timestamp.
Description string // Description of the schema changes.
Expand Down Expand Up @@ -253,8 +253,8 @@ func (c *Client) SchemaPush(ctx context.Context, params *SchemaPushParams) (*Sch
if params.Description != "" {
args = append(args, "--desc", params.Description)
}
if params.Repo != "" {
args = append(args, params.Repo)
if params.Name != "" {
args = append(args, params.Name)
}
return firstResult(jsonDecode[SchemaPush](c.runCommand(ctx, args)))
}
Expand Down
8 changes: 4 additions & 4 deletions atlasexec/atlas_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,22 +541,22 @@ func TestSchema_Push(t *testing.T) {
{
name: "with repo",
params: &atlasexec.SchemaPushParams{
Repo: "atlas-action",
Name: "atlas-action",
},
args: "schema push --format {{ json . }} atlas-action",
},
{
name: "with repo and tag",
params: &atlasexec.SchemaPushParams{
Repo: "atlas-action",
Name: "atlas-action",
Tag: "v1.0.0",
},
args: "schema push --format {{ json . }} --tag v1.0.0 atlas-action",
},
{
name: "with repo and tag and description",
params: &atlasexec.SchemaPushParams{
Repo: "atlas-action",
Name: "atlas-action",
Tag: "v1.0.0",
Description: "release-v1",
},
Expand All @@ -565,7 +565,7 @@ func TestSchema_Push(t *testing.T) {
{
name: "with repo and tag, version and description",
params: &atlasexec.SchemaPushParams{
Repo: "atlas-action",
Name: "atlas-action",
Tag: "v1.0.0",
Version: "20240829100417",
Description: "release-v1",
Expand Down
Loading