Commit Graph

11 Commits

Author SHA1 Message Date
Samir Talwar
0c6d6a67d2 Semicolons, everywhere! (#700)
If a function doesn't return a value, terminate with a semicolon.

I also moved `implicit_hasher` and `return_self_not_must_use` to the
"definitely keep disabling this" list, and installed
[Bacon](https://dystroy.org/bacon/) in the Nix shell to make it easier
to run Clippy.

V3_GIT_ORIGIN_REV_ID: ffb17b42d982518aec433a1676dba0a0dd0ad95d
2024-06-11 15:33:32 +00:00
Samir Talwar
52f82d52c1 Use "dev" as the version in development for Nix builds. (#665)
This means we can use the cache far more often.

Pull requests will also use "dev" so as to avoid rebuilding
unnecessarily. Only builds on the `main` branch and tags will set a
version (using the short Git commit hash).

V3_GIT_ORIGIN_REV_ID: 37acaec3d369eef6df6487f9612f6d2da3e3ba5a
2024-06-05 08:20:49 +00:00
Samir Talwar
a793fd479d Use Nix to build and publish Docker images. (#664)
## Description

We can use Nix to build Docker images, which gives us a few advantages:

1. the images will be cached a little better
2. aarch64 builds become easy
3. Samir is happy because the Nixification continues

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes
  in this PR have any user-facing impact. See
[changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
  `no-changelog-required` label to the PR.

### Product

_(Select all products this will be available in)_

- [x] community-edition
- [ ] cloud
<!-- product : end : DO NOT REMOVE -->

### Type

<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->

_(Select only one. In case of multiple, choose the most appropriate)_

- [ ] highlight
- [x] enhancement
- [ ] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry

<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

The v3 engine and dev-auth-webhook Docker images are now published for
both x86_64 (`amd64`) and aarch64 (`arm64`) architectures.

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

Co-Authored-By: Philip Carlsen <philip@hasura.io>
Co-Authored-By: Gil Mizrahi <gil@hasura.io>
V3_GIT_ORIGIN_REV_ID: ae6fec45dee62a21f03b5258b57d841a16542c72
2024-06-04 14:15:41 +00:00
Daniel Harvey
7dfb9d1a1f Build dev-auth-webhook Docker image with Nix (#544)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to speed up creation of all these Docker images, so this adds
`dev-auth-webhook` to the Nix flake. Functional no-op.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 384eb467b2fe7fba1644f5b4cc6224cdc043ce01
2024-05-02 14:23:28 +00:00
Samir Talwar
ca61619c06 Format everything with Prettier. (#530)
I found myself wanting to rewrite JSON files with `sed`. The problem is,
then I want to run a formatter over them afterwards, and this will
change the whole file, not just the area I touched.

I would like to propose the nuclear option in remedying this: format
everything now. This is a very large change that should make it easier
to keep files to a consistent format in the future.

I have chosen to use Prettier for this because (a) it has a useful
`--write` command and (b) it also does GraphQL, Markdown, YAML, etc.

I've elected to exclude two sets of files:

1. `crates/custom-connector/data/*.json`, because they are actually
multiple JSON objects, one per line, which Prettier cannot parse.
2. `crates/lang-graphql/tests/**/*.graphql`, because it contains invalid
GraphQL, and the parser is intended to work with strangely-formatted
GraphQL.

The main changes are standardizing whitespace, adding a newline at the
end of files, and putting JSON arrays on one line when they fit.

V3_GIT_ORIGIN_REV_ID: 92d4a535c34a3cc00721e8ddc6f17c5717e8ff76
2024-04-30 14:58:57 +00:00
Daniel Harvey
4ea88180d7 create Docker images with Nix (#507)
<!-- Thank you for submitting this PR! :) -->

## Description

In order to test things quicker, we'd like to be able to build custom
connector and friends in Nix, and then use the containers when running
tests. First step here is to be able to build Docker containers in Nix,
and add a CI job to ensure it still works.

Then we'll move onto publishing and using these images.

No-op build times:

<img width="336" alt="Screenshot 2024-04-25 at 15 53 56"
src="https://github.com/hasura/v3-engine/assets/4729125/47cbc0c5-6e54-4583-aa01-0528d4a21080">

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 8f9d609e26cdd3b0801e61fd361c241ad504dcdf
2024-04-26 08:44:04 +00:00
Samir Talwar
50ff30ae5b Nix: Switch to nixpkgs-unstable, rather than nixos-unstable. (#407)
If we're going to be unstable, let's go all the way.

This change was motivated by needing to upgrade cargo-machete to make it
work with Rust v1.77, and not having the upgrade in nixos-unstable.

V3_GIT_ORIGIN_REV_ID: 8191a376a6aeebc08787f973d58d373f8ab9ad0d
2024-03-26 15:38:33 +00:00
Daniel Harvey
af1a7a9164 update to Rust 1.77.0 (#388)
<!-- Thank you for submitting this PR! :) -->

## Description

https://github.com/rust-lang/rust/releases/tag/1.77.0

V3_GIT_ORIGIN_REV_ID: 7cdbe93ba6188b690c8dd22d86009d1a64470472
2024-03-25 08:25:10 +00:00
Samir Talwar
e931a391eb Various improvements to the Docker Compose services. (#383)
I got frustrated by the lack of useful output when services failed to
start in CI, so I thought I'd mess around.

I made some changes so that:

1. we wait for services with health checks to report as healthy,
2. we do not rebuild the engine or custom connector when they start,
3. the health checks work (apart from ndc-postgres, which will come
later), and
4. we use environment variables rather than command-line arguments where
possible.

I have also renamed the "agent" binary to "custom-connector", matching
its crate, because it was driving me a little crazy.

V3_GIT_ORIGIN_REV_ID: 8d672b0b25438b54d47368ce82cd236cfdd4e554
2024-03-21 16:49:38 +00:00
Samir Talwar
078b0d3487 Get the Nix build working. (#335)
V3_GIT_ORIGIN_REV_ID: e70e2a42b2445b4bcf4e9ee7db771b475c32d2f9
2024-03-06 17:51:17 +00:00
Daniel Harvey
353b0d1ca6 basic Nix flake for deps (#333)
Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 013207c169f31db363b7cfb072570c5b8246ba60
2024-03-06 11:39:19 +00:00