Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project improvements #44

Merged
merged 4 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[profile.ci]
# Don't fail fast in CI to run the full test suite.
fail-fast = false
failure-output = "immediate-final"
retries = 3

[test-groups]
serial-integration = { max-threads = 1 }

[[profile.default.overrides]]
filter = 'test(db::logic::tests::test_do_ops_with_db)'
test-group = 'serial-integration'

[[profile.ci.overrides]]
filter = 'test(db::logic::tests::test_do_ops_with_db)'
test-group = 'serial-integration'
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ jobs:
- name: Create dummy web artifacts
run: mkdir -p webclients/svelte/build

- name: Run cargo test
run: cargo test ${{ matrix.features && '--features' }} ${{ matrix.features }} ${{ matrix.release && '--release' || '' }} ${{ matrix.no_default_features && '--no-default-features' || '' }} ${{ matrix.all_features && '--all-features' || '' }}
- name: Install latest nextest release
uses: taiki-e/install-action@nextest

- name: Run cargo nextest
run: cargo nextest run --profile ci ${{ matrix.features && '--features' }} ${{ matrix.features }} ${{ matrix.release && '--release' || '' }} ${{ matrix.no_default_features && '--no-default-features' || '' }} ${{ matrix.all_features && '--all-features' || '' }}
env:
RUST_BACKTRACE: full

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"

members = [
"crates/dyndns",
Expand Down
4 changes: 2 additions & 2 deletions crates/dyndns/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "digitalocean-dyndns"
version = "0.1.0"
edition = "2018"
version = "0.6.0"
edition = "2021"
description = "Dynamic DNS using DigitalOcean's DNS API"
readme = "README.md"
repository = "https://github.com/alcroito/digitalocean-dyndns"
Expand Down
4 changes: 2 additions & 2 deletions webclients/svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "ddns",
"version": "0.0.1",
"version": "0.6.0",
"private": true,
"scripts": {
"dev": "vite dev",
"apigen": "openapi-zod-client ../../crates/dyndns/generated/openapi.json -o ./src/generated/zodiusClient.ts --default-status auto-correct",
"apigen": "openapi-zod-client ../../crates/dyndns/generated/openapi.json -o ./src/generated/zodiosClient.ts --default-status auto-correct",
"build": "vite build",
"watch": "vite build -w",
"preview": "vite preview",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { api as zodiusClientDefault, createApiClient } from '../generated/zodiusClient';
import { api as zodiosClientDefault, createApiClient } from '../generated/zodiosClient';

const createClient = () => {
let zodiusClient = zodiusClientDefault;
let zodiosClient = zodiosClientDefault;
// Set in non-git-controlled .env.development file in the base dir of the web app
// pointing to http://localhost:8095/. Use for API requests when running
// vite dev.
if (import.meta.env.VITE_SERVER_API_BASE_URL) {
zodiusClient = createApiClient(import.meta.env.VITE_SERVER_API_BASE_URL);
zodiosClient = createApiClient(import.meta.env.VITE_SERVER_API_BASE_URL);
}
return zodiusClient;
return zodiosClient;
};

export const zodiusClient = createClient();
export const zodiosClient = createClient();
6 changes: 3 additions & 3 deletions webclients/svelte/src/stores/DomainRecordIpChangesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import axios from 'axios';
import { createQuery, QueryClient } from '@tanstack/svelte-query';
import { defer, delay, firstValueFrom, TimeoutError } from 'rxjs';
import type { z } from 'zod';
import type { schemas } from '../generated/zodiusClient';
import { zodiusClient } from '../services/zodius';
import type { schemas } from '../generated/zodiosClient';
import { zodiosClient } from '../services/zodios';

type DomainRecordIpChange = z.infer<typeof schemas.DomainRecordIpChange>;
type DomainRecordIpChanges = {
Expand All @@ -27,7 +27,7 @@ export class DomainRecordIpChangesStore {

private queryFn() {
const route = '/api/v1/domain_record_ip_changes';
const obs = defer(() => zodiusClient.get(route)).pipe(delay(500));
const obs = defer(() => zodiosClient.get(route)).pipe(delay(500));
const promise = firstValueFrom(obs);
return promise;
}
Expand Down