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
Show file tree
Hide file tree
Changes from all 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
81 changes: 19 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,50 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ^1.20
- name: Check out code into the Go module directory
uses: actions/checkout@v2
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Build
run: |
make build
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version: ^1.20
- uses: actions/checkout@v2
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
args: --timeout 4m0s
vet:
name: Vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Vet
run: go vet ./...
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version: ^1.20
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Generated files
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand All @@ -59,53 +66,3 @@ jobs:
make test
env:
GOPATH: /home/runner/work/cli/go
acceptance:
name: Acceptance
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Checkout Acceptance
uses: actions/checkout@v2
with:
token: ${{ secrets.MEROXA_MACHINE }}
repository: meroxa/acceptance
path: acceptance
- name: Build And Run
working-directory: ./acceptance
env:
MEROXA_AUTH_CLIENT_ID: ${{ secrets.AUTH0_ACCEPTANCE_STAGING_CLIENT_ID }}
MEROXA_AUTH_DOMAIN: ${{ secrets.AUTH0_STAGING_DOMAIN }}
MEROXA_AUTH_AUDIENCE: ${{ secrets.AUTH0_STAGING_AUDIENCE }}
MEROXA_AUTH_CLIENT_SECRET: ${{ secrets.AUTH0_ACCEPTANCE_STAGING_CLIENT_SECRET }}
MEROXA_AUTH_PASSWORD: ${{ secrets.AUTH0_PASSWORD }}
MEROXA_AUTH_USERNAME: ${{ secrets.AUTH0_USERNAME }}
MEROXA_AUTH_PASSWORD2: ${{ secrets.AUTH0_PASSWORD2 }}
MEROXA_AUTH_USERNAME2: ${{ secrets.AUTH0_USERNAME2 }}
PG_URL: ${{ secrets.TEST_DB_URL }}
PRIVATE_PG_URL: ${{ secrets.TEST_PRIVATE_PG_URL }}
MYSQL_URL: ${{ secrets.TEST_MYSQL_URL }}
SQLSERVER_URL: ${{ secrets.TEST_SQLSERVER_URL }}
MEROXA_API_URL: "https://api.staging.meroxa.io"
BASTION_PRIVATE_KEY: ${{ secrets.TEST_BASTION_PRIVATE_KEY }}
BASTION_USER: "ec2-user"
BASTION_URL: ${{ secrets.TEST_BASTION_URL }}
run: |
docker build -t meroxa/acceptance --build-arg CLI_BRANCH=$GITHUB_HEAD_REF .
docker run \
-e MEROXA_AUTH_DOMAIN=${MEROXA_AUTH_DOMAIN} \
-e MEROXA_AUTH_CLIENT_ID=${MEROXA_AUTH_CLIENT_ID} \
-e MEROXA_AUTH_CLIENT_SECRET=${MEROXA_AUTH_CLIENT_SECRET} \
-e MEROXA_AUTH_PASSWORD=${MEROXA_AUTH_PASSWORD} \
-e MEROXA_AUTH_USERNAME=${MEROXA_AUTH_USERNAME} \
-e MEROXA_AUTH_PASSWORD2=${MEROXA_AUTH_PASSWORD2} \
-e MEROXA_AUTH_USERNAME2=${MEROXA_AUTH_USERNAME2} \
-e MEROXA_AUTH_AUDIENCE=${MEROXA_AUTH_AUDIENCE} \
-e ACCEPTANCE_TEST_POSTGRES_URL=${PG_URL} \
-e ACCEPTANCE_TEST_PRIVATE_POSTGRES_URL=${PRIVATE_PG_URL} \
-e ACCEPTANCE_TEST_MYSQL_URL=${MYSQL_URL} \
-e ACCEPTANCE_TEST_SQLSERVER_URL=${SQLSERVER_URL} \
-e ACCEPTANCE_TEST_BASTION_PRIVATE_KEY="${BASTION_PRIVATE_KEY}" \
-e ACCEPTANCE_TEST_BASTION_USER=${BASTION_USER} \
-e ACCEPTANCE_TEST_BASTION_URL=${BASTION_URL} \
-e ACCEPTANCE_TEST_API_HOST=${MEROXA_API_URL} \
meroxa/acceptance -test.v
49 changes: 0 additions & 49 deletions .github/workflows/dispatch_turbine_go_dependency.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/fig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:
publish-spec:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ^1.20
- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Run make fig
run: |
make fig
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.22.x
-
name: Import GPG key
id: import_gpg
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ linters-settings:
- github.com/stretchr/testify
- github.com/withfig/autocomplete-tools/integrations/cobra
- github.com/davecgh/go-spew/spew

- github.com/pocketbase/pocketbase/tools/types
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ endif
fig:
go run gen-spec/main.go

