Skip to content

Commit 2f1ecf8

Browse files
baylesjactions-user
authored andcommitted
[codehealth] Fix licenses.py presubmit failures
This commit addresses the presubmit failures caused by the recent transition to Chromium's upstream `licenses.py` script. - Renamed `README.openscreen` files to `README.chromium` in `third_party/getopt`, `third_party/libc++`, and `third_party/libc++abi` as the upstream script only looks for `README.chromium`. - Removed duplicate `README.openscreen` from `third_party/ninja`. - Added `third_party/googletest/README.chromium` to store metadata that was previously hardcoded in the old `licenses.py` script's `SPECIAL_CASES` dictionary. - Updated `licenses.PRUNE_PATHS` in `PRESUBMIT.py` to ignore nested `third_party` directories within our dependencies (e.g. `boringssl`, `googleurl`, `perfetto`, etc.) since the upstream script now recursively checks subdirectories. Change-Id: I8322ca0557688f84ffbc9bbbc9598edf6defb2f1 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/7833399 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org> Commit-Queue: Mark Foltz <mfoltz@chromium.org>
1 parent 40cff12 commit 2f1ecf8

7 files changed

Lines changed: 77 additions & 24 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Exact OpenScreen Mirror with .github Protection
2+
3+
on:
4+
workflow_dispatch: # Manuel olarak tetiklenebilir
5+
schedule:
6+
- cron: '0 0 */3 * *' # Her 3 günde bir otomatik olarak çalışır
7+
8+
jobs:
9+
mirror:
10+
runs-on: ubuntu-latest # İş akışı Ubuntu üzerinde çalışır
11+
steps:
12+
# Adım 1: Mevcut depoyu tam tarihçe ile al
13+
- name: Checkout Full History
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Tüm commit geçmişini al
17+
18+
# Adım 2: OpenScreen verilerini mevcut depoya entegre et
19+
- name: Integrate OpenScreen
20+
run: |
21+
# 'actions' branch'ine geç
22+
git checkout actions
23+
24+
# OpenScreen'i uzak depo olarak ekle
25+
git remote add openscreen https://chromium.googlesource.com/openscreen
26+
27+
# OpenScreen'den tüm branch'leri ve tag'leri al
28+
git fetch openscreen --tags
29+
30+
# OpenScreen'deki tüm branch'leri yerel olarak oluştur (main hariç)
31+
git branch -r | grep 'openscreen/' | grep -v 'HEAD' | while read remote; do
32+
branch_name=${remote#openscreen/}
33+
git branch -f "$branch_name" "$remote"
34+
done
35+
36+
# Adım 3: Main branch'i koru ve .github dosyalarını güncelle
37+
- name: Protect Main Branch
38+
run: |
39+
# Main branch'e geç
40+
git checkout main
41+
42+
# Git kullanıcı bilgilerini ayarla (commit için)
43+
git config user.name "GitHub Actions"
44+
git config user.email "actions@github.com"
45+
46+
# 'actions' branch'inden .github klasörünü al ve main branch'ine merge et
47+
git checkout actions -- .github
48+
git add .github
49+
git commit --amend --no-edit # Commit'i güncelle (fast-forward olmadan)
50+
51+
# Adım 4: Tüm branch'leri ve tag'leri force push et
52+
- name: Force Push Mirrored Branches
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token'ı kullan
55+
run: |
56+
# Tüm branch'leri ve tag'leri force push et
57+
git push origin --all --force
58+
git push origin --tags --force

‎PRESUBMIT.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,23 @@ class _LicensesArgs:
4747
def _check_licenses(input_api, output_api):
4848
"""Checks third party licenses and returns a list of violations."""
4949
# NOTE: the licenses check is confused by the fact that we don't actually
50-
# check ou the libraries in buildtools/third_party, so explicitly exclude
50+
# check out the libraries in buildtools/third_party, so explicitly exclude
5151
# that folder. See https://crbug.com/1215335 for more info.
5252
licenses.PRUNE_PATHS.update([
5353
os.path.join('buildtools', 'third_party'),
5454
os.path.join('third_party', 'libc++'),
5555
os.path.join('third_party', 'libc++abi'),
5656
os.path.join('third_party', 'rust-toolchain'),
57-
os.path.join('third_party', 'depot_tools')
58-
])
57+
os.path.join('third_party', 'depot_tools'),
58+
os.path.join('third_party', 'boringssl', 'src', 'third_party'),
59+
os.path.join('third_party', 'googleurl', 'src', 'polyfills',
60+
'third_party'),
61+
os.path.join('third_party', 'instrumented_libs', 'binaries'),
62+
os.path.join('third_party', 'perfetto', 'src', 'protos',
63+
'third_party'),
64+
os.path.join('third_party', 'protobuf', 'third_party'),
65+
os.path.join('third_party', 'valijson', 'src', 'thirdparty'),
66+
])
5967

6068
if any(s.LocalPath().startswith('third_party')
6169
for s in input_api.change.AffectedFiles()):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name: Gregory Pietsch getopt
22
Short Name: getopt
33
URL: https://sourceware.org/ml/newlib/2005/msg00758.html
4-
License: Public domain
4+
License: getopt
55
License File: LICENSE
66
Version: 1.0
77
Security Critical: no
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Name: googletest
2+
URL: https://github.com/google/googletest
3+
License: BSD-3-Clause
4+
License File: src/LICENSE
5+
Shipped: no
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name: libcxx
22
Short Name: libc++
33
URL: http://libcxx.llvm.org/
44
Version: 1.0
5-
License: MIT, University of Illinois/NCSA Open Source License
5+
License: NCSA, Apache-with-LLVM-Exception, MIT
66
License File: src/LICENSE.TXT
77
Security Critical: yes
88
Shipped: yes
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name: libcxxabi
22
Short Name: libc++abi
33
URL: http://libcxxabi.llvm.org/
44
Version: 1.0
5-
License: MIT, University of Illinois/NCSA Open Source License
5+
License: NCSA, Apache-with-LLVM-Exception, MIT
66
License File: src/LICENSE.TXT
77
Security Critical: yes
88
Shipped: yes

‎third_party/ninja/README.openscreen‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)