Skip to content

chore: switch to SPDX license headers#4533

Open
MikeGoldsmith wants to merge 4 commits intoopen-telemetry:mainfrom
honeycombio:mike/spdx-license-headers
Open

chore: switch to SPDX license headers#4533
MikeGoldsmith wants to merge 4 commits intoopen-telemetry:mainfrom
honeycombio:mike/spdx-license-headers

Conversation

@MikeGoldsmith
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith commented May 5, 2026

Summary

  • Replace the Apache 2.0 license header with the 2-line SPDX equivalent (# SPDX-License-Identifier: Apache-2.0) across all Python files
  • Add scripts/check_license_header.py enforcement script and lint-license-header-check tox env to catch missing headers in CI
  • Update scripts/license_header.txt template to use SPDX format
  • Document the required header format in CONTRIBUTING.md

590 files had their existing Apache header replaced with the SPDX equivalent. During the migration, 85 files were found with missing headers and 15 files had non-standard header variants:

  • 13 files used an older copyright format (Copyright 2020, OpenTelemetry Authors) — normalized to Copyright The OpenTelemetry Authors
  • 2 files had Google LLC copyright with a different Apache URL format
  • 1 file had a 6-space indent variant in the Apache URL
  • 85 source/test/example files had no header at all

All now have the correct SPDX header. Third-party copyrights (Google LLC, Amazon) are preserved with SPDX on line 2.

Motivation

Other OTel SDKs and the Python core SDK have already adopted SPDX headers:

Closes #4521

Notes

  • Generated files and empty __init__.py files are excluded from the check
  • The check script accepts any # Copyright line (to support third-party copyrights like Google LLC, Amazon) followed by # SPDX-License-Identifier: Apache-2.0
  • No runtime impact — Python strips comments during bytecode compilation

Replace the Apache 2.0 license header with the 2-line SPDX
equivalent across all Python files. Add a CI check to enforce the
header on new files going forward.

Closes open-telemetry#4521

Assisted-by: Claude Opus 4.6
@MikeGoldsmith MikeGoldsmith requested a review from a team as a code owner May 5, 2026 11:21
@github-actions github-actions Bot added the gen-ai Related to generative AI label May 5, 2026
Assisted-by: Claude Opus 4.6
Assisted-by: Claude Opus 4.6
The generate script template already adds a newline after the header,
so the template file must not end with one.

Assisted-by: Claude Opus 4.6
Copy link
Copy Markdown
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This duplicates #4532 but also includes a workflow update. Not sure how you'd like to proceed, @MikeGoldsmith !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gen-ai Related to generative AI

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

Switch to SPDX license headers

4 participants