mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Add audit plan for Ref property fixes and enhance CI test execution
- Introduced a new audit plan detailing fixes for four issues identified in the second audit of two-way sync Ref properties, including stale comments, slugified name mismatches, immediate ID assignments, and performance optimizations. - Updated CI scripts to run Rust tests with increased parallelism by specifying `--test-threads=16`, improving test execution efficiency. - Enhanced error handling in `update_ref_paths_in_file` to provide clearer context on failures during file reading and JSON parsing. These changes improve the documentation for Ref property audits and optimize the CI testing process.
This commit is contained in:
parent
faa12dc573
commit
075cca4c96
4 changed files with 321 additions and 14 deletions
|
|
@ -4,6 +4,7 @@
|
|||
//! `web/api.rs` (syncback added/removed instances) to keep meta file handling
|
||||
//! DRY and consistent.
|
||||
|
||||
use anyhow::Context;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
|
|
@ -106,14 +107,16 @@ pub fn update_ref_paths_in_file(
|
|||
return Ok(false);
|
||||
}
|
||||
|
||||
let bytes = match fs::read(file_path) {
|
||||
Ok(b) => b,
|
||||
Err(_) => return Ok(false),
|
||||
};
|
||||
let mut val = match crate::json::from_slice::<serde_json::Value>(&bytes) {
|
||||
Ok(v) if v.is_object() => v,
|
||||
_ => return Ok(false),
|
||||
};
|
||||
let bytes = fs::read(file_path)
|
||||
.with_context(|| format!("Failed to read {}", file_path.display()))?;
|
||||
let mut val: serde_json::Value = crate::json::from_slice(&bytes)
|
||||
.with_context(|| format!("Failed to parse JSON5 in {}", file_path.display()))?;
|
||||
if !val.is_object() {
|
||||
anyhow::bail!(
|
||||
"{} is not a JSON object, cannot update Rojo_Ref_* attributes",
|
||||
file_path.display()
|
||||
);
|
||||
}
|
||||
|
||||
let mut updated = false;
|
||||
if let Some(attrs) = val.get_mut("attributes").and_then(|a| a.as_object_mut()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue