Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dev/README_RELEASE_AIRFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,18 @@ For example:
! /CODE_OF_CONDUCT.md
```

### NOTICE files verification

Verify that all NOTICE files contain the required ASF notice and current copyright year.

Run the verification script from the Airflow repository root:

```shell script
python3 dev/verify_notice_files.py
```

All checks must pass before proceeding with the release.


## Signature check

Expand Down
11 changes: 11 additions & 0 deletions dev/README_RELEASE_AIRFLOWCTL.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,17 @@ For example:
! /CODE_OF_CONDUCT.md
```

### NOTICE files verification

Verify that all NOTICE files contain the required ASF notice and current copyright year.

Run the verification script from the Airflow repository root:

```shell script
python3 dev/verify_notice_files.py
```

All checks must pass before proceeding with the release.

### Signature check

Expand Down
12 changes: 12 additions & 0 deletions dev/README_RELEASE_HELM_CHART.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,18 @@ java -jar ${PATH_TO_RAT}/apache-rat-0.13/apache-rat-0.13.jar chart -E .rat-exclu

where `.rat-excludes` is the file in the root of Chart source code.

### NOTICE files verification

Verify that all NOTICE files contain the required ASF notice and current copyright year.

Run the verification script from the Airflow repository root:

```shell script
python3 dev/verify_notice_files.py
```

All checks must pass before proceeding with the release.

## Signature check

Make sure you have imported into your GPG the PGP key of the person signing the release. You can find the valid keys in
Expand Down
12 changes: 12 additions & 0 deletions dev/README_RELEASE_PROVIDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,18 @@ For example:
! /CODE_OF_CONDUCT.md
```

### NOTICE files verification

Verify that all NOTICE files contain the required ASF notice and current copyright year.

Run the verification script from the Airflow repository root:

```shell script
python3 dev/verify_notice_files.py
```

All checks must pass before proceeding with the release.

### Signature check

Make sure you have imported into your GPG the PGP key of the person signing the release. You can find the valid keys in
Expand Down
12 changes: 12 additions & 0 deletions dev/README_RELEASE_PYTHON_CLIENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,18 @@ For example:
! /CODE_OF_CONDUCT.md
```

### NOTICE files verification

Verify that all NOTICE files contain the required ASF notice and current copyright year.

Run the verification script from the Airflow repository root:

```shell script
python3 dev/verify_notice_files.py
```

All checks must pass before proceeding with the release.

### Signature check

Make sure you have imported into your GPG the PGP key of the person signing the release. You can find the valid keys in
Expand Down
78 changes: 78 additions & 0 deletions dev/verify_notice_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env python3
# 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
#
# http://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.
"""
Verify NOTICE files in Airflow packages for release.

Finds all NOTICE files (sources + distribution packages) and validates them
using the pre-commit hook.

Usage: python3 dev/verify_notice_files.py
"""

from __future__ import annotations

import subprocess
import sys
import tarfile
import tempfile
import zipfile
from pathlib import Path

# Collect all NOTICE files to check
notice_files: list[Path] = []

# Source NOTICE files
root = Path(".")
notice_files.extend(f for f in [
root / "NOTICE",
*root.glob("providers/**/NOTICE"),
*(root / c / "NOTICE" for c in ["airflow-core", "airflow-ctl", "chart", "clients/python", "go-sdk"]),
] if f.exists())

# Extract NOTICE from distribution packages
dist_dir = root / "dist"
if dist_dir.exists():
with tempfile.TemporaryDirectory() as tmpdir:
tmppath = Path(tmpdir)

for whl in dist_dir.glob("*.whl"):
try:
with zipfile.ZipFile(whl) as zf:
for name in zf.namelist():
if name.endswith("NOTICE"):
zf.extract(name, tmppath)
except Exception:
pass

for tgz in dist_dir.glob("*.tar.gz"):
try:
with tarfile.open(tgz) as tf:
for member in tf.getmembers():
if member.name.endswith("NOTICE"):
tf.extract(member, tmppath)
except Exception:
pass

notice_files.extend(tmppath.rglob("NOTICE"))

# Run the pre-commit hook to check all files
if notice_files:
result = subprocess.run(
["python3", "./scripts/ci/prek/check_notice_files.py", *map(str, notice_files)]
)
sys.exit(result.returncode)