Commit Graph

26 Commits

Author SHA1 Message Date
Rikin Kachhia
50a5462857 cli: improve log messages to highlight database names
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7363
GitOrigin-RevId: 2b58511c374ee4d93a202e23c87c48b54ec363a6
2023-01-09 08:03:13 +00:00
Mohd Bilal
8d18a55212 cli: move AddDatabaseToHasura to testutil package
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6069
GitOrigin-RevId: f7a3b98685c16fec613719eaa05024cd3c9cd3d4
2022-09-27 11:16:22 +00:00
Kali Vara Purushotham Santhati
f0bef2b482 cli: add All option for migrate sub-commands (apply, delete and status) and seed apply command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2509
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 03ee878072b58c6dc7f43af9d26d30a5594d9a50
2021-12-23 15:59:56 +00:00
Aravind K P
bea2855b88 cli: support request_transforms in actions metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2738
GitOrigin-RevId: b125043dbb9321aa8319a6dcd6e1cd6a21f4dfe1
2021-11-03 06:38:48 +00:00
Kali Vara Purushotham Santhati
ffce0d266b cli: non zero exit code if any of the database migrations aren't applied
Issue: https://github.com/hasura/graphql-engine/issues/7499

Problem: cli doesn't exit if `migrate apply --all-databases` fail on 1 or more databases

Solution: Store the names of the databases for which it failed and return
```
operation failed on : <database1>,<database2>,etc
```

https://github.com/hasura/graphql-engine-mono/pull/2305

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 8a30bdcc24de8a204320b00e5ea9d593a6293ad4
2021-09-23 06:50:25 +00:00
Kali Vara Purushotham Santhati
40c3d08d4a cli: migrate apply progress bar improvements
https://github.com/hasura/graphql-engine-mono/pull/2356

GitOrigin-RevId: 181db6e14ffd08083a1ffc97bf2e0e578f3da0fc
2021-09-22 12:53:43 +00:00
Kali Vara Purushotham Santhati
54e0e0264b cli: make progress bar render properly on all emulators and add progress bar-logs flag to get logs on CI
Issue: https://github.com/hasura/graphql-engine/issues/4795

Problem:
- Hasura CLI displays many lines of progress bar logs in CI which is not needed by many users ( not needed as default behaviour)
- The progress bar won't render properly on all the terminal emulators

Solution:
 - [x] change the default behaviour of the progress bar to display it only in terminal mode
 - [x] add new flag `progressbar-logs` which sets the width of progress bar to render
 - [x] hard set the terminal value as true so that the return symbol will be carriage return

https://github.com/hasura/graphql-engine-mono/pull/2312

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 0efe141050d0804c679cec5fdf2ac4d49a16d78d
2021-09-14 14:28:52 +00:00
Kali Vara Purushotham Santhati
b50df8a24b cli: add progress bar to migrate apply
https://github.com/hasura/graphql-engine-mono/pull/1673

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 59b8258557b2769853d0ca64032f453780a3cd7e
2021-08-31 09:57:32 +00:00
Kali Vara Purushotham Santhati
4d7aa0e105 cli: fix query endpoint construction
closes https://github.com/hasura/graphql-engine/issues/7196

https://github.com/hasura/graphql-engine-mono/pull/2025

GitOrigin-RevId: ab7c765d4de710dd08f48dc1bfb94eb606ac5d3f
2021-08-09 08:41:16 +00:00
Kali Vara Purushotham Santhati
ca567bf8cb cli: enhance e2e tests
- actions use-codegen
    - Assert if starter kit files are created
- metadata apply
    - Assert server metadata after apply
    - assert that --dry-run flag will not modify metadata on server
- metadata clear
    - Assert with server metadata that operation was successful.
- metadata inconsistency drop
    - Assert with server metadata that operation was successful.
- metadata inconsistency status
    - Assert for all possible states
- metadata reload
    - Assert effect of operation with server
- migrate and seed subcommands
    - Add tests for MSSQL sources
    - Structure tests in such a way that it’s easy to add tests for new sources

https://github.com/hasura/graphql-engine-mono/pull/1693

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: fcdbb806d105978a07487a40f7fa6e16b3ab8816
2021-07-28 06:45:03 +00:00
Kali Vara Purushotham Santhati
a924720a3a cli: add skip-execution support for up and down flags in migrate apply
https://github.com/hasura/graphql-engine-mono/pull/1510

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 9f7b271bda08ecd156a6220e830063bbb36a4b36
2021-06-21 15:57:41 +00:00
Aravind K P
4517478ccc cli: add support for citus sources
https://github.com/hasura/graphql-engine-mono/pull/1247

