Commit Graph

16 Commits

Author SHA1 Message Date
Samir Talwar
17855bf65a make: Add make targets for formatting and linting frontend code.
This adds linting and formatting of frontend code when running `make lint`, `make format`, or any of the variations.

I am adding this because I didn't know how to check the code and so I had to wait for CI to fail, which I found irritating.

In order to make this reasonable, I factored out `make` targets for building *frontend/node_modules*, so I could depend on them.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8463
GitOrigin-RevId: 71882ec90490efbf87d428d08eaec2ae849a0a36
2023-03-23 15:16:14 +00:00
Daniel Harvey
eba0a3fb33 chore(tooling): Make command to run SQLServer repl
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8404
GitOrigin-RevId: 163ee869d436b29f3563a7ec3294f0786b32f19c
2023-03-21 09:47:13 +00:00
Daniel Harvey
52082f0911 chore(tooling): add make run-pro-server
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8260
GitOrigin-RevId: f69ce5249bdc2b606ecb574049dd98558062399e
2023-03-09 12:05:02 +00:00
Jesse Hallett
885681da9a server: commit Metadata OpenAPI spec with CI check, add Typescript client scaffolding
## Description

Adds `metadata.openapi.json` to version control. Adds a Buildkite job that verifies the spec is up-to-date on server changes, and fails the CI pipeline if not.

Adds scaffolding for a new Typescript project that consumes that OpenAPI spec, and produces Typescript types. This is adapted from the similar existing data connectors project in `dc-agents/dc-api-types/`. Generated code is *not* committed to version control. Instead there is a script to generate code on-demand at publishing time. There are plans to incorporate publishing the generated project to NPM using a forthcoming pipeline that the Console team is working on.

For the moment the Typescript project is under `metadata-api-types/typescript/`. The plan is to move the project in a future PR to the frontend sub-monorepo.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7525
GitOrigin-RevId: dc27a807e52af117636f3aa6c2c289a0be87ade1
2023-02-15 18:38:38 +00:00
Daniel Harvey
60ab8e2ae3 [tooling] make commands for building and formatting CI pipeline
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7051
GitOrigin-RevId: dca45b31608680bf57a2dd190171b2567e1fcb02
2022-11-25 15:49:06 +00:00
Samir Talwar
adca95a78d server: Use make to simplify tests-py venv generation.
Rather than a homebrewed approach, we can use `make` to figure out when
it's necessary to regenerate our venv.

This Makefile will regenerate _requirements.txt_ from
_requirements-top-level.txt_ when the latter is changed.

It will also regenerate the venv when _requirements.txt_ is changed
(i.e. changes are pulled, or it's regenerated as described above).

`make` uses file/directory timestamps to figure out what to rebuild.
This is probably more reliable than expecting people to update a version
number whenever they change a file.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5152
GitOrigin-RevId: 24b27d49bf6c4ba1d57ac38ea38ae278216c6d66
2022-07-25 20:05:49 +00:00
Samir Talwar
778b1bae2b Fun improvements to Makefiles, with the intent of re-using test-infrastructure.mk.
I intend to use the Make targets around starting and stopping backend databases in order to wrap the Python integration tests in targets.

To that end, I have:

1. Factored out test infrastructure targets into _test-infrastructure.mk_.
2. Actually run the functions from _util.sh_; previously we were just running a bash script with no explicit commands. _util.sh_ must be `source`d and then you invoke the relevant function.
3. Run `docker-compose` through Nix if possible.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5136
GitOrigin-RevId: d7a01958045a82199c969ec3f88387d7d76d254b
2022-07-22 10:57:23 +00:00
Daniel Harvey
1375a77fd7 tooling: add make ghcid commands
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5097
GitOrigin-RevId: 2463c61afbffedaaf21bdd3a014f79f1cc4b930e
2022-07-19 12:20:49 +00:00
Daniel Harvey
37fb40ddec tooling: Add make build... commands
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4824
GitOrigin-RevId: eeee7c47fb8b8160d85aee2d9d07fdf9ed14a703
2022-07-04 11:45:21 +00:00
Daniel Harvey
4cd4eda81c tooling: add test commands to Makefile
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4787
GitOrigin-RevId: 6fef3933dbc414ddc79f0f738e91e28bee4b8c4f
2022-06-20 13:34:05 +00:00
Samir Talwar
dd5198d0ba Nix: Use nixpkgs-fmt to format everything.
You can now run `nix fmt` (or `make format-changed`) to reformat Nix
files.

This is not enforced by CI.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4754
GitOrigin-RevId: a2e7cbe6c037d68ba6303278616314de60b6aa72
2022-06-20 13:02:45 +00:00
Samir Talwar
f72d8f09d9 Makefile: Run ormolu --check and shellcheck as part of linting.
In the interest of having a single command to run before committing in order to check for basic errors, I propose `make lint-changed`.

This enhances `make lint` and `make lint-changed` to run `ormolu` and `shellcheck`, in line with CI.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4727
GitOrigin-RevId: 05c860a86ce40b0f52c6aa2d333c0af23aea070e
2022-06-15 10:27:10 +00:00
Samir Talwar
ed1dc00bb8 Add Makefile targets to run hlint on all and changed files.
* `make lint-hs` will lint all files.
* `make lint-hs-changed` will lint all modified files on this branch.
* `make lint` will delegate to `make lint-hs`.
* `make lint-changed` will delegate to `make lint-hs-changed`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4720
GitOrigin-RevId: d872f5b672b1d06100cd9fdaa5e60dc8bb5cae86
2022-06-14 15:21:36 +00:00
Rakesh Emmadi
d7b6585454 server/gardening: move local hoogle setup from Makefile to bash script
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3996
GitOrigin-RevId: ace7f4c13cab6e549aedf4520334c435acac9ab1
2022-03-16 10:44:01 +00:00
Rakesh Emmadi
62304312e8 server: add Makefile targets and instructions to run local hoogle server
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3973
GitOrigin-RevId: 986955e3c74d9ec581e9cad37198cc9c1db34037
2022-03-16 06:35:13 +00:00
Robert
a206d04062 server, CI: use ormolu as a formatter for Haskell sources
### Description

- sets up a Makefile target for running ormolu to format and check source code
- updates CI to run ormolu instead of stylish-haskell (and to check instead of format actively)

Compare #1679.

Here's the plan for merging this:
1. merge this PR; at this point, all PRs will fail CI unless they have the `ignore-server-format-checks` label set
2. merge follow-up PR #2404 that does nothing but actually reformats the codebase
3. tag the merge commit as `post-ormolu` (also on `graphql-engine`, for the benefits of community contributors)
4. provide the following script to any devs in order to update their branches:
   ```
   $ git checkout my-feature-branch
   $ git merge post-ormolu^
   $ make format
   $ git commit -a -m "reformat with ormolu"
   $ git merge -s ours post-ormolu
   ```
   (I'll put this in the commit message)

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

Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
Co-authored-by: Swann Moreau <62569634+evertedsphere@users.noreply.github.com>
GitOrigin-RevId: 130f480a6d79967c8d045b7f3a6dec30b10472a7
2021-09-23 21:23:21 +00:00