Compare commits

..
Author SHA1 Message Date
Dylan M. Taylor 40dfd311d2 revert: restore scheduled release.yml dry-run on main (#1726) 2026-11-23 14:45:36 -05:00
Dylan M. Taylor 7becad97d9 ci(release): publish scheduled nightly prereleases (#1725) 2026-11-23 13:17:32 -05:00
Dylan M. Taylor 60b7633935 ci(release): forward ARTCRAFT_SERVICES_DISPATCH_TOKEN secret (#1721) 2026-11-23 09:34:15 -05:00
0929d693ee fix(interchange): a rooted AAF locator is a full path on Windows too (#1658)
On Windows `file:///Users/me/a.wav` (a Mac export) and
`file:///C:/me/a.wav` (a Windows export) decode to paths with a root but
no drive prefix, so `is_absolute` is false and the locator was refused
as a relative one that escapes the AAF folder. The whole preview then
failed instead of looking the file up in the chosen media folder.
`has_root` takes them as full paths; on Unix it equals `is_absolute`.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-23 08:56:08 -05:00
4 changed files with 42 additions and 2 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden runner
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+1
View File
@@ -55,3 +55,4 @@ jobs:
AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }}
AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }}
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
ARTCRAFT_SERVICES_DISPATCH_TOKEN: ${{ secrets.ARTCRAFT_SERVICES_DISPATCH_TOKEN }}
+25
View File
@@ -329,6 +329,31 @@ impl Cfb {
}
}
/// Whether the preview found the dialogue file in the media folder, relinked from `locator`.
fn found_in_media_folder(f: &AafFolder, preview: &Value) {
let plan = &preview["plan"];
let warnings: Vec<_> = plan["warnings"].as_array().unwrap().iter().filter_map(|w| w.as_str()).collect();
assert!(!warnings.iter().any(|w| w.starts_with("Missing media")), "{warnings:?}");
assert_eq!(plan["sources"].as_array().unwrap().len(), 2, "{warnings:?}");
let found = std::fs::canonicalize(&f.dir).unwrap().join("Diálogo á #1.wav");
assert_eq!(plan["sources"][0]["path"], json!(found.display().to_string()));
assert!(warnings.iter().any(|w| w.starts_with("Relinked ")), "{warnings:?}");
}
#[test]
fn a_locator_from_a_mac_finds_its_file_in_the_chosen_media_folder() {
let f = AafFolder::new();
let preview = with_locator(&f, "file:///Users/Diálogo á %231.wav").unwrap();
found_in_media_folder(&f, &preview);
}
#[test]
fn a_locator_from_windows_finds_its_file_in_the_chosen_media_folder() {
let f = AafFolder::new();
let preview = with_locator(&f, "file:///C:/me/Diálogo á %231.wav").unwrap();
found_in_media_folder(&f, &preview);
}
#[test]
fn looped_sector_chains_fail_instead_of_hanging() {
let fixture = std::fs::read(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/fixtures/synthetic-two-tracks.aaf")).unwrap();
+15 -1
View File
@@ -568,7 +568,10 @@ fn locator_path(url: &str, base: &Path) -> Result<PathBuf> {
if !matches!(p.components().next_back(), Some(Component::Normal(_))) {
return Err(fail(format!("Locator does not name a file: {url}")));
}
if p.is_absolute() {
// A rooted locator is a full path on the exporting machine. On Windows `/Users/me/a.wav` and
// `/C:/me/a.wav` have a root but no drive prefix, so `is_absolute` is false there; they are still
// full paths and must not be read as relative ones. On Unix `has_root` equals `is_absolute`.
if p.has_root() {
return Ok(p);
}
// A relative locator may only hold plain names (no drive prefix or root on Windows).
@@ -1007,6 +1010,17 @@ mod tests {
assert!(locator_path("file:///x.wav#y", base).is_err());
}
#[test]
fn a_rooted_locator_from_another_machine_keeps_its_path() {
// Exporters write the path on their own machine: a Mac volume, or a Windows drive after the
// `file:///` root. On Windows neither has a drive prefix of the local kind, yet both name a file
// by its full path, so they are taken as given and never joined to the AAF folder.
let base = Path::new("/base");
assert_eq!(locator_path("file:///Users/me/a.wav", base).unwrap(), PathBuf::from("/Users/me/a.wav"));
assert_eq!(locator_path("file:///C:/Users/me/a.wav", base).unwrap(), PathBuf::from("/C:/Users/me/a.wav"));
assert_eq!(locator_path("/Volumes/Media/a.wav", base).unwrap(), PathBuf::from("/Volumes/Media/a.wav"));
}
#[test]
fn locators_never_walk_out_of_the_aaf_folder() {
let base = Path::new("/base");