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
18 changes: 15 additions & 3 deletions .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ jobs:
uses: eclipse-score/cicd-actions/setup-bazel-cache@659dcbed63f6b7fbde88c7850125ea0a0a92f939
with:
unique-cache-name: ${{ github.workflow }}-${{ github.job }}
- name: Apply OSS-only patches
# TEMPORARY WORKAROUND (patch): score/config_management/** is synced from an internal source and cannot be
# edited directly from OSS. bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch adapts the
# config_provider proxy wiring to the OSS score_communication ProxyFuture API and drops internal-only
# (non-OSS) targets. The --check guard makes this a no-op once the change lands via sync.
run: |
git apply --check bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch 2>/dev/null && \
git apply bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch || true
- name: Run Bazel Coverage
run: |
readarray -t TARGETS < <(python3 -c \
"import json; [print(t) for t in json.load(open('score/config_management/deps_acceptlist.json'))['test_targets']]")
bazel coverage --config=host_gcc "${TARGETS[@]}"
bazel coverage \
--config=host_gcc \
--test_tag_filters=-mw_com \
//score/config_management/... \
-- \
-//score/config_management/config_provider/code/config_provider/factory:unit_tests_mw_com \
-//score/config_management/dependability/...
- name: Generate HTML Coverage Report
run: |
genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \
Expand Down
96 changes: 0 additions & 96 deletions .github/workflows/deps-acceptlist-check.yml

This file was deleted.

20 changes: 13 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ jobs:
# the bazel-target depends on your repo specific docs_targets configuration (e.g. "suffix")
# --define=LOBSTER_SOURCE_ROOT sets the GitHub blob URL prefix for source links in the LOBSTER traceability report
# TEMPORARY WORKAROUND (patch): score/config_management/** is synced from an internal source and cannot be
# edited directly from OSS, so the LOBSTER unit() wiring lives only in bazel/patches/wire_unit_test_to_lobster.patch.
# The reusable docs workflow exposes no pre-build hook, so we apply the patch as a side effect of a
# command substitution (redirected to stderr so it contributes nothing to the bazel command line) before
# `bazel run` executes, purely so the generated report reflects the intended wiring. The --check guard
# makes this a no-op (skips silently) once the real change lands via sync, so it never fails the build.
# Remove this workaround once the patch's content is synced into score/config_management/ for real.
bazel-target: "$(git apply --check bazel/patches/wire_unit_test_to_lobster.patch 2>/dev/null && git apply bazel/patches/wire_unit_test_to_lobster.patch 1>&2) //:docs --define=LOBSTER_SOURCE_ROOT=https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/blob/main/ -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
# edited directly from OSS, so two fixes live only as patches applied here:
# - bazel/patches/wire_unit_test_to_lobster.patch: the LOBSTER unit() wiring (config_daemon_app_unit /
# config_provider_details_unit) that score/config_management/dependability/BUILD's component() targets
# reference.
# - bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch: adapts config_provider's proxy
# wiring to the OSS score_communication ProxyFuture API and drops internal-only targets; without it the
# unit()-wrapped :details library (pulled in transitively by //:docs via dependability) fails to compile.
# The reusable docs workflow exposes no pre-build hook, so we apply both patches as a side effect of
# command substitutions (redirected to stderr so they contribute nothing to the bazel command line) before
# `bazel run` executes. The --check guards make this a no-op (skips silently) once the real changes land
# via sync, so it never fails the build. Remove each workaround once its patch's content is synced into
# score/config_management/ for real.
bazel-target: "$(git apply --check bazel/patches/wire_unit_test_to_lobster.patch 2>/dev/null && git apply bazel/patches/wire_unit_test_to_lobster.patch 1>&2)$(git apply --check bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch 2>/dev/null && git apply bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch 1>&2) //:docs --define=LOBSTER_SOURCE_ROOT=https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/blob/main/ -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
retention-days: 3
47 changes: 12 additions & 35 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,17 @@ jobs:
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run clang-tidy checks from deps_acceptlist.json
- name: Apply OSS-only patches
# TEMPORARY WORKAROUND (patch): score/config_management/** is synced from an internal source and cannot be
# edited directly from OSS. bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch adapts the
# config_provider proxy wiring to the OSS score_communication ProxyFuture API and drops internal-only
# (non-OSS) targets. The --check guard makes this a no-op once the change lands via sync.
run: |
python3 - <<'PYEOF'
import json, subprocess, sys
git apply --check bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch 2>/dev/null && \
git apply bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch || true

