[roll] Roll fuchsia [check-licenses] Refactor project package and add tests This change resolves critical data races, memory leaks, and silent parsing failures within the `project` package. It also completely overhauls the testing strategy for the package to use isolated unit tests rather than integration-level golden files. * Data Race Fixes: Added a `sync.Mutex` to the `Project` struct to protect `RegularFiles` and `LicenseFiles` from concurrent mutations by the directory crawler. Added a thread-safe `GetFiles()` method and updated `filter.go` to use it. * Global State Safety: Encapsulated the global maps `AllProjects`, `FilteredProjects`, and `DedupedLicenseData` behind `sync.RWMutex` locks with thread-safe getters and setters in `config.go`. * Memory Optimization: Removed the massive string allocations in `filter.go`'s deduplication logic. It now uses the cached, pre-computed `Hash()` strings as map keys instead of allocating new strings for the entire license text. * SPDX Bug Fixes: Fixed two bugs in `spdx.go`. It now correctly defaults to "NOASSERTION" if a project has no licenses, and it no longer generates mathematically invalid `()` string expressions if a file contains zero data segments. * Parsing Bug Fix: Updated `NewProject` to use the exported `string(file.SingleLicense)` constant, resolving a bug where explicitly defined license files failed to parse. * Code Cleanup: Purged dead `getGitInfo` code and the unused `git` and `ctx` variables. Moved `init.go` contents into `config.go`. * Testing: Purged the `testdata/` directory and rewrote `project_test.go` and `spdx_test.go` to dynamically scaffold tests using `t.TempDir()`. Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1566402 Original-Revision: 7417934a66ba0271c93896dfc5053775e455a0d7 GitOrigin-RevId: bae527f38323be1db122df06776ed05d4953b333 Change-Id: Icda6eb69af19541de0105ad922ef4f9d4fb3759c
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party.