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

Migrate to sea-orm instead of Diesel #1852

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fd8ee07
cleanup attempt #1
auguwu Feb 2, 2025
07c963d
Migrated and cleaned code in `charted` and `charted-cli` packages
auguwu Feb 2, 2025
b767059
Updated `charted-types` package (95% finished)
auguwu Feb 2, 2025
f2b5183
woops
auguwu Feb 2, 2025
8a92583
[charted-types] fix compile errors
auguwu Feb 2, 2025
3520d36
chore: Remove unused dependency, advisory
spotlightishere Feb 2, 2025
3732a28
Finish porting `charted-core`
auguwu Feb 2, 2025
6dd1659
Remove devtools and `hack/` directory, work in charted-database, char…
auguwu Feb 3, 2025
9fad34e
[ci] Improve CI (hopefully it works first try :pray:)
auguwu Feb 3, 2025
968b541
[ci] Fix issues (hopefully)
auguwu Feb 3, 2025
9d1af7a
fix(deps): update rust crate libsqlite3-sys to 0.31.0
renovate-bot Feb 2, 2025
fafb798
fix(deps): update rust crate pq-sys to 0.7.0
renovate-bot Feb 2, 2025
f0176f2
cleanup attempt #1
auguwu Feb 2, 2025
1cebfca
hopefully this works?
auguwu Feb 3, 2025
cabf731
I thought using `vcpkg` for nasm would work but it's not avaliable >:(
auguwu Feb 3, 2025
233743d
Fix compile errors from Clippy
auguwu Feb 3, 2025
00c1fcc
[core] fix doctests
auguwu Feb 3, 2025
0747e6f
Fix `cargo deny` checks, update Docker distributions
auguwu Feb 3, 2025
4a57119
create entity models
auguwu Feb 6, 2025
df593ca
forgetting to add licenses to files, add configuration for databases
auguwu Feb 9, 2025
153109d
Add OpenSSL to `LD_LIBRARY_PATH`, added root configuration properties
auguwu Feb 9, 2025
4fea2c2
Add `charted_core::di` module
auguwu Feb 9, 2025
cd9184c
Add in `charted_helm_charts` package
auguwu Feb 9, 2025
66e4bb1
Work on charted-server with extractors and middleware first
auguwu Feb 9, 2025
6c83c4b
[charted-core] Remove `axum` feature in default features
auguwu Feb 9, 2025
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
8 changes: 4 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
rustflags = ["--cfg", "tokio_unstable"]

[alias]
dev = "run --release --package charted-devtools --"
internals = "run --release --package charted-internals --"
cli = "dev cli"
server = "dev server"
internals = "run --release --bin internals --"
server = "cli server"
cli-rl = "run --release --bin charted --"
cli = "run --bin charted --"
28 changes: 0 additions & 28 deletions .devcontainer/devcontainer.json

This file was deleted.

36 changes: 0 additions & 36 deletions .devcontainer/docker-compose.yml

This file was deleted.

172 changes: 81 additions & 91 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,107 +13,111 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: CI
name: CI Pipeline
on:
workflow_dispatch: {}
push:
branches:
- 'issues/gh-**'
- 'feat/**'
- main

paths-ignore:
- '.github/**'
- '.coder/**'
- '.devcontainer/**'
- '.vscode/**'
- 'assets/**'
- 'distribution/**'
- 'docs/**'
- 'scripts/**'
- '.*ignore'
- '**.md'
- renovate.json

- .envrc
- .noeldoc
- .prettierrc.json
- rustfmt.toml
- taplo.toml
- LICENSE
- renovate.json
pull_request:
types: [opened, synchronize]
branches:
- 'issues/gh-**'
- 'feat/**'
- main
paths-ignore:
- '.coder/**'
- '.devcontainer/**'
- '.vscode/**'
- 'docs/**'
- '.*ignore'
- '**.md'
- renovate.json
- LICENSE
paths:
- '**'
permissions:
contents: read
checks: write
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
ci:
name: Rust CI (${{matrix.runner == 'ubuntu-latest' && 'Linux (x86_64)' || matrix.runner == 'self-hosted' && 'Linux (arm64)' || matrix.runner == 'macos-latest' && 'macOS (x86_64)' || matrix.runner == 'macos-14-arm64' && 'macOS (M1)' || matrix.runner == 'windows-latest' && 'Windows' || 'Unknown'}}, Rust ${{matrix.rust-version}})
rust:
name: "Rust CI / ${{matrix.runner == 'ubuntu-24.04' && 'Linux (x64)' || matrix.runner == 'linux-aarch64' && 'Linux (aarch64)' || matrix.runner == 'macos-latest' && 'macOS (x64)' || matrix.runner == 'macos-14-xlarge' && 'macOS (aarch64)' || matrix.runner == 'windows-latest' && 'Windows (x64)'}}"
runs-on: ${{matrix.runner}}
strategy:
fail-fast: true
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
rust-version: [nightly]
runner:
[
ubuntu-24.04,
linux-aarch64,
macos-latest,
macos-14-xlarge,
windows-latest
]
steps:
- uses: actions/checkout@v4

# remove the `rust-toolchain.toml` since it'll be overwritten.
# Ensure that we test on the recent Nightly compiler toolchain
- run: rm ${GITHUB_WORKSPACE}/rust-toolchain.toml
shell: bash

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust-version}}
components: clippy, rustfmt

- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2

- name: Setup `VCPKG_ROOT` environment variable
if: matrix.runner == 'windows-latest'
id: vcpkg
run: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: 'Windows: Setup vcpkg'
if: ${{matrix.runner == 'windows-latest'}}
run: ./src/ci/windows/Setup-Vcpkg.ps1

