Skip to content

Migrate license to Apache - #2231

Draft
subhramit wants to merge 15 commits into
apache:masterfrom
subhramit:apache-license-migration
Draft

subhramit wants to merge 15 commits into
apache:masterfrom
subhramit:apache-license-migration

Conversation

@subhramit

@subhramit subhramit commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor
  • Migrate license from MIT to Apache 2.0
  • Replace existing Uber license headers in source files
  • Add license header in remaining source files
  • Inventory third-party licenses and attribution
  • Generate separate source and binary distribution licenses using Apache JMeter tooling
  • Package tracked source files with generated source-distribution licensing
  • Change project and SCM URLs from uber/NullAway to apache/nullaway
  • Change the generated Maven POM’s license from MIT to Apache 2.0
  • Change the POM developer metadata from Uber to the Apache Software Foundation
  • Configure Gradle subprojects to include artifact-specific generated LICENSE.txt, NOTICE, and third-party license texts under META-INF/ in generated JARs
  • Add CI job for Spark-style license audit
  • Add CI checks for archive licensing, dependency changes, and source-release rebuilds

Note: For now, preserved Maven coordinates such as com.uber.nullaway:nullaway, Java package names, and versions - as renaming those would be a separate compatibility-affecting migration.

AI assistance - Zed + gpt 6.1 sol

Assisted-by: Zed (GPT-6.1 Sol)
Assisted-by: Zed (GPT-6.1 Sol)
Preserve third-party and mixed-ownership notices. Remove redundant Uber-
only MIT blocks immediately after Java package declarations.

Assisted-by: Zed (GPT-6.1 Sol)
Assisted-by: Zed (GPT-6.1 Sol)
Record copied source, generated-model provenance, and resolved bundled
dependencies. Include full license texts and retain outstanding
release-review requirements.

Assisted-by: Zed (GPT-6.1 Sol)
Assisted-by: Zed (GPT-6.1 Sol)
Preserve project legal files in binary, source, and Javadoc archives.
Retain fat-JAR dependency notices separately to prevent collisions.

Assisted-by: Zed (GPT-6.1 Sol)
Assisted-by: Zed (GPT-6.1 Sol)
Assisted-by: Zed (GPT-6.1 Sol)
Comment thread AGENTS.md Outdated
Comment on lines +1 to +17
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey, please never do this. AGENTS.md loads to every agent, and bloating the context with a license header is wasteful.

@subhramit subhramit Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ran the replace/add script agnostically on all java and source files, so missed noticing this.

But now that we are discussing, not even SPDX?
E.g. https://github.com/apache/airflow/blob/59f890be7a46cfab3d2dfa93903919372d9d1205/AGENTS.md?plain=1#L1-L2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay I checked some others, only airflow has that, better we drop.

Comment thread NOTICE Outdated
Comment on lines +15 to +16
This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lines 15-16 duplicate lines 4-5.

Comment thread NOTICE Outdated
Comment on lines +10 to +13
This product includes code from Apache Pig:

Apache Pig
Copyright 2008-2014 The Apache Software Foundation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we can drop the code and reimplement it.

@subhramit subhramit Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This isn't addressed yet (wanted to leave it open for discussion) but got marked outdated.

Use JMeter's gather/render tooling with resolved artifact graphs.
Separate project, source-release, and binary licensing, retaining
only documented exact-version upstream exceptions.

Verify dependency changes, missing metadata, exception guards, and
rebuilds from source releases in CI.

Assisted-by: Zed (GPT-6.1 Sol)
Exclude root AGENTS.md from header migration and RAT so the removed
boilerplate is not reintroduced.

Assisted-by: Zed (GPT-6.1 Sol)
@subhramit subhramit changed the title Migrate license to Apache 2.0 Migrate license to Apache Dec 4, 2026
Skip only JarInferTest's known .astubx.jar output during discovery.
Continue checking real module archives and models at other paths.

Assisted-by: Zed (GPT-6.1 Sol)

@msridhar msridhar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for this, super helpful! Can we split up this PR into multiple separate PRs each with a single purpose? I have trouble reviewing this one as there are too many things going on. E.g., just adding license headers everywhere could be a separate PR. We don't need to do a stack; probably many of them can land in parallel.

Also, as I'm new to Apache, if we could link the relevant Apache policies to explain the changes that'd be great. E.g., where exactly do license headers have to appear? On every text file? Or every file that is source code? What about configuration? Here I see license headers on config YAML files, and on .github/third-party/README.md. Maybe that's all necessary, but I'd like to just check on that, as it does add clutter.

@vlsi

vlsi commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

+1
One more thought: I wonder if we can use the opportunity to apply short headers.

@subhramit

Copy link
Copy Markdown
Contributor Author

+1 One more thought: I wonder if we can use the opportunity to apply short headers.

I am not sure about this one.
I mostly based this PR on Spark and Airflow.
Airflow uses short headers in certain files as mentioned here (another example could be the PULL_REQUEST_TEMPLATE).
For all other source files, I have only seen the long form - but you can let me know if there are other exceptions apart from these.

Also, as I'm new to Apache, if we could link the relevant Apache policies to explain the changes that'd be great. E.g., where exactly do license headers have to appear? On every text file? Or every file that is source code? What about configuration? Here I see license headers on config YAML files, and on .github/third-party/README.md. Maybe that's all necessary, but I'd like to just check on that, as it does add clutter.

Can do that, will take a bit more time. I'll be converting this to draft in the meanwhile.

@msridhar

msridhar commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Can do that, will take a bit more time. I'll be converting this to draft in the meanwhile.

This is not strictly necessary for all cases. But it'd be good to have some explanation of why each change is being made, unless it's quite obvious.

@subhramit

Copy link
Copy Markdown
Contributor Author

I am not sure about this one.

To aid discussions, I started a comparative chat with my agent:

Spark:
image

Airflow:
image

(The following text is pasted verbatim from a response to an inquiry about the rules)

Apache’s rule is “include an ASF header by default, with limited exceptions decided by the project’s PMC”—not “every file must always have the full boilerplate.”

The authoritative reference is the ASF Source Header and Copyright Notice Policy.

Default

  • ASF-developed source files should carry the standard ASF header.
  • The policy also applies to documentation included in a release.
  • Third-party files retain their original licensing notices; don’t replace them with ASF headers.

Exceptions

The policy explicitly gives these examples of files that may omit headers:

  • Files without copyrightable creativity.
  • Short informational files, such as README or INSTALL.
  • Test data where adding a header would break tests.
  • Included snippets where the enclosing file already supplies the header.

It says:

PMCs should use their judgement, err on having a source header and contact legal-discuss@ if unsure.

AGENTS.md and PR templates are not explicitly named exemptions. Whether they qualify is a project/PMC judgment—not something established merely by Spark omitting headers.

SPDX

The current policy permits an SPDX replacement, but requires all three fields:

SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: See the NOTICE file distributed with this work for additional information regarding copyright ownership
SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements

A bare SPDX-License-Identifier is explicitly insufficient as a replacement for a required ASF header. My Airflow example described its repository practice, not proof that that shorter notice satisfies the current policy.

@subhramit
subhramit marked this pull request as draft December 5, 2026 19:57
@msridhar

msridhar commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

I feel we should skip a header for all markdown files (generally, all documentation I think) and files like .gitignore. The exclusions used by Spark look good to me.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants