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

Release Mdpx (do not merge) #836

Draft
wants to merge 59 commits into
base: main
Choose a base branch
from
Draft
Changes from 4 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
694306d
Remove acceptance tests against the existing platform (#823)
janelletavares Oct 17, 2023
034ffd7
Add tenant subdomain to env
Oct 17, 2023
30f50b5
not a header
Oct 17, 2023
2d21d60
Update cmd/meroxa/global/global.go
janelletavares Oct 17, 2023
b455d2b
Update cmd/meroxa/root/auth/logout.go
janelletavares Oct 17, 2023
79c2e66
Merge pull request #829 from meroxa/mdpx_tenant_env
anna-cross Oct 17, 2023
2903439
Log in with basic auth client (#824)
janelletavares Oct 17, 2023
6e085f2
Remove unused code (#827)
janelletavares Oct 17, 2023
c7f5d1a
Generic functions to print tables and lists
Oct 17, 2023
53a6d79
Generate a mock basic client (#828)
janelletavares Oct 18, 2023
9287206
feedback
Oct 18, 2023
8279d97
remove debug prints, again
Oct 18, 2023
084c27e
Merge pull request #830 from meroxa/mdpx-display
anna-cross Oct 18, 2023
5db5a32
Mdpx switch apps commands (#833)
janelletavares Oct 24, 2023
8ca5aaa
refactor: apps deploy
raulb Oct 24, 2023
72a2add
Camel case specVersion
Oct 24, 2023
48beb4f
Update deploy_test.go
Oct 24, 2023
046fd42
Merge pull request #835 from meroxa/remove-env
anna-cross Oct 24, 2023
d0e1070
remove: upgrade (#837)
raulb Oct 24, 2023
dbc5221
Mdpx switch apps commands (minus deploy) (#834)
janelletavares Oct 26, 2023
cfb284f
fix: utilize right token (#841)
raulb Oct 26, 2023
7c71e0a
Draft
Oct 26, 2023
94b0fd6
Removing meroxa go and fixing small things
Oct 26, 2023
b7ede8e
do url req instead on collection req
Oct 26, 2023
7bf0bd8
fix: login (#843)
raulb Oct 27, 2023
a183474
Remove actor and fix lint
Oct 27, 2023
8ce8a81
Merge branch 'mdpx' into mdpx-remove-meroxa-go
anna-cross Oct 27, 2023
50acbf7
Update basic_client.go
Oct 27, 2023
e99df36
Update api_test.go
Oct 27, 2023
59f4fcb
Update dashboard URL to point to pocketbase dashboard
Oct 30, 2023
551c010
lint
Oct 30, 2023
a96c35b
Merge branch 'mdpx-remove-meroxa-go' into mdpx_dashboard_url
Oct 30, 2023
d29f204
Merge pull request #842 from meroxa/mdpx-remove-meroxa-go
anna-cross Oct 30, 2023
f759d0e
Merge branch 'mdpx' into mdpx_dashboard_url
Oct 30, 2023
3e36e47
Add version and language headers to describe and remove
Oct 31, 2023
e70e79b
fix tests
Oct 31, 2023
311d137
Update cmd/meroxa/root/apps/remove.go
anna-cross Oct 31, 2023
7e7d56e
Merge pull request #845 from meroxa/mdpx_dashboard_url
anna-cross Oct 31, 2023
95b9919
Merge pull request #846 from meroxa/mdpx_version_headers
anna-cross Oct 31, 2023
d58583a
Add secrets command to cli
Nov 1, 2023
446334b
Rename idORName to nameOrUUID + lint
Nov 1, 2023
756c181
linter
Nov 1, 2023
72abed0
lint
Nov 1, 2023
db35914
Update CLI document for MDPX
Nov 1, 2023
3e7ef12
cleanup and better print
Nov 2, 2023
fe74281
Remove headers from md files
Nov 2, 2023
f45fcdb
Merge pull request #847 from meroxa/mdpx_secrets
anna-cross Nov 2, 2023
db045fd
Nit
Nov 2, 2023
7ff2fd0
Merge pull request #848 from meroxa/mdpx_documentation
anna-cross Nov 2, 2023
3fab056
doc: update documentation (#854)
raulb Nov 20, 2023
2fd9cae
Remove secrets update command on CLI
Jan 16, 2024
d511027
Merge pull request #864 from meroxa/secrets_upgrade
anna-cross Jan 16, 2024
24caa7b
feat: update CLI to use turbine-core v2 (#855)
raulb Feb 21, 2024
868bf27
chore: upgrade go version to 1.22 (#869)
raulb Feb 28, 2024
44e6eb4
Only add auth token once
Mar 7, 2024
e230892
Merge pull request #872 from meroxa/deprovisioning_bug
anna-cross Mar 7, 2024
9c01ad6
Removing Turbine References and Usage
Mar 21, 2024
d10cbd3
vendor and nit
May 14, 2024
da10310
Merge pull request #889 from meroxa/mdpx_remove_turbine
anna-cross May 15, 2024
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
4 changes: 2 additions & 2 deletions cmd/meroxa/root/apps/apps.go
Original file line number Diff line number Diff line change
@@ -53,9 +53,9 @@ type Application struct {
Name string `json:"name"`
State ApplicationState `json:"state"`
Spec string `json:"spec"`
SpecVersion string `json:"spec_version"`
SpecVersion string `json:"specVersion"`
Archive string `json:"archive"`
Created time.Time `json:"createdt"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}

47 changes: 0 additions & 47 deletions cmd/meroxa/root/apps/deploy.go
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ import (
"regexp"
"strings"

"github.com/google/uuid"
"github.com/meroxa/cli/cmd/meroxa/builder"
"github.com/meroxa/cli/cmd/meroxa/global"
"github.com/meroxa/cli/cmd/meroxa/turbine"
@@ -38,26 +37,9 @@ import (
"github.com/meroxa/turbine-core/pkg/ir"
)

type environment struct {
Name string
UUID string
}

func (e *environment) nameOrUUID() string {
switch {
case e.UUID != "":
return e.UUID
case e.Name != "":
return e.Name
default:
panic("bad state: name or uuid should be present")
}
}

type Deploy struct {
flags struct {
Path string `long:"path" usage:"Path to the app directory (default is local directory)"`
Environment string `long:"env" usage:"environment (name or UUID) where application will be deployed to"`
Spec string `long:"spec" usage:"Deployment specification version to use to build and deploy the app" hidden:"true"`
SkipCollectionValidation bool `long:"skip-collection-validation" usage:"Skips unique destination collection and looping validations"` //nolint:lll
Verbose bool `long:"verbose" usage:"Prints more logging messages" hidden:"true"`
@@ -76,7 +58,6 @@ type Deploy struct {
fnName string // is this still necessary?
appTarName string
specVersion string
env *environment
gitSha string
}

@@ -349,28 +330,9 @@ func (d *Deploy) prepareAppName(ctx context.Context) string {
return appName
}

// TODO: Once builds are done much faster we should move early checks like these to the Platform API.
func (d *Deploy) validateEnvExists(ctx context.Context) error {
if _, err := d.client.CollectionRequest(ctx, "GET", "environments", d.env.nameOrUUID(), nil, nil, nil); err != nil {
if strings.Contains(err.Error(), "could not find environment") {
return fmt.Errorf("environment %q does not exist", d.flags.Environment)
}
return fmt.Errorf("unable to retrieve environment %q: %w", d.flags.Environment, err)
}
return nil
}

func (d *Deploy) assignDeploymentValues(ctx context.Context) error {
var err error

if d.flags.Environment != "" {
d.env = envFromFlag(d.flags.Environment)
err = d.validateEnvExists(ctx)
if err != nil {
return err
}
}

// Always default to the latest spec version.
d.specVersion = ir.LatestSpecVersion

@@ -470,12 +432,3 @@ func (d *Deploy) Execute(ctx context.Context) error {

return nil
}

// TODO: Reuse this everywhere it's using the environment flag. Maybe make this part of builder so it's automatic.
func envFromFlag(nameOrUUID string) *environment {
_, err := uuid.Parse(nameOrUUID)
if err != nil {
return &environment{Name: nameOrUUID}
}
return &environment{UUID: nameOrUUID}
}
9 changes: 0 additions & 9 deletions cmd/meroxa/root/apps/deploy_test.go
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ func TestDeployAppFlags(t *testing.T) {
{name: "spec", required: false, hidden: true},
{name: "skip-collection-validation", required: false, hidden: false},
{name: "verbose", required: false, hidden: true},
{name: "env", required: false, hidden: false},
}

c := builder.BuildCobraCommand(&Deploy{})
@@ -106,9 +105,6 @@ func TestValidateLanguage(t *testing.T) {
func TestGetPlatformImage(t *testing.T) {
ctx := context.Background()
logger := log.NewTestLogger()
// buildUUID := uuid.NewString()
// sourcePutURL := "http://foo.bar"
// sourceGetURL := "http://foo.bar"
appName := "my-app"
buildPath := ""
err := fmt.Errorf("nope")
@@ -117,7 +113,6 @@ func TestGetPlatformImage(t *testing.T) {
name string
meroxaClient func(*gomock.Controller) *basicMock.MockBasicClient
mockTurbineCLI func(*gomock.Controller) turbine.CLI
env string
err error
}{
{
@@ -166,9 +161,6 @@ func TestGetPlatformImage(t *testing.T) {
logger: logger,
appName: appName,
}
if tc.env != "" {
d.env = &environment{Name: tc.env}
}

err := d.getPlatformImage(ctx)
if err != nil {
@@ -216,7 +208,6 @@ func TestGetAppImage(t *testing.T) {
logger: logger,
appName: appName,
}
d.flags.Environment = "my-env"

err := d.getAppImage(ctx)
if err != nil {
2 changes: 0 additions & 2 deletions docs/cmd/md/meroxa_apps.md
Original file line number Diff line number Diff line change
@@ -24,9 +24,7 @@ Manage Turbine Data Applications
* [meroxa apps describe](meroxa_apps_describe.md) - Describe a Turbine Data Application
* [meroxa apps init](meroxa_apps_init.md) - Initialize a Turbine Data Application
* [meroxa apps list](meroxa_apps_list.md) - List Turbine Data Applications
* [meroxa apps logs](meroxa_apps_logs.md) - View relevant logs to the state of the given Turbine Data Application
* [meroxa apps open](meroxa_apps_open.md) - Open the link to a Turbine Data Application in the Dashboard
* [meroxa apps remove](meroxa_apps_remove.md) - Remove a Turbine Data Application
* [meroxa apps run](meroxa_apps_run.md) - Execute a Turbine Data Application locally
* [meroxa apps upgrade](meroxa_apps_upgrade.md) - Upgrade a Turbine Data Application

1 change: 0 additions & 1 deletion docs/cmd/md/meroxa_apps_deploy.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ meroxa apps deploy --path ./my-app
### Options

```
--env string environment (name or UUID) where application will be deployed to
-h, --help help for deploy
--path string Path to the app directory (default is local directory)
--skip-collection-validation Skips unique destination collection and looping validations
42 changes: 0 additions & 42 deletions docs/cmd/md/meroxa_apps_logs.md

This file was deleted.

34 changes: 0 additions & 34 deletions docs/cmd/md/meroxa_apps_upgrade.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/cmd/www/meroxa-apps-deploy.md
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ meroxa apps deploy --path ./my-app
### Options

```
--env string environment (name or UUID) where application will be deployed to
-h, --help help for deploy
--path string Path to the app directory (default is local directory)
--skip-collection-validation Skips unique destination collection and looping validations
49 changes: 0 additions & 49 deletions docs/cmd/www/meroxa-apps-logs.md

This file was deleted.

41 changes: 0 additions & 41 deletions docs/cmd/www/meroxa-apps-upgrade.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/cmd/www/meroxa-apps.md
Original file line number Diff line number Diff line change
@@ -31,9 +31,7 @@ Manage Turbine Data Applications
* [meroxa apps describe](/cli/cmd/meroxa-apps-describe/) - Describe a Turbine Data Application
* [meroxa apps init](/cli/cmd/meroxa-apps-init/) - Initialize a Turbine Data Application
* [meroxa apps list](/cli/cmd/meroxa-apps-list/) - List Turbine Data Applications
* [meroxa apps logs](/cli/cmd/meroxa-apps-logs/) - View relevant logs to the state of the given Turbine Data Application
* [meroxa apps open](/cli/cmd/meroxa-apps-open/) - Open the link to a Turbine Data Application in the Dashboard
* [meroxa apps remove](/cli/cmd/meroxa-apps-remove/) - Remove a Turbine Data Application
* [meroxa apps run](/cli/cmd/meroxa-apps-run/) - Execute a Turbine Data Application locally
* [meroxa apps upgrade](/cli/cmd/meroxa-apps-upgrade/) - Upgrade a Turbine Data Application

68 changes: 0 additions & 68 deletions etc/completion/meroxa.completion.sh
Original file line number Diff line number Diff line change
@@ -402,8 +402,6 @@ _meroxa_apps_deploy()
flags_with_completion=()
flags_completion=()

flags+=("--env=")
two_word_flags+=("--env")
flags+=("--help")
flags+=("-h")
flags+=("--path=")
@@ -544,36 +542,6 @@ _meroxa_apps_list()
noun_aliases=()
}

_meroxa_apps_logs()
{
last_command="meroxa_apps_logs"

command_aliases=()

commands=()

flags=()
two_word_flags=()
local_nonpersistent_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")
flags+=("--path=")
two_word_flags+=("--path")
flags+=("--cli-config-file=")
two_word_flags+=("--cli-config-file")
flags+=("--debug")
flags+=("--json")
flags+=("--timeout=")
two_word_flags+=("--timeout")

must_have_one_flag=()
must_have_one_noun=()
noun_aliases=()
}

_meroxa_apps_open()
{
last_command="meroxa_apps_open"
@@ -666,36 +634,6 @@ _meroxa_apps_run()
noun_aliases=()
}

_meroxa_apps_upgrade()
{
last_command="meroxa_apps_upgrade"

command_aliases=()

commands=()

flags=()
two_word_flags=()
local_nonpersistent_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")
flags+=("--path=")
two_word_flags+=("--path")
flags+=("--cli-config-file=")
two_word_flags+=("--cli-config-file")
flags+=("--debug")
flags+=("--json")
flags+=("--timeout=")
two_word_flags+=("--timeout")

must_have_one_flag=()
must_have_one_noun=()
noun_aliases=()
}

_meroxa_apps()
{
last_command="meroxa_apps"
@@ -712,11 +650,6 @@ _meroxa_apps()
command_aliases+=("ls")
aliashash["ls"]="list"
fi
commands+=("logs")
if [[ -z "${BASH_VERSION:-}" || "${BASH_VERSINFO[0]:-}" -gt 3 ]]; then
command_aliases+=("log")
aliashash["log"]="logs"
fi
commands+=("open")
commands+=("remove")
if [[ -z "${BASH_VERSION:-}" || "${BASH_VERSINFO[0]:-}" -gt 3 ]]; then
@@ -726,7 +659,6 @@ _meroxa_apps()
aliashash["rm"]="remove"
fi
commands+=("run")
commands+=("upgrade")

flags=()
two_word_flags=()
4 changes: 0 additions & 4 deletions etc/man/man1/meroxa-apps-deploy.1
Original file line number Diff line number Diff line change
@@ -19,10 +19,6 @@ If deployment was successful, you should expect an application you'll be able to


.SH OPTIONS
.PP
\fB--env\fP=""
environment (name or UUID) where application will be deployed to

.PP
\fB-h\fP, \fB--help\fP[=false]
help for deploy
64 changes: 0 additions & 64 deletions etc/man/man1/meroxa-apps-logs.1

This file was deleted.

60 changes: 0 additions & 60 deletions etc/man/man1/meroxa-apps-upgrade.1

This file was deleted.

2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-apps.1
Original file line number Diff line number Diff line change
@@ -42,4 +42,4 @@ Manage Turbine Data Applications

.SH SEE ALSO
.PP
\fBmeroxa(1)\fP, \fBmeroxa-apps-deploy(1)\fP, \fBmeroxa-apps-describe(1)\fP, \fBmeroxa-apps-init(1)\fP, \fBmeroxa-apps-list(1)\fP, \fBmeroxa-apps-logs(1)\fP, \fBmeroxa-apps-open(1)\fP, \fBmeroxa-apps-remove(1)\fP, \fBmeroxa-apps-run(1)\fP, \fBmeroxa-apps-upgrade(1)\fP
\fBmeroxa(1)\fP, \fBmeroxa-apps-deploy(1)\fP, \fBmeroxa-apps-describe(1)\fP, \fBmeroxa-apps-init(1)\fP, \fBmeroxa-apps-list(1)\fP, \fBmeroxa-apps-open(1)\fP, \fBmeroxa-apps-remove(1)\fP, \fBmeroxa-apps-run(1)\fP