Skip to content

Commit 8dd8233

Browse files
authored
ci: implement integration testing infrastructure with mysql containers (#103)
This pull request introduces several improvements focused on code style enforcement, editor configuration, and workflow automation, as well as some documentation and template updates. The most important changes are grouped below by theme. **Editor and Code Style Enforcement** * Added `.editorconfig` and `.editorconfig-checker.json` files with comprehensive formatting rules for all major file types, ensuring consistent code style and formatting across the project. This includes specific settings for Rust, Markdown, TOML, YAML, JSON, shell scripts, and a default fallback for other files. (`.editorconfig`, `.editorconfig-checker.json`) [[1]](diffhunk://#diff-0947e2727d6bad8cd0ac4122f5314bb5b04e337393075bc4b5ef143b17fcbd5bL6-R58) [[2]](diffhunk://#diff-ffc189b5d4f8c2eb9a171e067565fbfe9ecba9a5b717d236cbf22497973fc4a3R1-R20) * Introduced a detailed `.cursor/settings.json` for VSCode, specifying formatter preferences, tab widths, word wrap, and rulers for each language, further standardizing the development environment. **Automation and CI/CD Workflows** * Added a new `autofix.ci` workflow (`.github/workflows/autofix.yml`) that automatically applies code formatting and linting fixes using Rust tools and pre-commit hooks on pull requests and pushes to `main`. * Updated all GitHub Actions workflows to use `taiki-e/checkout-action@v1` instead of the default `actions/checkout`, improving reliability and security. [[1]](diffhunk://#diff-93a89f16f6717d1e4e4e27ec20ef916e3355c7aa890ca74cd9b12db30d8a899fL25-R25) [[2]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL53-R53) [[3]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL123-R123) [[4]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL165-R165) [[5]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL233-R233) **Secret Scanning and Security** * Added a `.checkov.yml` configuration to enable secret scanning, variable evaluation, and enforcement rules for infrastructure code, with custom settings for output and check skipping. **Documentation and Template Formatting** * Improved formatting and readability in markdown documentation and GitHub templates, including line wrapping for better accessibility and clarity. This affects issue templates, pull request templates, Copilot instructions, and changelog templates. [[1]](diffhunk://#diff-c25d576890a32eb1483dee2edf4fdc1529816b846bf76ef565f577cb433c1f79L15-R17) [[2]](diffhunk://#diff-c25d576890a32eb1483dee2edf4fdc1529816b846bf76ef565f577cb433c1f79L54-R57) [[3]](diffhunk://#diff-185833cb26d7ac66a4d39042fd576a820c2c2c6d05ad18973bb9c7dce77267c5L23-R25) [[4]](diffhunk://#diff-b2496e80299b8c3150b1944450bd81c622e04e13d15c411d291db0927d75fd6bL9-R10) [[5]](diffhunk://#diff-b2496e80299b8c3150b1944450bd81c622e04e13d15c411d291db0927d75fd6bL65-R67) [[6]](diffhunk://#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5L5-R19) [[7]](diffhunk://#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5L91-R101) [[8]](diffhunk://#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5L130-R138) [[9]](diffhunk://#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5L163-R172) [[10]](diffhunk://#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5R227-R241) [[11]](diffhunk://#diff-1f80ea1bb3b2ccb8356b3987ebb6c63076d206eacdb50de5a6d7b0027106841cR3-R12) [[12]](diffhunk://#diff-1f80ea1bb3b2ccb8356b3987ebb6c63076d206eacdb50de5a6d7b0027106841cR21-R58) **Rust Best Practices** * Updated Rust best practices documentation to include maximum file length guidelines, a recommendation to use external tools for crate documentation, and improved code sample formatting. [[1]](diffhunk://#diff-89ba100ca0e07303f5e83a34ce056cfc147deefd18b7847b399b5dfb6e1ca906R6) [[2]](diffhunk://#diff-89ba100ca0e07303f5e83a34ce056cfc147deefd18b7847b399b5dfb6e1ca906R52) [[3]](diffhunk://#diff-89ba100ca0e07303f5e83a34ce056cfc147deefd18b7847b399b5dfb6e1ca906L74-R76) [[4]](diffhunk://#diff-89ba100ca0e07303f5e83a34ce056cfc147deefd18b7847b399b5dfb6e1ca906L92-R94) [[5]](diffhunk://#diff-89ba100ca0e07303f5e83a34ce056cfc147deefd18b7847b399b5dfb6e1ca906R113) These changes collectively improve code quality, enforce consistent style, automate maintenance tasks, and enhance documentation for both contributors and reviewers. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Added a “Manual Checks” action to run full project checks interactively until all pass (formatting, linting, tests, coverage, security, pre-commit hooks). - Chores - Removed the legacy “Manual CI Check” action. - Documentation - Clarified docs sync guidance to explicitly update files in /docs and maintain an end‑user manual tone. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 564ccf7 commit 8dd8233

154 files changed

Lines changed: 195579 additions & 167669 deletions

File tree

Some content is hidden

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

.checkov.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
block-list-secret-scan: []
2+
branch: master
3+
custom-tool-name: Checkov
4+
directory:
5+
- .
6+
evaluate-variables: true
7+
external-modules-download-path: .external_modules
8+
hard-fail-on:
9+
- MEDIUM
10+
mask: []
11+
output:
12+
- github_failed_only
13+
quiet: true
14+
secrets-history-timeout: 12h
15+
secrets-scan-file-type: []
16+
skip-check:
17+
- CKV_DOCKER_2
18+
soft-fail-on:
19+
- LOW
20+
summary-position: top
21+
use-enforcement-rules: true

.chglog/CHANGELOG.tpl.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{{ if .Versions -}}
22
<a name="unreleased"></a>
3+
34
## [Unreleased]
45

56
{{ if .Unreleased.CommitGroups -}}
67
{{ range .Unreleased.CommitGroups -}}
8+
79
### {{ .Title }}
10+
811
{{ range .Commits -}}
12+
913
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
1014
{{ end }}
1115
{{ end -}}
@@ -14,31 +18,44 @@
1418

1519
{{ range .Versions }}
1620
<a name="{{ .Tag.Name }}"></a>
21+
1722
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
23+
1824
{{ range .CommitGroups -}}
25+
1926
### {{ .Title }}
27+
2028
{{ range .Commits -}}
29+
2130
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
2231
{{ end }}
2332
{{ end -}}
2433

2534
{{- if .RevertCommits -}}
35+
2636
### Reverts
37+
2738
{{ range .RevertCommits -}}
39+
2840
- {{ .Revert.Header }}
2941
{{ end }}
3042
{{ end -}}
3143

3244
{{- if .MergeCommits -}}
45+
3346
### Pull Requests
47+
3448
{{ range .MergeCommits -}}
49+
3550
- {{ .Header }}
3651
{{ end }}
3752
{{ end -}}
3853

3954
{{- if .NoteGroups -}}
4055
{{ range .NoteGroups -}}
56+
4157
### {{ .Title }}
58+
4259
{{ range .Notes }}
4360
{{ .Body }}
4461
{{ end }}

.cursor/rules/rust-best-practices.mdc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description:
33
globs:
44
alwaysApply: true
55
---
6+
67
# Rust Best Practices for gold_digger
78

89
## Project Structure
@@ -48,6 +49,7 @@ This zero-copy API accepts:
4849
- **Clippy warnings**: Zero tolerance (`-D warnings`)
4950
- **Error handling**: Use `anyhow` for applications, `thiserror` for libraries
5051
- **Documentation**: Doc comments (`///`) required for all public functions
52+
- **Code length**: Rust files should be no longer than 1000 lines of code, and no more than 500 lines of code, if possible.
5153

5254
### Essential Commands
5355

@@ -71,7 +73,7 @@ just security # cargo audit (advisory)
7173

7274
Required for all public functions using `///`:
7375

74-
```rust
76+
````rust
7577
/// Converts MySQL rows to string vectors for output formatting.
7678
///
7779
/// # Arguments
@@ -89,7 +91,7 @@ Required for all public functions using `///`:
8991
pub fn rows_to_strings(rows: Vec<mysql::Row>) -> anyhow::Result<Vec<Vec<String>>> {
9092
// Implementation
9193
}
92-
```
94+
````
9395

9496
## Code Style
9597

@@ -108,6 +110,7 @@ pub fn rows_to_strings(rows: Vec<mysql::Row>) -> anyhow::Result<Vec<Vec<String>>
108110

109111
- Pin dependency versions in [`Cargo.toml`](mdc:Cargo.toml) and use minimal required features for each crate
110112
- Use optional dependencies and features for extensibility (e.g., additional MySQL types, output formats)
113+
- Use context7 website or MCP tool to get current documentation for APIs and crates
111114

112115
## Testing Guidelines
113116

.cursor/settings.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"prettier.configPath": ".prettierrc.json",
3+
"prettier.requireConfig": true,
4+
"prettier.useEditorConfig": false,
5+
"editor.formatOnSave": true,
6+
"editor.defaultFormatter": "esbenp.prettier-vscode",
7+
"editor.rulers": [100],
8+
"editor.wordWrap": "wordWrapColumn",
9+
"editor.wordWrapColumn": 100,
10+
"[json]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"editor.tabSize": 2,
13+
"editor.insertSpaces": true,
14+
"prettier.tabWidth": 2
15+
},
16+
"[jsonc]": {
17+
"editor.defaultFormatter": "esbenp.prettier-vscode",
18+
"editor.tabSize": 2,
19+
"editor.insertSpaces": true,
20+
"prettier.tabWidth": 2
21+
},
22+
"[yaml]": {
23+
"editor.defaultFormatter": "esbenp.prettier-vscode",
24+
"editor.tabSize": 2,
25+
"editor.insertSpaces": true,
26+
"prettier.tabWidth": 2
27+
},
28+
"[yml]": {
29+
"editor.defaultFormatter": "esbenp.prettier-vscode",
30+
"editor.tabSize": 2,
31+
"editor.insertSpaces": true,
32+
"prettier.tabWidth": 2
33+
},
34+
"[rust]": {
35+
"editor.defaultFormatter": "rust-lang.rust-analyzer",
36+
"editor.tabSize": 4,
37+
"editor.insertSpaces": true
38+
},
39+
"[toml]": {
40+
"editor.defaultFormatter": "esbenp.prettier-vscode",
41+
"editor.tabSize": 4,
42+
"editor.insertSpaces": true,
43+
"prettier.tabWidth": 4
44+
},
45+
"[markdown]": {
46+
"editor.defaultFormatter": "esbenp.prettier-vscode",
47+
"editor.tabSize": 2,
48+
"editor.insertSpaces": true,
49+
"prettier.tabWidth": 2,
50+
"prettier.proseWrap": "always",
51+
"editor.wordWrap": "on",
52+
"editor.rulers": [100]
53+
},
54+
"oxc.enable": true,
55+
"oxc.format.enable": false,
56+
"oxc.configPath": ".oxlintrc.json",
57+
"[javascript]": {
58+
"editor.defaultFormatter": "esbenp.prettier-vscode",
59+
"editor.tabSize": 2,
60+
"editor.insertSpaces": true,
61+
"prettier.tabWidth": 2
62+
},
63+
"[typescript]": {
64+
"editor.defaultFormatter": "esbenp.prettier-vscode",
65+
"editor.tabSize": 2,
66+
"editor.insertSpaces": true,
67+
"prettier.tabWidth": 2
68+
},
69+
"[javascriptreact]": {
70+
"editor.defaultFormatter": "esbenp.prettier-vscode",
71+
"editor.tabSize": 2,
72+
"editor.insertSpaces": true,
73+
"prettier.tabWidth": 2
74+
},
75+
"[typescriptreact]": {
76+
"editor.defaultFormatter": "esbenp.prettier-vscode",
77+
"editor.tabSize": 2,
78+
"editor.insertSpaces": true,
79+
"prettier.tabWidth": 2
80+
}
81+
}

.editorconfig

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,56 @@
33
# top-most EditorConfig file
44
root = true
55

6-
# Unix-style newlines with a newline ending every file
7-
[*]
8-
charset = utf-8
9-
end_of_line = lf
10-
insert_final_newline = true
11-
trim_trailing_whitespace = true
12-
indent_style = space
13-
indent_size = 4
14-
# Note: max_line_length is not reliably supported by all editors
15-
# Use language-specific formatters instead:
16-
# - Rust: rustfmt.toml (max_width = 119)
17-
# - Markdown: .markdownlint-cli2.jsonc (MD013 disabled)
18-
# - YAML/JSON: Respect indent_size settings below
19-
206
# Rust files
217
[*.rs]
228
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
charset = utf-8
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
2314

2415
# TOML files
2516
[*.toml]
2617
indent_size = 4
18+
indent_style = space
19+
end_of_line = lf
20+
charset = utf-8
21+
insert_final_newline = true
22+
trim_trailing_whitespace = true
2723

2824
# Markdown files
2925
[*.md]
26+
indent_size = 2
27+
indent_style = space
28+
end_of_line = lf
29+
charset = utf-8
30+
insert_final_newline = true
3031
trim_trailing_whitespace = false
3132

32-
# YAML files
33-
[*.{yml,yaml}]
33+
# JSON, YAML, and JSONC files
34+
[*.json,*.jsonc,*.yml,*.yaml]
3435
indent_size = 2
36+
indent_style = space
37+
end_of_line = lf
38+
charset = utf-8
39+
insert_final_newline = true
40+
trim_trailing_whitespace = true
3541

36-
# JSON files
37-
[*.json]
42+
# Shell scripts
43+
[*.sh,*.bash,*.zsh]
3844
indent_size = 2
45+
indent_style = space
46+
end_of_line = lf
47+
charset = utf-8
48+
insert_final_newline = true
49+
trim_trailing_whitespace = true
50+
51+
# Default settings for all other files
52+
[*]
53+
charset = utf-8
54+
end_of_line = lf
55+
insert_final_newline = true
56+
trim_trailing_whitespace = true
57+
indent_style = space
58+
indent_size = 4

.editorconfig-checker.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"Version": "v3.3.0",
3+
"Verbose": false,
4+
"Format": "",
5+
"Debug": false,
6+
"IgnoreDefaults": false,
7+
"SpacesAfterTabs": false,
8+
"NoColor": false,
9+
"Exclude": [],
10+
"AllowedContentTypes": [],
11+
"PassedFiles": [],
12+
"Disable": {
13+
"EndOfLine": false,
14+
"Indentation": true,
15+
"InsertFinalNewline": false,
16+
"TrimTrailingWhitespace": false,
17+
"IndentSize": true,
18+
"MaxLineLength": false
19+
}
20+
}

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ A clear and concise description of the issue.
1212
export DATABASE_QUERY="..."
1313
```
1414

15-
⚠️ Security Note: Before posting this issue, please redact or obfuscate any sensitive credentials in your DATABASE_URL. Replace usernames, passwords, and hostnames with `[REDACTED]` or use a sanitized example like mysql://user:pass@host:3306/db.
15+
⚠️ Security Note: Before posting this issue, please redact or obfuscate any sensitive credentials
16+
in your DATABASE_URL. Replace usernames, passwords, and hostnames with `[REDACTED]` or use a
17+
sanitized example like mysql://user:pass@host:3306/db.
1618

1719
2. Run the command:
1820

@@ -51,4 +53,5 @@ Please select the appropriate template for your issue:
5153

5254
---
5355

54-
**Note**: This is a single-maintainer project. Please be patient with response times and provide as much detail as possible to help with issue resolution.
56+
**Note**: This is a single-maintainer project. Please be patient with response times and provide as
57+
much detail as possible to help with issue resolution.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ A clear and concise description of what the bug is.
2020
export DATABASE_QUERY="..."
2121
```
2222

23-
**⚠️ Security Note**: Before posting this issue, please redact or obfuscate any sensitive credentials in your DATABASE_URL. Replace usernames, passwords, and hostnames with `<redacted>` or use a sanitized example like `mysql://user:pass@host:3306/db`.
23+
**⚠️ Security Note**: Before posting this issue, please redact or obfuscate any sensitive
24+
credentials in your DATABASE_URL. Replace usernames, passwords, and hostnames with `<redacted>`
25+
or use a sanitized example like `mysql://user:pass@host:3306/db`.
2426

2527
2. Run the command:
2628

0 commit comments

Comments
 (0)