- name: Setup vcpkg cache
if: matrix.runner == 'windows-latest'
- name: 'Windows: Setup vcpkg cache'
if: ${{matrix.runner == 'windows-latest'}}
uses: actions/cache@v4
with:
key: vcpkg-cache
path: |
${{steps.vcpkg.outputs.VCPKG_ROOT}}

- name: Install libraries via `vcpkg`
run: vcpkg --triplet x64-windows-static-md install openssl sqlite3 libpq
if: matrix.runner == 'windows-latest'
${{env.VCPKG_ROOT}}

# On Windows, we'll also need nasm for use with BoringSSL via aws-lc-sys.
- uses: ilammy/setup-nasm@v1
if: matrix.runner == 'windows-latest'
- name: 'Windows: Install libraries'
if: ${{matrix.runner == 'windows-latest'}}
run: ./src/ci/windows/Install-Libraries.ps1

# on macOS, `libpq` is not avaliable
- if: matrix.runner == 'macos-latest'
run: brew install postgresql
- name: 'Windows: Install `nasm` for `aws-lc-sys`'
if: ${{matrix.runner == 'windows-latest'}}
uses: ilammy/setup-nasm@v1

- uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-nextest

- run: cargo build --all-features --workspace
- run: cargo nextest run --all-features --workspace
- run: cargo test --doc --all-features --workspace
- run: cargo build --workspace --all-features
- run: cargo nextest run --workspace --all-features
- run: cargo test --doc --workspace --all-features

cargo-deny:
name: '`cargo deny`'
runs-on: ubuntu-latest
name: 'Rust / `cargo deny`'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-deny

- run: cargo deny check all

report-missing-deps:
name: Report Missing Dependencies
report-missing-dependencies:
name: 'Rust / Report Missing Dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -122,66 +126,52 @@ jobs:
tool: cargo-machete
- run: cargo machete

# we perform Cachix builds on each commit and each release, and Noel uses
# NixOS, so this is probably a must!
#
# useful for users who don't pin to a specific Git tag and pointed to `main` branch
# Perform Cachix builds on each commit (for bleeding edge cases)
# and each release (for `Noelware/nixpkgs-noelware`).
nix-build:
name: Nix Build
name: 'Nix / Build'
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install `nix` binary
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Setup Cachix
uses: cachix/cachix-action@v15
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30

# TODO(@auguwu): switch to https://nix.noelware.org,
# which uses Attic as the binary cache
# service.
# - uses: ryanccn/attic-action@v0
# with:
# endpoint: https://nix.noelware.org
# cache: noelware
# token: ${{secrets.NIX_BINARY_CACHE_TOKEN}}

- uses: cachix/cachix-action@v15
with:
name: noelware
authToken: ${{secrets.CACHIX_AUTH_TOKEN}}

- name: Build `charted` binary
- name: 'Build :: `charted`'
run: nix build .#charted

- name: Build `charted-helm-plugin` binary
- name: 'Build :: `charted-helm-plugin`'
run: nix build .#helm-plugin
clippy:
name: Clippy!
runs-on: ubuntu-latest
strategy:
matrix:
rust-version: [nightly]
name: 'Rust / Clippy'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

# remove the `rust-toolchain.toml` since it'll be overwritten.
# Ensure that we test on the recent Nightly compiler toolchain
- run: rm ${GITHUB_WORKSPACE}/rust-toolchain.toml
- uses: dtolnay/rust-toolchain@master
shell: bash

- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{matrix.rust-version}}
components: clippy, rustfmt
components: clippy

- uses: Swatinem/rust-cache@v2
- uses: auguwu/[email protected]
with:
all-features: true
check-args: --workspace --locked
token: ${{github.token}}
hadolint:
name: Hadolint [${{matrix.dockerfile}}]
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- ./distribution/charted/docker/alpine.Dockerfile
- ./distribution/charted/docker/debian.Dockerfile
- ./distribution/helm-plugin/docker/Dockerfile
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
dockerfile: ${{matrix.dockerfile}}
22 changes: 2 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -686,29 +686,11 @@ FodyWeavers.xsd
!crates/helm-plugin/src/bin/
!crates/devtools/src/bin/

!crates/helm-charts/__fixtures__/*.tgz
crates/database/data.db
!crates/helm/charts/__fixtures__/*.tgz
!nix/packages/*.nix
!hack/release/
!crates/bin/
!Cargo.lock
config.hcl
config.toml
.direnv/
data/
.env

# !server/src/routing/**/repository/releases/
# !crates/charts/tests/__fixtures__/*.tgz
# !src/charts/__fixtures__/*.tgz
# !distribution/bin/
# !scripts/publish/
# !crates/bin/
# web/.output
# !Cargo.lock
# config.hcl
# !src/bin/
# .direnv/
# .cache/
# .data/
# data/
# .env
File renamed without changes.
8 changes: 5 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"editor.formatOnPaste": true,
"rust-analyzer.check.command": "clippy",
"rust-analyzer.showUnlinkedFileNotification": false,
"rust-analyzer.cargo.extraEnv": {
// We use Tokio's unstable cfg flag so we can collect metrics
// so it is easier for us to track.
"RUSTFLAGS": "--cfg tokio_unstable"
},

// Ensure that we don't lock up `cargo check` (i.e, for `cargo expand` to debug macros)
// but this comes at the cost of duplicate artifacts, which I think we can sacrifice.
Expand All @@ -24,8 +29,5 @@
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "/.github/actions/*"
}
}
Loading
Loading