This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git
The following commit(s) were added to refs/heads/main by this push:
new 853ec015c ci: ignore package main in the apidiff check (#2262)
853ec015c is described below
commit 853ec015cf44552d02d3d09ed9da6c5296f41f7c
Author: Matt Topol <[email protected]>
AuthorDate: Thu Oct 22 16:28:39 2026 +0100
ci: ignore package main in the apidiff check (#2262)
Commands cannot be imported, so their exported identifiers are not public
API, but apidiff -m reports them. Adding a method to the Output interface in
cmd/iceberg (#2260) failed the check. Drop findings for package main
directories before deciding.
---
dev/check-api-compat.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dev/check-api-compat.sh b/dev/check-api-compat.sh
index b8dc612c2..8a2c4ec51 100755
--- a/dev/check-api-compat.sh
+++ b/dev/check-api-compat.sh
@@ -79,7 +79,18 @@ run_apidiff() {
# apidiff resolves the module from the current directory, so export the base
# API from inside the base checkout and compare from the repository root.
(cd "${base_dir}" && run_apidiff -m -w "${work}/base.export" "${MODULE}")
-run_apidiff -m -incompatible "${work}/base.export" "${MODULE}" >
"${work}/changes.txt"
+run_apidiff -m -incompatible "${work}/base.export" "${MODULE}" >
"${work}/all-changes.txt"
+
+# Commands (package main) cannot be imported, so their exported identifiers
+# are not public API. apidiff reports them anyway, as "- ./<dir>.<name>: ...";
+# drop those lines.
+main_pkgs="$(go list -f '{{if eq .Name "main"}}{{.ImportPath}}{{end}}' ./...)"
+cp "${work}/all-changes.txt" "${work}/changes.txt"
+for pkg in ${main_pkgs}; do
+ prefix="- .${pkg#"${MODULE}"}."
+ grep -vF -- "${prefix}" "${work}/changes.txt" > "${work}/filtered.txt" ||
true
+ mv "${work}/filtered.txt" "${work}/changes.txt"
+done
summary() {
if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then