-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Rewrite in Rust & use Nix to build Docker images #303
Merged
Merged
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
45403e9
initial rewrite in rust & moderation commands
getchoo e928eb6
feat: add nix package, module, and container
getchoo 65fc5d5
ci: add clippy/rustfmt checks
getchoo a26a2fd
ci: add nix workflows
getchoo 4b80ec7
ci: build docker images with nix
getchoo 358df91
feat: reintroduce eta
TheKodeToad a8eb4a2
chore: deprecate modrinth command
getchoo 30cc4a6
feat: reintroduce tag command
getchoo 368b5e0
feat: delete messages on ❌ again
getchoo 604a81f
feat: reintroduce support onboarding
getchoo 640409f
feat: reintroduce message link embeds
getchoo 4bf3136
fix: don't filter out tags in nix build
getchoo 1c168bd
fix: use regex for eta again
getchoo 5b16c14
feat: set presence info on ready again
getchoo 542ecf6
chore: add RUST_LOG to .env.example
getchoo 6e33299
feat: reintroduce ping command
getchoo 8bad9d9
feat: add descriptions to commands & arguments
getchoo 640690d
refactor: use unwrap_or_default() for kick/ban reason
TheKodeToad 95fe620
chore: remove tag aliases
TheKodeToad f955cbb
feat: reintroduce PK support
getchoo 55ccfe4
fix: use camelCase for MinecraftPackageJson
TheKodeToad 174d935
fix: do not
TheKodeToad 20e2dbb
refactor moderation; change prefix to `r`
TheKodeToad ed496f5
chore: ignore .idea
TheKodeToad 78c8aa7
refactor: create ModAction struct
getchoo 8376c45
feat: flesh out storage object
getchoo 7e96bce
feat: add message logger
getchoo 026d4cb
rory: handle errors from api
getchoo c6f4295
feat: log analysis
TheKodeToad 2067697
feat: LWJGL 2 & Java 9, Pre 1.12 native transport & Java 9 issues
TheKodeToad a86bbfe
analyze_logs: detect outdated launchers
getchoo bb52188
deps: update cargo and flake lockfiles
getchoo 3e992bf
actions: update DeterminateSystems/nix-installer-action
getchoo 885e28f
refactor framework setup
getchoo 9ae8b98
feat: cleanly shutdown on ctrl+c & sigterm
getchoo 3e3be2a
feat: better handle errors during setup
getchoo 9dce57f
moderation: dm user before taking action
getchoo e0fea8d
refactor: use User over Member in moderation commands
getchoo f2979d4
Goodbye moderation
TheKodeToad f0550dd
style: use tabs over spaces
getchoo f2a3582
nix/deployment: pre-select system in crossPkgsFor
getchoo 48c2dba
chore: cleanup and bump workflow actions
getchoo 203ba11
fix: compilation on windows
getchoo 7252ced
refactor!: use poise 0.6.1
getchoo 2acb319
fix(storage): set expiry for launcher version key
getchoo 72e171b
chore: cleanup unused config properties
getchoo 2b3d81c
refactor: better scope eta messages const
getchoo a4abdd7
refactor: harden clippy lints
getchoo fafa0bf
refactor: don't use re-exports of eyre & owo-colors
getchoo f4fa737
refactor: `ok_or_else()` -> `ok_or_eyre()`
getchoo 24c8406
chore: cleanup + update nix flake
getchoo 46fd026
chore: cleanup docker & nix workflows
getchoo 651f14d
storage: make constructors more idiomatic
getchoo 915ef54
log more actions + tidy up things
getchoo cd1e322
support_onboard: check if bot has already joined thread
getchoo 1ea0867
ci: automerge dependabot PRs
getchoo 9d0c022
Many fixes and tweaks
TheKodeToad af9938a
handlers::event: improve tracing
getchoo 6bd5db7
utils::resolve_message: use perms from behind pk proxy
getchoo 3c4cf67
nix: `naersk`/`fenix` -> `rustPlatform`/`rust-overlay`
getchoo e847ea0
api: use `error_for_status_ref()`
getchoo b63ecde
commands: tidy up help & joke
getchoo 827b5a4
analyze_logs: introduce LogProvider trait
getchoo a9a63f3
treewide: allow for running w/o storage
getchoo 4e11bd2
analyze_logs: fix 0x0 regex
getchoo 9f82337
nix: use correct env var for redis url
getchoo 239928a
crates: bump octocrab, redis, & reqwest
getchoo 59bf429
feat: add /set_welcome command
getchoo a41a84f
say: use channel_id, only use prefix command
getchoo 90387c5
once_cell -> std
getchoo b161a1a
drop redis-macros
getchoo 29ed728
drop rand
getchoo 1ff95de
make sure to borrow in getters
getchoo a3014f2
consts: store colors as hex codes in struct
getchoo a2106ca
set_welcome: bulk delete messages
getchoo 9dfc3b2
set_welcome: wire up role interaction
getchoo 0b0779f
clean up
getchoo 5cfb079
nix: improve RUSTFLAGS + add overlay
getchoo bdce1f4
nix: use toolchain from refraction package
getchoo da95309
nix: update flake.lock
getchoo dfa4d66
ci: update actions
getchoo a8d6a2b
nix: use self'.packages as a default in module
getchoo 94b12a1
remove reactions from messages older than n days
getchoo 4795e15
block_reaction: log old reactions
getchoo 3503dda
block_reaction: avoid rate limits
getchoo 921540e
nix: move dev outputs to subflake
getchoo 84a7cfe
use http client from context
getchoo d25776d
Revert "block_reaction: avoid rate limits"
Scrumplex a512102
Revert "block_reaction: log old reactions"
Scrumplex ca7bacb
Revert "remove reactions from messages older than n days"
Scrumplex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
use flake | ||
if has nix_direnv_version; then | ||
use flake ./nix/dev | ||
fi | ||
|
||
dotenv_if_exists |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Auto-merge Dependabot | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
automerge: | ||
name: Check and merge PR | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
if: github.actor == 'dependabot[bot]' | ||
|
||
steps: | ||
- uses: dependabot/fetch-metadata@v2 | ||
id: metadata | ||
with: | ||
github-token: ${{ github.token }} | ||
|
||
# auto merge minor releases | ||
- name: Enable auto-merge | ||
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | ||
run: gh pr merge --auto --rebase "$PR" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
PR: ${{ github.event.pull_request.html_url }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Check | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
|
||
jobs: | ||
rustfmt: | ||
name: Run rustfmt | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run rustfmt | ||
run: cargo fmt --all -- --check | ||
|
||
clippy: | ||
name: Run Clippy scan | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
security-events: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install SARIF tools | ||
run: cargo install clippy-sarif sarif-fmt | ||
|
||
- name: Fetch Cargo deps | ||
run: cargo fetch --locked | ||
|
||
- name: Run Clippy | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
|
||
cargo clippy \ | ||
--all-features \ | ||
--all-targets \ | ||
--message-format=json \ | ||
| clippy-sarif | tee /tmp/clippy.sarif | sarif-fmt | ||
|
||
- name: Upload results | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: /tmp/clippy.sarif | ||
wait-for-processing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Nix | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v10 | ||
|
||
- name: Setup Nix cache | ||
uses: DeterminateSystems/magic-nix-cache-action@v4 | ||
|
||
- name: Build refraction | ||
run: nix build --fallback --print-build-logs | ||
|
||
check: | ||
name: Check flake | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v10 | ||
|
||
- name: Setup Nix cache | ||
uses: DeterminateSystems/magic-nix-cache-action@v4 | ||
|
||
- name: Run checks | ||
run: | | ||
cd ./nix/dev | ||
nix flake check --print-build-logs --show-trace |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: podman might be a better choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥸