graphql-engine/cli/go.mod
Kali Vara Purushotham Santhati b75ab7233e cli: fix data-race warnings
#### Issue: https://github.com/hasura/graphql-engine-mono/issues/2179

### Problem:

1. There are few warnings when tests are executed with cli if it is built with `race` flag
It is because of a race condition between stdin in migrate_delete for the prompt and stdout for other commands.

2. The integration test of the console used to behave as follows:
    ```
     - Initially there won't be any wg.adds in wait-group so the second go-routine created in console-test (integration-test)
     - It will send the interrupt signal to the channel before the server has been started
     - So practically the server won't start
    ```
3. The read and write for consoleopts.WG has been happening in different go-routines without control or lock system(reading and writing into same memory location without lock system). So there is a chance of data-race(warning for data-race while integration tests are executed)
4. Data-race errors from `promptui` package

### Solution:

1. Use `--force` flag to avoid getting the input from the prompt in `migrate_delete_test.go`
2. Introduced two fields in server and console opts to let know other go-routines whether the server has been started or not
3. To avoid data-race above which are shared b/w go-routines to know the status of servers has been operated atomically.
4. using new package https://github.com/AlecAivazis/survey

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

GitOrigin-RevId: 387eb1be74f24dda34bb3588314b5a909adac227
2021-09-07 13:34:54 +00:00

83 lines
3.9 KiB
Modula-2

module github.com/hasura/graphql-engine/cli/v2
go 1.16
require (
cloud.google.com/go v0.54.0 // indirect
github.com/AlecAivazis/survey/v2 v2.3.1
github.com/Masterminds/semver v1.5.0
github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3 // indirect
github.com/Pallinder/go-randomdata v1.2.0
github.com/ahmetb/go-linq v3.0.0+incompatible
github.com/andybalholm/cascadia v1.1.0 // indirect
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/avast/retry-go v3.0.0+incompatible
github.com/briandowns/spinner v1.8.0
github.com/cheggaaa/pb/v3 v3.0.8
github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7 // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3
github.com/disintegration/imaging v1.6.2 // indirect
github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 // indirect
github.com/fatih/color v1.10.0
github.com/gin-contrib/cors v1.3.0
github.com/gin-contrib/static v0.0.0-20191128031702-f81c604d8ac2
github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
github.com/gin-gonic/gin v1.5.0
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/goccy/go-yaml v1.8.8
github.com/gofrs/uuid v3.2.0+incompatible
github.com/google/go-cmp v0.5.5
github.com/gorilla/sessions v1.2.0 // indirect
github.com/gosimple/slug v1.9.0 // indirect
github.com/hexops/gotextdiff v1.0.3
github.com/jinzhu/gorm v1.9.11 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/kr/pretty v0.2.0 // indirect
github.com/lib/pq v1.1.1
github.com/mattn/go-colorable v0.1.8
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
github.com/microcosm-cc/bluemonday v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.1.2
github.com/olekukonko/tablewriter v0.0.5
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
github.com/opencontainers/runc v1.0.0-rc93 // indirect
github.com/ory/dockertest/v3 v3.6.3
github.com/parnurzeal/gorequest v0.2.16
github.com/pkg/errors v0.9.1
github.com/qor/admin v0.0.0-20191205023516-9032e7fec172 // indirect
github.com/qor/assetfs v0.0.0-20170713023933-ff57fdc13a14 // indirect
github.com/qor/audited v0.0.0-20171228121055-b52c9c2f0571 // indirect
github.com/qor/media v0.0.0-20191022071353-19cf289e17d4 // indirect
github.com/qor/middlewares v0.0.0-20170822143614-781378b69454 // indirect
github.com/qor/oss v0.0.0-20191031055114-aef9ba66bf76 // indirect
github.com/qor/qor v0.0.0-20191022064424-b3deff729f68 // indirect
github.com/qor/responder v0.0.0-20171031032654-b6def473574f // indirect
github.com/qor/roles v0.0.0-20171127035124-d6375609fe3e // indirect
github.com/qor/serializable_meta v0.0.0-20180510060738-5fd8542db417 // indirect
github.com/qor/session v0.0.0-20170907035918-8206b0adab70 // indirect
github.com/qor/transition v0.0.0-20190608002025-f17b56902e4b
github.com/qor/validations v0.0.0-20171228122639-f364bca61b46 // indirect
github.com/sirupsen/logrus v1.7.0
github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e
github.com/spf13/afero v1.5.1
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.7.0
github.com/subosito/gotenv v1.2.0
github.com/theplant/cldr v0.0.0-20190423050709-9f76f7ce4ee8 // indirect
github.com/theplant/htmltestingutils v0.0.0-20190423050759-0e06de7b6967 // indirect
github.com/theplant/testingutils v0.0.0-20190603093022-26d8b4d95c61 // indirect
github.com/yosssi/gohtml v0.0.0-20190915184251-7ff6f235ecaf // indirect
golang.org/x/crypto v0.0.0-20210317152858-513c2a44f670
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
moul.io/http2curl v1.0.0 // indirect
)