这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jberryman
Copy link
Collaborator

@jberryman jberryman commented Jul 15, 2019

NOTE: after rebasing on master two tests fail with "x-hasura-json-required-keys" header is expected but not found. @rakeshkky knows more about this


At the moment we can...

...run tests in isolation, generating coverage report:

$ dev.sh test

Launch a postgres container with useful dev defaults, with PostGIS,
cleaning up afterwards:

$ dev.sh postgres

Build and launch graphql-engine in dev mode, connecting with a
postgres launched above

$ dev.sh graphql-engine

@jberryman jberryman requested review from 0x777 and shahidhk as code owners July 15, 2019 16:32
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @jberryman, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible. 🕐

Stay awesome! 😎

@CLAassistant
Copy link

CLAassistant commented Jul 15, 2019

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Jul 15, 2019

Deploy preview for hasura-docs ready!

Built with commit a5a0763

https://deploy-preview-2547--hasura-docs.netlify.com

@jberryman jberryman force-pushed the dev-scripts-and-doc-tweaks branch from a1b8018 to 615dee1 Compare July 15, 2019 17:07
@hasura-bot
Copy link
Contributor

Review app for commit 615dee1 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-615dee1c

@hasura-bot
Copy link
Contributor

Review app for commit 5279909 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-5279909e

@jberryman jberryman force-pushed the dev-scripts-and-doc-tweaks branch from 5279909 to f510081 Compare July 15, 2019 17:55
@mnlbox
Copy link
Contributor

mnlbox commented Jul 16, 2019

Maybe related: #2255

@jberryman
Copy link
Collaborator Author

jberryman commented Jul 17, 2019

TODO

  • tests crash mysteriously when no internet connection
  • 2 errors when running locally
  • incorporate pgdump functionality above
  • fix all warnings and Werror, since these make the output very annoying in terminal
  • make sure code coverage is working

@jberryman jberryman force-pushed the dev-scripts-and-doc-tweaks branch from f510081 to 899a42c Compare July 23, 2019 09:37
@jberryman
Copy link
Collaborator Author

Punting on incorporating pgdump functionality for now.
@rakeshkky can repro the strange "x-hasura-json-required-keys" errors so punting on that for this PR (i.e. the problem doesn't seem to be the environment set up in these scripts).

This is ready for review (i.e. please try it out and let me know if it works) . @lexi-lambda if you have time to check it on mac that would be awesome as well.

@jberryman jberryman changed the title WIP: Add local development swiss army knife script scripts/dev.sh Add local development swiss army knife script scripts/dev.sh Jul 23, 2019
@hasura-bot
Copy link
Contributor

Review app for commit 899a42c deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-899a42c3

@jberryman
Copy link
Collaborator Author

Off topic, but: @rakeshkky I'm noticing that those two tests mentioned above seem to pass consistently when I run graphql-engine with -N1 so perhaps a race condition of some sort

Copy link
Contributor

@lexi-lambda lexi-lambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve left a few comments, but this looks generally good to me. It does raise a couple general questions for me, though:

  1. We have a Makefile in server/, which seems to do a handful of things. This script clearly does things the Makefile does not, and vice versa, but it seems a little confusing to have both unless they have more clearly-defined roles.

  2. This adds a lot of bash code, and I’m generally of the opinion that the less bash in a project the better. I do think this kind of tooling is useful, and I also recognize that it’s not really clear if there’s a technology that can serve this purpose better, so maybe it’s fine. It just gives me pause.

  3. From the broader POV, this is an opinionated script, which is good: I like tools that have opinions. The trouble is that I now have a workflow that works for me, and it makes some different choices: I run a non-dockerized postgres instance, for example. That’s not inherently a problem, since obviously nobody is forced to use this script, but I imagine other people might be in similar positions. I find these kinds of things (a) benefit generally from network effects (i.e. the more people using them the more they are improved) and (b) have a tendency to bitrot if they aren’t being used, since they aren’t otherwise a part of the build or test process.

    I guess what I’m saying is: I’m happy to add this as-is, since I don’t think there’s much harm in it. But there’s probably a broader conversation to be had about what individual people’s workflows are like so we can maybe get more people using some more unified dev tooling like this.

@hasura-bot
Copy link
Contributor

Review app for commit 7bd3021 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-7bd3021c

@jberryman
Copy link
Collaborator Author

Thanks for the review @lexi-lambda ! Would you mind running both dev.sh postgres and dev.sh graphql-engine and dev.sh test once again on your mac? If it seems alright I'll squash and rebase again and maybe we can close this out.

I definitely understand your concerns above. The main motivators here were:

  • there has been no accurately documented way to run graphql-engine; the script is somewhat to serve the needs of documentation
  • document some tricks / existing knowledge in tooling, and produce something that works for me

re. bash: I think there's little complexity here that isn't inherent to setting up a basically functioning environment and dev workflow. But i basically agree, and certainly the script will get more complex.

re. 3: yeah I fully expect to be fixing this when stuff breaks it :P . If it gets some buy-in I would like to add it to the tests, possibly replacing some existing scripts.

I certainly wouldn't want to force other folks to change their workflow, although I'd love to benefit from the knowledge other people have if this script can be adapted/improved to e.g. support things you like about your workflow.

@hasura-bot
Copy link
Contributor

Review app for commit 66a5119 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-66a51196

At the moment we can...

...run tests in isolation, generating coverage report:

    $ dev.sh test

You can pass args to pytest as well. e.g. to run a specific test:

    $ dev.sh test -k "test_jsonb_has_all"

Launch a postgres container with useful dev defaults, with PostGIS,
cleaning up afterwards:

    $ dev.sh postgres

Build and launch graphql-engine in dev mode, connecting with a
`postgres` launched above

    $ dev.sh graphql-engine
These are assets forked from https://github.com/tibbe/ekg at revision fe5e5a1e67
Only monitor.js was modified slightly to take a local port from the URL
fragment.

I think we should feel free to continue modifying this, or replace with
our own tooling later on.
@jberryman jberryman force-pushed the dev-scripts-and-doc-tweaks branch from 66a5119 to 24409c7 Compare July 26, 2019 05:23
@hasura-bot
Copy link
Contributor

Review app for commit 24409c7 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-24409c7c

I found this default a super annoying time waster.
@hasura-bot
Copy link
Contributor

Review app for commit 3e2e143 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-3e2e1435

Copy link
Contributor

@lexi-lambda lexi-lambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. My previous general comments still stand, but the implementation looks good as far as I can tell, and it all seems to work fine on my (macOS) machine.

@jberryman
Copy link
Collaborator Author

Thanks, I guess it needs approval from those three other folks? Merge without squashing please

Copy link
Member

@rakeshkky rakeshkky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@0x777 0x777 removed their request for review August 6, 2019 09:42
Copy link

@rikinsk-zz rikinsk-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved console change

@hasura-bot
Copy link
Contributor

Review app for commit a5a0763 deployed to Heroku: https://hge-ci-pull-2547.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2547-a5a07634

@0x777 0x777 merged commit 6a649c2 into hasura:master Aug 7, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-2547.herokuapp.com is deleted

@jberryman jberryman deleted the dev-scripts-and-doc-tweaks branch August 7, 2019 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants