Commit Graph

822 Commits

Author SHA1 Message Date
Jamil
7a27ed466c chore(ci): Use target-specific cache when cross building (#4519)
I suspect the cache is being saved from cross builds, so this PR further
isolates the cross cache per target.


https://github.com/firezone/firezone/actions/runs/8564714747/job/23471683253?pr=4517
2024-04-04 21:47:35 -07:00
Jamil
c24a291956 chore(ci): scope cache by arch too (#4512)
https://github.com/firezone/firezone/actions/runs/8558739208/job/23453931061
2024-04-04 18:07:43 +00:00
Jamil
a58dd99e9f chore(ci): Scope GH rust cache per os type (#4504)
I suspect this is a cache issue:


https://github.com/firezone/firezone/actions/runs/8549331928/job/23424473070

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-04-04 16:47:51 +00:00
Thomas Eizinger
97e6a92e39 chore(rust): remove unused dependencies (#4475)
These were all found by `cargo-udeps`.

Resolves: #4403.
2024-04-03 14:11:02 +00:00
Jamil
f73508e40d fix(gateway): Publish all platforms for Gateway, not just amd64 (#4459)
Fixes #4458
2024-04-03 00:18:30 +00:00
Reactor Scram
74a81b2a56 test(gui-client): unit test for Linux IPC (#4277)
(After GA)

This adds a unit test for the Unix domain sockets that I intend to use
for process splitting on Linux.

The length-prefixed encoding and decoding are copied from `subzone`, but
most of that code will not be re-used since it's Windows-specific and
also specific to a Chromium-like process model, which won't work for
Firezone.
2024-04-02 19:34:24 +00:00
Reactor Scram
1e4ed7bad6 refactor(ci): move DNS control method up to docker-compose.yml (#4341)
This is part of a yak shave towards CI testing of #3812 

Moving the DNS control method out of `docker-compose.yml` and up to the
integration tests themselves allows us to test these scenarios:

- `systemd-resolved`
- `etc-resolv-conf`
- `systemd-resolved` but we're in a container where that won't work, so
we should gracefully degrade to just allowing IP/CIDR resources
2024-04-02 17:11:29 +00:00
Jamil
bf7e492ac0 chore(deps): Don't create duplicate dependabot groups (#4443)
It looks like Dependabot's path search is recursive, so it was pulling
in dependencies for both the project-wide and app-wide folders.
2024-04-01 08:50:35 -07:00
Jamil
c30138b38e chore(connlib): Remove atomicwrites and tokio::fs from apple compile path (#4395)
Fixes #4377 


Manually verified by running `nm` on the resulting binaries. I'll open
another PR to handle #4393

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-29 21:01:53 +00:00
Reactor Scram
6aec8ce287 test(firezone-tunnel): create a tunnel device in unit tests during CI (#4254)
This catches two of the mutants, according to `cargo-mutants`.

~~Unfortunately since `cargo test` runs in one process, it's
all-or-nothing for sudo, this will run all unit tests as sudo.~~
(This explanation is not exactly correct, `cargo test` does run _a_
subprocess, but still, there is no way to request sudo or non-sudo
runners for specific tests, since it's just an environment variable, and
since many tests run in parallel in different threads of the same
process.)

Here it is passing in Linux:
https://github.com/firezone/firezone/actions/runs/8382799272/job/22957555987#step:5:3160

And Windows:
https://github.com/firezone/firezone/actions/runs/8382799272/job/22957558003#step:5:1006

```[tasklist]
### Before merging
- [x] Try `#[ignore]` attribute
- [x] Fail gracefully if `sudo` isn't available
```
2024-03-28 17:03:32 +00:00
Thomas Eizinger
18033eafec ci: ensure roaming between networks doesn't abort file download (#4213)
This adds an integration test that downloads a 10MB file from a server
and simulates the client roaming to another network while the download
is active.

We use a DNS resource for this to ensure it also doesn't take too long
in that case. DNS resources are what most users will be using and we
clear some internal DNS caches on connection failures. Hence, using a
DNS resource here is a somewhat roundabout way to test that we aren't
failing and re-establishing the connection but migrate it to a new
network path.
2024-03-26 05:44:59 +00:00
Jamil
251a324c9f chore(ci): Fix tauri upload asset (#4255)
Fixes tauri release builds in CI
2024-03-21 23:47:01 +00:00
Reactor Scram
e3b150cfdb ci(tauri): fix typo (#4256)
You know what I want, when I'm waiting 15-60 minutes on a CI job?

I want a stringly-typed language

I want the compiler to do

as

little

work

as

possible

If there even _is_ a compile step. Cause I love waiting and squinting at
underscores.
2024-03-21 23:00:19 +00:00
Reactor Scram
a6d0a18035 ci(windows): publish Windows Client MSI (#4251)
I think this was just a small regression from the big CI refactor last
week. `update-release-draft` doesn't exist in this file anymore.

Closes #4248
2024-03-21 21:42:07 +00:00
Jason Elie Bou Kheir
83030a155d test(android): add github action workflow step for unit tests (#4177)
Fixes #2309 

Not sure how to test the workflow itself in this PR 🤔

---------

Signed-off-by: Jason Elie Bou Kheir <5115126+jasonboukheir@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-21 16:25:13 +00:00
Reactor Scram
e05cbbe0a0 build(gui-client/linux): include an empty firezone-tunnel binary with the Tauri deb package (#4220)
I thought this was going to use `cargo-deb` but it was actually easy
with the Tauri deb bundling we already use.

```[tasklist]
### Before merging
- [x] Make sure every file in the Tauri deb is also in our deb (e.g. icons)
```
2024-03-20 14:11:41 +00:00
Reactor Scram
651ea3ae00 build(gui-client/linux): make sure debug symbols get uploaded for the Linux GUI client (#4217)
- Split up CI artifacts into "exe", "pkg", and "syms" so it's easy to
check they're being uploaded. This shouldn't affect published artifacts
- Set `strip = "none"` which seems to be necessary to get the debug
symbols in Linux, although they still end up in the exe and not the dwp
file 🤔 don't know why
- Test Linux stacktrace in CI

Stacktrace examples:
- On Linux we at least get function names, but we aren't getting line
numbers for some reason
https://github.com/firezone/firezone/actions/runs/8350493514/job/22857032124#step:10:268
- On Windows we also get line numbers, as before
https://github.com/firezone/firezone/actions/runs/8350493514/job/22857033367#step:11:351

I didn't test downloading the files and doing a stacktrace locally, but
I have batched that up for whenever I do a big manual test of the
CD-produced release artifacts:
https://github.com/firezone/firezone/issues/3887
2024-03-19 22:18:03 +00:00
Jamil
66f3781413 chore(deps): Need to bump Swift dependencies manually, Dependabot can't figure them out from Package.resolved (#4204)
Refs #4203
2024-03-19 18:42:22 +00:00
Reactor Scram
74026d8b13 build(gui-client): disable AppImage bundling (#4216)
AppImages won't work with process splitting. (#3713)

As far as I can tell, they just produce one binary. Internally they use
FUSE or something to mount a squashfs image, but that image won't be
able to hook into systemd and run with root permissions and everything.
I don't think it's practical, and Tauri's AppImage bundling doesn't have
the features for it.

Even their deb bundler doesn't have any way to specify a path for a
daemon to be installed. The sidecar feature only seems intended for the
GUI app to call, not anything else on the system.

(There is such a thing as installing AppImages, but I don't think it's
worth pursuing - We should just do debs)
2024-03-19 17:26:25 +00:00
Reactor Scram
504ff3ffca ci(tauri-client): try to enable smoke tests for Ubuntu 22.04 (#3770)
Closes #3699 if successful

Ref #3972 

I don't understand why it started working. There's at least 3
possibilities:
- Some unrelated change in the last few weeks fixed it (Maybe bumping
Tauri to 1.6.1? https://github.com/firezone/firezone/pull/3881)
- It was a bug in the Github CI runner image that they fixed
- It's an awful race condition and adding `tracing::debug!` fixed it

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-19 15:41:37 +00:00
Thomas Eizinger
8ce5e64a2c ci: add timeout to cache download from GitHub (#4207)
GitHub actions cache download sometimes gets stuck. See
https://github.com/firezone/firezone/actions/runs/8335503938/job/22811115560.
In my experience with `rust-libp2p`, this can be fixed using an explicit
timeout.

See
https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout.
2024-03-19 02:20:27 +00:00
Jamil
de687f4c59 chore(ci): Lock AzureSignTool to version 4 (#4190)
Fixes #4185
2024-03-18 13:42:24 +00:00
Andrew Dryga
f3c8c734ab feat(portal): Filtering, Fulltext Search, Pagination, Preloads (#3751)
On the domain side this PR extends `Domain.Repo` with filtering,
pagination, and ordering, along with some convention changes are
removing the code that is not needed since we have the filtering now.
This required to touch pretty much all contexts and code, but I went
through all public functions and added missing tests to make sure
nothing will be broken.

On the web side I've introduced a `<.live_table />` which is as close as
possible to being a drop-in replacement for the regular `<.table />`
(but requires to structure the LiveView module differently due to
assigns anyways). I've updated all the listing tables to use it.
2024-03-16 13:27:48 -06:00
Andrew Dryga
114696c0ba chore(infra): Split terraform files into folders and add domain to production app (#4172) 2024-03-16 11:54:06 -06:00
Andrew Dryga
a85b9ab185 chore(infra): Deploy domain app on a separate instance and enable background jobs on it (#4160)
Closes #3801
2024-03-16 08:58:20 -06:00
Jamil
194e8ae579 chore(ci): Add confirmation to hotfix (#4132)
Adds another step to give pause.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
2024-03-15 22:14:08 +00:00
Thomas Eizinger
a64c34112d ci: activate backtrace for Rust tests (#4137) 2024-03-14 20:21:14 +00:00
Thomas Eizinger
be22e99380 ci: scope Rust cache by targets to be built (#4136) 2024-03-14 01:19:18 +00:00
Jamil
63c546eb45 chore(docker): Fix docker image local builds (#4127)
Fixes an artifact leftover from the refactor.

Fixes #4122
2024-03-14 00:06:10 +00:00
Jamil
32d18abb09 chore(ci): Use explicit images for hotfix workflow (#4126)
Hotfix calls integrations tests separately, so we need to explicitly
define the images for it to use.
2024-03-13 08:12:05 -07:00
Jamil
ec4eb2583f chore(ci): Explicit empty string and use GITHUB_OUTPUT (#4125)
Image names...
2024-03-13 00:02:20 -07:00
Jamil
e55f2325bc chore(ci): fix name naming (#4124) 2024-03-12 23:36:37 -07:00
Jamil
e185a5818a chore(ci): Add workflow trigger to description (#4123)
Getting some unexpected values for `github.event_name` so adding more
logging to diagnose.
2024-03-12 23:34:17 -07:00
Jamil
1cfe2c5d4a chore(ci): use output image from build for integration tests (#4117)
In CI, images have `debug/`. In CD, they don't, so test them that way.
2024-03-13 02:58:17 +00:00
Jamil
c555167e64 chore(ci): Check github.event_name == "pull_request" before using debug image prefix (#4115) 2024-03-12 18:26:35 -07:00
Jamil
2d79f32394 chore(ci): Don't namespace release images (#4114)
Fixes a logic bug.
2024-03-12 18:16:52 -07:00
Jamil
b1871ea24d Fix typo in _deploy_production.yml (#4113) 2024-03-12 17:02:20 -07:00
Jamil
78e730e6b5 chore(ci): Fix sha typo (#4111)
workflow_dispatch doesn't allow vars
2024-03-12 16:36:15 -07:00
Jamil
574585d146 chore(ci): Add debug/ and perf/ prefix to some images (#4104)
Followup from #4100:


- Add `perf/relay` and `debug/relay` etc data plane images in
`firezone-staging`.
- The `perf` images are `debug` stage images and have tooling installed,
but use release binaries.
- The `debug` images are `debug` binaries inside `debug` images
- `firezone-prod` contains only release binaries -- these image names
haven't changed
2024-03-12 20:27:32 +00:00
Jamil
1a348b2ada chore(ci): Add setup-elixir composite action (#4067)
Pulled out of #4049
2024-03-12 19:41:06 +00:00
Jamil
eb01de0285 chore(ci): Use tool versions action to parse terraform version (#4076)
Extracted from feedback on #4049
2024-03-12 17:13:31 +00:00
Jamil
0f4348c406 chore(ci): Fix deploy staging logic bug (#4101) 2024-03-12 10:13:17 -07:00
Jamil
ef2d272f78 chore(ci): Use release binaries for performance tests (#4100)
- Don't build perf images for control plane images
- Use release binaries for performance tests
2024-03-12 16:29:33 +00:00
Jamil
2839d459a7 chore(ci): don't build tauri twice in CD (#4098)
Fixes red main.
2024-03-12 09:04:27 -07:00
Jamil
f6173faf09 chore(ci): Fix tauri upload and allow building images based on given SHA (#4092)
Opening as another PR to unblock CI. Pulled from #4085
2024-03-12 07:03:21 +00:00
Jamil
391150f0e1 chore(ci): Fix new issues in cd.yml (#4085)
Fixes some issues encountered after the merge of #4049 

- Fix performance tests to only run using base_ref and head_ref to avoid
dependence on `main`
- Fixes some typos
- Prevents a catch-22 condition where breaking compatibility meant we
wouldn't be able to deploy production
2024-03-12 02:06:19 +00:00
Jamil
6575e0ca26 chore(ci): Refactor CI to use prod images in staging and prevent accidental hotfix breakages (#4049)
- Runs release asset builds simultaneously with `deploy-staging`. Those
don't depend on each other.
- Prevents running some build workflows in CD because they're run
already in the PR and in the merge group, and the risk of semantic
conflict is negligible
- Run `release` assets in staging
- Adds `compatibility_tests`: **To successfully introduce a breaking
change in the control / data plane APIs, you must now "Merge as
Administrator"**
- Since `CI` is no longer run on `main`, caching needed to be refactored
to make sense again
- Since `CI` is no longer run on `main`, the Elixir
`migrations_and_seeds_test` had to be rewritten. This now tests
migrations using `git checkout` instead of importing `main`'s DB dump.
- Move tauri builds to its own workflow so we can trigger Linux and
Windows builds manually on an adhoc basis like we do for the Swift and
Kotlin builds
- Add a new `hotfix` workflow that will run `compatibility_tests` with
the latest published images
- Add `workflow_dispatch` to trigger `CD` manually for testing purposes
(cc @ReactorScram)


Refs #3995
2024-03-11 20:01:34 +00:00
Jamil
a689a9a2a7 chore(deps): Link Package.resolved to where dependabot should find it (#4074)
Dependabot isn't bumping our Swift packages. This is an attempt to
resolve that by linking the "lockfile" into the directory where the
associated Package.swift lives.

Unfortunately Dependabot's docs [aren't
great](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#swift)
on the subject.
2024-03-11 16:08:21 +00:00
Reactor Scram
7211e88338 feat(linux-client): generate firezone-id (device ID) automatically if it's not provided at launch (#3920)
Closes #3815 

Changes that are breaking (but these aren't in production so it should
be okay)

- Windows, renaming `device_id.json` to `firezone-id.json` to match the
rest of the code
- Linux GUI, storing the firezone-id under `/var/lib` instead of under
`$HOME`
- Linux GUI, bails out if not run with `sudo --preserve-env` by
detecting `$HOME == root` or `$USER != root`

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-08 16:13:59 +00:00
Jamil
bd7aa814d9 chore(ci): Fix dependabot paths and CI warnings (#3982)
<img width="1090" alt="Screenshot 2024-03-05 at 3 48 57 PM"
src="https://github.com/firezone/firezone/assets/167144/c7d9f0c5-f0e9-479a-917c-6225da10188c">

<img width="846" alt="Screenshot 2024-03-05 at 3 49 21 PM"
src="https://github.com/firezone/firezone/assets/167144/f4d5765f-47e0-4c7e-b399-cde1f415764d">
2024-03-06 18:44:32 +00:00