# downgrade linter until https://github.com/golangci/golangci-lint/issues/4239 is fixed
.PHONY: lint
lint:
docker pull golangci/golangci-lint:latest
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:latest golangci-lint run --timeout 5m -v
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:v1.57.2 golangci-lint run --timeout 5m -v

.PHONY: generate
generate: mockgen-install
Expand Down
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Prerequisite Tools:

To build from source:

1. The CLI depends on [meroxa-go](github.com/meroxa/meroxa-go). To update vendoring the dependency, you'll need to run the following:
1. To update vendoring the dependency, you'll need to run the following:

```
make gomod
Expand All @@ -73,9 +73,6 @@ make gomod
make build
```

### Development Configuration
The [meroxa-dev CLI](https://github.com/meroxa/meroxa-dev#install) makes it convenient to set the necessary env vars for different dev environments.

## Release

A [goreleaser](https://github.com/goreleaser/goreleaser) GitHub Action is
Expand Down Expand Up @@ -108,6 +105,10 @@ func appendCell(cells []*simpletable.Cell, text string) []*simpletable.Cell {
^
```

## Using Meroxa CLI

To start using the Meroxa CLI, you'll need to have an existing platform user from either local or deployed mdpx instance. Meroxa CLI will prompt you for tenant url ,which should be a full url (e.g http://localhost:8090), user email and password.

## Tests

To run the test suite:
Expand All @@ -116,25 +117,13 @@ To run the test suite:
make test
```


## Shell Completion

If you want to enable shell completion manually, you can generate your own using our `meroxa completion` command.

Type `meroxa help completion` for more information, or simply take a look at our [documentation](docs/cmd/md/meroxa_completion.md).

## Development with local TurbineJS dependency

The CLI offers a mode, in which the local version of `turbine-js` is loaded by default which can be useful for developing the CLI and the JS dependency locally when contributing to this project.

You can run the cli in this mode, by adding the following environment variable into your `.envrc` at the root of this project's directory:

```bash
MEROXA_USE_LOCAL_TURBINE_JS=true
```

If you run into any `executable not found` issues, please ensure that you have cloned [turbine-js](https://github.com/meroxa/turbine-js) locally and
installed it globally via running `npm install -g .` in the turbine-js directory.

If you'd like to see this development mode extended with other dependencies or features, you can send us a feature request in our Github issues: https://github.com/meroxa/cli/issues

## Troubleshooting
Expand Down Expand Up @@ -163,4 +152,4 @@ Verify the correct setup, by running ` cat ~/.gitconfig`. You should see the fol
insteadOf = https://github.com
```

Run the `make gomod` command again, and you should see all dependencies being downloaded successfully.
Run the `make gomod` command again, and you should see all dependencies being downloaded successfully.
17 changes: 8 additions & 9 deletions cmd/meroxa/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/meroxa/cli/cmd/meroxa/global"
"github.com/meroxa/cli/config"
"github.com/meroxa/cli/log"
"github.com/meroxa/meroxa-go/pkg/meroxa"
)

type Command interface {
Expand Down Expand Up @@ -64,10 +63,10 @@ type CommandWithArgs interface {
ParseArgs([]string) error
}

type CommandWithClient interface {
type CommandWithBasicClient interface {
Command
// Client provides the meroxa client to the command.
Client(meroxa.Client)
// Client provides the basic client to the command.
BasicClient(client global.BasicClient)
}

type CommandWithConfig interface {
Expand Down Expand Up @@ -199,7 +198,7 @@ func BuildCobraCommand(c Command) *cobra.Command {

buildCommandWithAliases(cmd, c)
buildCommandWithArgs(cmd, c)
buildCommandWithClient(cmd, c)
buildCommandWithBasicClient(cmd, c)
buildCommandWithConfig(cmd, c)

// buildCommandWithConfirmWithValue needs to go before buildCommandWithExecute to make sure there's a confirmation prompt
Expand Down Expand Up @@ -253,8 +252,8 @@ func buildCommandWithArgs(cmd *cobra.Command, c Command) {
}
}

func buildCommandWithClient(cmd *cobra.Command, c Command) {
v, ok := c.(CommandWithClient)
func buildCommandWithBasicClient(cmd *cobra.Command, c Command) {
v, ok := c.(CommandWithBasicClient)
if !ok {
return
}
Expand All @@ -267,11 +266,11 @@ func buildCommandWithClient(cmd *cobra.Command, c Command) {
return err
}
}
c, err := global.NewClient()
cl, err := global.NewBasicClient()
if err != nil {
return err
}
v.Client(c)
v.BasicClient(cl)
return nil
}
}
Expand Down
Loading