Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2
fix(ci): green every red badge — dylint pin, macOS zed assertion, CH32V006 sysclk, nightly reusable-workflow cap#1221
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
3a7d110ff1c894d7367b64be94dea55a04a6c2eb62File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -304,7 +304,27 @@ fn sysclk_define( | ||
| ))); | ||
| } | ||
| }; | ||
| let unit = if matches!(series, "ch32v003" | "ch32v006") && source == "HSI" { | ||
| // Spelling is per-series because the vendor headers are not self-consistent. | ||
| // | ||
| // `system/CH32V00x/USER/system_ch32v00x.c` (ch32v003) tests the uppercase | ||
| // `SYSCLK_FREQ_<n>MHZ_HSI` where it dispatches, so that series keeps `MHZ`. | ||
| // | ||
| // ch32v006 (`system/CH32VM00X/USER/system_ch32v00X.c`) is a *different* | ||
| // file with a typo: it declares and defines `SetSysClockTo_48MHz_HSI` | ||
| // under the lowercase `SYSCLK_FREQ_48MHz_HSI`, but its `SetSysClock()` | ||
| // dispatcher tests the uppercase `SYSCLK_FREQ_48MHZ_HSI` and calls | ||
| // `SetSysClockTo_48MHZ_HSI()` -- an identifier that exists nowhere in the | ||
| // tree. Defining the uppercase spelling therefore takes a branch whose | ||
| // callee was never declared: | ||
| // | ||
| // error: implicit declaration of function 'SetSysClockTo_48MHZ_HSI' | ||
| // | ||
| // Emitting the lowercase spelling leaves that broken branch unselected, so | ||
| // the file compiles and the part runs on the reset-default HSI clock -- | ||
| // the same outcome the vendor core produces for any unrecognized setting. | ||
| // Actually applying 48 MHz on ch32v006 needs a vendor-side fix to that | ||
| // dispatcher; it cannot be reached from a `-D` flag. | ||
| let unit = if series == "ch32v003" && source == "HSI" { | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "MHZ" | ||
| } else { | ||
| "MHz" | ||
| @@ -502,6 +522,23 @@ mod tests { | ||
| ); | ||
| } | ||
| /// ch32v006 must NOT get ch32v003's uppercase spelling. Its vendor file | ||
| /// declares the setter under `SYSCLK_FREQ_48MHz_HSI` but dispatches on | ||
| /// `SYSCLK_FREQ_48MHZ_HSI`, so the uppercase form selects a call to an | ||
| /// undeclared `SetSysClockTo_48MHZ_HSI` and the core fails to compile. | ||
| #[test] | ||
| fn test_sysclk_define_ch32v006_uses_lowercase_mhz() { | ||
| assert_eq!( | ||
| sysclk_define("ch32v006", "48000000L", "hsi+pll").unwrap(), | ||
| ("SYSCLK_FREQ_48MHz_HSI".to_string(), "48000000".to_string()) | ||
| ); | ||
| // HSE was never part of the uppercase carve-out; keep it lowercase too. | ||
| assert_eq!( | ||
| sysclk_define("ch32v006", "24000000L", "hse").unwrap(), | ||
| ("SYSCLK_FREQ_24MHz_HSE".to_string(), "24000000".to_string()) | ||
| ); | ||
| } | ||
| #[test] | ||
| fn test_sysclk_define_rejects_unsupported_frequency() { | ||
| let error = sysclk_define("ch32v203", "8000000L", "hsi").unwrap_err(); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win
Duplicate nightly matrix jobs and non-unique job names. The generator identifies each board by the 4-tuple of display name, test dir, env name, and firmware ext, and it no longer emits the per-board workflow filename. Repeated 4-tuples in the SOT therefore render as duplicate jobs, and jobs that share a display name cannot be mapped back to a board workflow.
ci/render_workflows.py#L177-L184: emitjob_idfrom_job_id(b["workflow"]), use it in the jobname, and skip entries whose 4-tuple was already emitted..github/workflows/nightly-platforms.yml#L218-L225: regenerate so the repeated "Arduino Nano Every" entry appears once..github/workflows/nightly-platforms.yml#L250-L257: regenerate so the repeated "ST Nucleo F429ZI" and "ST Nucleo F439ZI" entries appear once..github/workflows/nightly-platforms.yml#L370-L373: regenerate so the repeated "Arduino Uno R4 WiFi" entry appears once.🧰 Tools
🪛 ast-grep (0.45.0)
[info] 179-179: use jsonify instead of json.dumps for JSON output
Context: json.dumps(b['workflow_name'])
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
[info] 180-180: use jsonify instead of json.dumps for JSON output
Context: json.dumps(b['test_dir'])
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
[info] 181-181: use jsonify instead of json.dumps for JSON output
Context: json.dumps(b['env_name'])
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
[info] 182-182: use jsonify instead of json.dumps for JSON output
Context: json.dumps(b['firmware_ext'])
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
📍 Affects 2 files
ci/render_workflows.py#L177-L184(this comment).github/workflows/nightly-platforms.yml#L218-L225.github/workflows/nightly-platforms.yml#L250-L257.github/workflows/nightly-platforms.yml#L370-L373🤖 Prompt for AI Agents