[ANE-2955] Fix vendored archive uploads with absolute paths#1713
[ANE-2955] Fix vendored archive uploads with absolute paths#1713nficca wants to merge 4 commits into
Conversation
safeSeparators kept the root "/" as a leading element of its output, and the System.FilePath.Posix.(</>) at the call site treats an absolute RHS as the result. That made compressFile try to write the tarball at the filesystem root and fail with EACCES on non-root users. This is the default code path for archive-upload runs from the meta-fossa Yocto layer, which always emits absolute paths in vendored-dependencies. Filter "/" components out before joining so the result stays relative.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR fixes a crash in vendored dependency archive uploads when using absolute file paths. The 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Overview
fossa analyzewith archive uploads crashes when anyvendored-dependencies[].pathis absolute. It fails withwithBinaryFile: permission deniedwhile trying to write the tarball at the filesystem root. The meta-fossa Yocto layer always emits absolute paths, so every archive-upload run from it hits this.The temp filename builder kept a leading
/for absolute inputs and that escaped the intended output directory. Fix strips the root component so the tarball stays where it should.Acceptance criteria
Archive-upload
fossa analyzesucceeds when a vendored deppathis absolute, including for the meta-fossa Yocto integration.Testing plan
Stage a vendored source dir at any absolute path:
Create a project dir with a
fossa-deps.jsonpointing at it:Run analyze, forcing archive upload so this code path is exercised regardless of org default:
Against
master, the run dies withwithBinaryFile: permission deniedon a path starting with/_tmp_vendor_foo.... With this branch, the run succeeds and the vendored dep shows up in the project on app.fossa.com.Risks
Behaviour change is scoped to absolute-path inputs; relative paths produce the same filename as before.
Metrics
None.
References
Checklist
docs/.docs/README.msand gave consideration to how discoverable or not my documentation is.Changelog.md. If this PR did not mark a release, I added my changes into an## Unreleasedsection at the top..fossa.ymlorfossa-deps.{json.yml}, I updateddocs/references/files/*.schema.jsonAND I have updated example files used byfossa initcommand. You may also need to update these if you have added/removed new dependency type (e.g.pip) or analysis target type (e.g.poetry).docs/references/subcommands/<subcommand>.md.No docs/schema/subcommand changes needed. Changelog entry under a new
## 3.17.7section since this is intended to ship as the next release.