Why include a license notice in each file in a repo (with exceptions)?

It is inadequate to provide a single license file at the top of an open source project repo, for the following reasons:

Thus in general and with limited exceptions, any file which is compatible with a license as comments should carry a code or doc license. This applies to all file types: code, data, docs, and readme’s (informal docs, user guides, etc).

When and why (or why not) to add a license

An up-to-date license should be included in each file if it is:

A license should not be included in each file if:

A LICENSE.txt file should be included at the top folder of the repo:

Process for license additions to O-RAN-SC code

Document exclusions for files that typically carry no/minimal unique content, e.g.

License cleanup process for seed code (to bring essential files into alignment with this best practice):

Periodically, until "Ongoing Process" is stood up:

Pre-launch process preparation

Ongoing Process

Licensing artifacts

Artifacts that are generated via O-RAN-SC build processes, e.g. container images, should have licenses clearly identified in metadata as provided by the artifact repository, e.g.

Additional guidance

Imported code

Projects may find the need to import code from other sources, to extend it, or fork it, etc. While this is generally not recommended due to the overhead e.g. of forking projects, it may be necessary in some cases. Where possible, imported yet unchanged code should not be included in repos, rather imported as needed during build processes or at runtime. More specific guidance on how to do that will be provided in the developer wiki.

In general, code that is imported and updated in an O-RAN-SC project needs to have the original license untouched, and a new license appended to it. Any new, substantial files created in a block of related code that was imported from another project, must carry an O-RAN-SC license. This is because the imported code may not have had licenses in each file, leading to the potential unclarity of provenance, if the O-RAN-SC project did not explicitly add licenses to each file it added. Additionally, for imported files without an internal license, there needs to be clarity somewhere as to where it came from and the related license, e.g. in a README file at the top folder for the imported code block. The O-RAN-SC project needs to avoid unclear provenance, regardless of whether that is a problem or not (we can’t anticipate all problems with it). So any substantial file that we add to an imported project should definitely have an O-RAN-SC license embedded.