ACCEPTLIST = "score/config_management/deps_acceptlist.json"

with open(ACCEPTLIST) as f:
targets = json.load(f)["clang_tidy_targets"]

failures = []
for target in targets:
try:
result = subprocess.run(
["bazel", "build", target],
capture_output=True, text=True,
timeout=600,
)
except subprocess.TimeoutExpired:
failures.append(target)
print(f" TIMEOUT {target}")
continue
if result.returncode == 0:
print(f" OK {target}")
else:
failures.append(target)
print(f" FAIL {target}")
print(result.stderr[-2000:])

print(f"\n{len(targets) - len(failures)}/{len(targets)} clang-tidy targets passed.")

if failures:
print("\nStatic analysis failed for the following targets:")
for t in failures:
print(f" {t}")
sys.exit(1)
PYEOF
- name: Run clang-tidy checks
run: |
bazel build \
//score/config_management/config_daemon:clang_tidy_extra_checks \
//score/config_management/config_provider:clang_tidy_extra_checks
59 changes: 15 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,50 +42,21 @@ jobs:
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Pre-warm Bazel cache (build test targets before running them)
- name: Apply OSS-only patches
# TEMPORARY WORKAROUND (patch): score/config_management/** is synced from an internal source and cannot be
# edited directly from OSS. bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch adapts the
# config_provider proxy wiring to the OSS score_communication ProxyFuture API and drops internal-only
# (non-OSS) targets. The --check guard makes this a no-op once the change lands via sync.
run: |
python3 - <<'PYEOF'
import json, subprocess, sys
with open("score/config_management/deps_acceptlist.json") as f:
targets = json.load(f)["test_targets"]
result = subprocess.run(["bazel", "build"] + targets)
sys.exit(result.returncode)
PYEOF
git apply --check bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch 2>/dev/null && \
git apply bazel/patches/001-adapt-proxy-api-and-remove-internal-targets.patch || true

- name: Run tests from deps_acceptlist.json
- name: Run all unit tests
run: |
python3 - <<'PYEOF'
import json, subprocess, sys

ACCEPTLIST = "score/config_management/deps_acceptlist.json"

with open(ACCEPTLIST) as f:
targets = json.load(f)["test_targets"]

failures = []
for target in targets:
try:
result = subprocess.run(
["bazel", "test", target],
capture_output=True, text=True,
timeout=600,
)
except subprocess.TimeoutExpired:
failures.append(target)
print(f" TIMEOUT {target}")
continue
if result.returncode == 0:
print(f" PASS {target}")
else:
failures.append(target)
print(f" FAIL {target}")
print(result.stderr[-2000:])

print(f"\n{len(targets) - len(failures)}/{len(targets)} tests passed.")

if failures:
print("\nTests failed for the following targets:")
for t in failures:
print(f" {t}")
sys.exit(1)
PYEOF
bazel test \
--config=host_gcc \
--test_tag_filters=-mw_com \
//score/config_management/... \
-- \
-//score/config_management/config_provider/code/config_provider/factory:unit_tests_mw_com \
-//score/config_management/dependability/...
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ git_override(
bazel_dep(name = "score_communication")
git_override(
module_name = "score_communication",
commit = "4658ffb26a18dacdc1e903e6bad7282113c4a739",
commit = "9a91fc9528070a2358becc042443b84346651fc7",
remote = "https://github.com/Chahult/communication.git",
)

Expand Down
Loading
Loading