Skip to content

Commit 347d950

Browse files
authored
Follow rust template (#37)
* feat: add rust-template components - Add CONTRIBUTING.md with contribution guidelines - Add SECURITY.md with security reporting policy - Add GitHub issue templates (bug report, feature request) - Add pull request template - Add Dependabot configuration for automated dependency updates - Add .taplo.toml for TOML formatting configuration * feat: add VS Code configuration for format on save - Add workspace-level VS Code settings with format on save enabled - Configure language-specific formatters (Rust, TypeScript, JSON, TOML, YAML) - Add recommended extensions for consistent development environment - Enable code actions on save (fix all, organize imports) * feat: add Prettier configuration for frontend * style: format frontend code with Prettier * feat: enhance justfile with additional commands * style: format TOML files with taplo * feat: improve CI based on rust-template * chore: add MIT/Apache dual license * chore: add CODEOWNERS
1 parent 73c38de commit 347d950

50 files changed

Lines changed: 1800 additions & 1155 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
* @krsnapaudel # fallback
2+
3+
# Bookkeeping
4+
*.toml @krsnapaudel
5+
README.md @krsnapaudel
6+
.vscode/ @krsnapaudel
7+
.editorconfig @krsnapaudel
8+
**/Cargo.toml @krsnapaudel
9+
**/Cargo.lock @krsnapaudel
10+
**/justfile @krsnapaudel
11+
**/LICENSE* @krsnapaudel
12+
**/.gitignore @krsnapaudel
13+
**/.prettierrc @krsnapaudel
14+
**/.prettierignore @krsnapaudel
15+
16+
# Modules
17+
backend/src/main.rs @purusang
18+
backend/src/network/* @krsnapaudel @purusang
19+
backend/src/bridge/* @krsnapaudel
20+
backend/src/utils/* @krsnapaudel @purusang
21+
frontend/* @krsnapaudel @purusang
22+
23+
# CI/CD
24+
/.github/ @krsnapaudel
25+
.github/workflows/cd.yml @krsnapaudel @purusang
26+
27+
# Docker
28+
*.Dockerfile @krsnapaudel @purusang
29+
docker-compose.yml @krsnapaudel @purusang
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Environment:**
27+
- OS: [e.g. macOS, Ubuntu]
28+
- Browser: [e.g. chrome, safari]
29+
- Version: [e.g. 22]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Rust
4+
- package-ecosystem: "cargo"
5+
directory: "/backend"
6+
schedule:
7+
interval: "monthly"
8+
open-pull-requests-limit: 10
9+
10+
# Enable version updates for GitHub Actions
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "monthly"
15+
open-pull-requests-limit: 10
16+
17+
# Enable version updates for npm
18+
- package-ecosystem: "npm"
19+
directory: "/frontend"
20+
schedule:
21+
interval: "monthly"
22+
open-pull-requests-limit: 10

.github/pull_request_template.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
## How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
## Checklist:
24+
25+
- [ ] My code follows the style guidelines of this project
26+
- [ ] I have performed a self-review of my own code
27+
- [ ] I have commented my code, particularly in hard-to-understand areas
28+
- [ ] I have made corresponding changes to the documentation
29+
- [ ] My changes generate no new warnings
30+
- [ ] I have added tests that prove my fix is effective or that my feature works
31+
- [ ] New and existing unit tests pass locally with my changes
32+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/cd.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ env:
2323
CI: false
2424
COMMIT: ${{ github.sha }}
2525

26-
permissions:
27-
contents: read
28-
pull-requests: read
26+
permissions: {}
27+
2928
jobs:
3029
build-and-push:
3130
permissions:
@@ -39,17 +38,17 @@ jobs:
3938
outputs:
4039
service: ${{ matrix.service }}
4140
steps:
42-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4342
with:
4443
persist-credentials: false
4544
- name: Configure AWS ECR Details
46-
uses: aws-actions/configure-aws-credentials@v4
45+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4
4746
with:
4847
role-to-assume: ${{ secrets.AWS_ECR_ROLE }}
4948
aws-region: us-east-1
5049
- name: Login to Amazon ECR
5150
id: login-ecr
52-
uses: aws-actions/amazon-ecr-login@v2
51+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2
5352
with:
5453
mask-password: "true"
5554
- name: Build and push Docker image
@@ -78,10 +77,13 @@ jobs:
7877
name: Update Helm Values
7978
needs: [build-and-push]
8079
runs-on: ubuntu-latest
80+
permissions:
81+
contents: read
82+
pull-requests: read
8183
environment: ${{ inputs.environment || (github.ref == 'refs/heads/main' && 'staging') }}
8284
steps:
8385
- name: Set up SSH for private repo access
84-
uses: webfactory/ssh-agent@v0.9.0
86+
uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd # 0.9.1
8587
with:
8688
ssh-private-key: ${{ secrets.DEPLOYMENTS_REPO_WRITE }}
8789
- name: Clone deployments repo (specific branch)

.github/workflows/ci.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.

.github/workflows/cron-zizmor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Automated GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Run every day at midnight
6+
7+
permissions: {}
8+
9+
jobs:
10+
zizmor:
11+
name: zizmor latest via PyPI
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
18+
with:
19+
persist-credentials: false
20+
21+
- name: Install the latest version of uv
22+
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v5
23+
24+
- name: Run zizmor 🌈
25+
run: uvx zizmor --format sarif . > results.sarif
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Upload SARIF file
30+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3
31+
with:
32+
sarif_file: results.sarif
33+
category: zizmor

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
push:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
permissions: {}
13+
14+
jobs:
15+
docs:
16+
name: Generate docs
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 60
19+
permissions:
20+
contents: read
21+
defaults:
22+
run:
23+
working-directory: backend
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
27+
with:
28+
persist-credentials: false
29+
30+
- name: Install Rust toolchain
31+
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
32+
33+
- name: Rust cache
34+
uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
35+
with:
36+
cache-on-failure: true
37+
38+
- name: Check docs leaving the dependencies out
39+
env:
40+
RUSTDOCFLAGS: -A rustdoc::private-doc-tests -D warnings
41+
run: cargo doc --no-deps

0 commit comments

Comments
 (0)