GitOrigin-RevId: 8383a37f71a4d45fe01c002eb229102f0dd38e9a
2021-06-21 14:35:00 +00:00
Aravind K P
3136ffad1b cli: update go.mod
>

### Description
Update `go.mod` to allow other packages to import [v2.0.0 versions](https://blog.golang.org/v2-go-modules).

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] CLI

https://github.com/hasura/graphql-engine-mono/pull/1584

GitOrigin-RevId: a5d17ad20289d1cd7217763f56ef3ba6552d69c4
2021-06-16 11:45:07 +00:00
Aravind K P
d8198a8bad cli,ci: testsuite enhancements
- remove `HASURA_TEST_CLI_HGE_DOCKER_TAG` & `HASURA_TEST_CLI_HGE_DOCKER_REPO` env variables
- add `HASURA_TEST_CLI_HGE_DOCKER_IMAGE` environment variable to configure hge image used in tests
- add template test project directories
- add helper functions to manipulate the template projects in individual tests
- add config v2 tests

Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
GitOrigin-RevId: 009a74c042861ff0a8dec2b06002e55de3a8a629
2021-06-03 13:27:24 +00:00
Aravind K P
ea6a2c9a14 cli: config v3 update script improvements
GitOrigin-RevId: cbd80af1334916e6d5af54a925a14b3849034646
2021-05-28 06:05:33 +00:00
Aravind K P
9dfed5da57 cli: fix applying migrations in a different environment after config v3 update
GitOrigin-RevId: 2f5d554dba50da1d45ea9689afca07f4d0f2c1e5
2021-05-17 15:20:08 +00:00
Kali Vara Purushotham Santhati
489835eb36 cli: metadata apply,export enhancements
- modified the `dry-run` flag of metadata apply command.
- added new flag `o` which takes "json" or "yaml" as parameters for metadata apply command.
- added new flag `o` which takes "json" or "yaml" as parameters for metadata export command. It outputs the metadata from server to stdout in form of  json or yaml and won't change the project's metadata.
- added deprecation warnings for `--from-file` flag
- added info message for describing change of behavior of `--dry-run` flag
- v3 metadata objects like `rest_endpoints` was also added to list of metadata objects in config v2 (fix)
- the order in which metadata objects are appended to metadata objects list matter when using `--dry-run` flag, refactored this order to match server metadata.
- `metadata apply` command can now accept json/yaml metadata from io pipe
- config v3 `metadata apply` didn't show any information to user when applied metadata is inconsistent, this is addressed.
- removed `github.com/ghodss/yaml` dependency from repo
- version metadata object was added twice during intialization (fix)

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 2316f519eb40645efd86ffee2a85d3c90543ec17
2021-05-14 19:09:59 +00:00
Kali Vara Purushotham Santhati
379b812674 cli: add e2e tests for metadata and migrate commands
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: d63e0452fdb97a8f6c4e921467fc2a1de50639a1
2021-04-05 14:01:35 +00:00
Aravind Shankar
bb63d7e60e
cli: allow managing actions (#3859)
Co-authored-by: Rishichandra Wawhal <rishichandra.wawhal@gmail.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Aravind <aravindkp@outlook.in>
Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
Co-authored-by: Shahidh K Muhammed <muhammedshahid.k@gmail.com>
2020-02-24 21:44:46 +05:30
Aravind Shankar
5f02ebdefa added feedback on migration commands (close #1410) (#1931) 2019-04-03 16:59:58 +05:30
nizar-m
f83a8e591f rename access-key to admin-secret (close #1347) (#1540)
Rename the admin secret key header used to access GraphQL engine from X-Hasura-Access-Key to X-Hasura-Admin-Secret.

Server CLI and console all support the older flag but marks it as deprecated.
2019-02-14 15:07:47 +05:30
Aravind Shankar
ea9b187e7c update tests to use access key (close #113) (#296)
Closes #113
2018-08-30 21:24:12 +05:30
Aravind Shankar
1bff452cb4 handle server endpoints that contains a url path (#64) 2018-07-09 19:17:38 +05:30
Aravind Shankar
260d565e6e cli: tests for metadata commands (#18)
* [cli] added urlPrefix, consoleMode

* [cli] fix: down=all should throw error if down migration is missing

* [cli] added tests for metadata
2018-06-29 15:32:33 +05:30
shahidhk
c0bf346d60 [cli] fix tests 2018-06-28 14:14:01 +05:30
Aravind Shankar
048c067fa1 [cli] add tests for migrate commands (#9) 2018-06-28 14:06:57 +05:30