Skip to content

chore(release): 0.6.0 — span OTel correlation, ViewManager denied_columns - #514

Merged
haiyuan-eng-google merged 2 commits into
GoogleCloudPlatform:mainfrom
caohy1988:release/0.6.0
Oct 8, 2026
Merged

haiyuan-eng-google merged 2 commits into
GoogleCloudPlatform:mainfrom
caohy1988:release/0.6.0

Conversation

@caohy1988

@caohy1988 caohy1988 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Release PR for bigquery-agent-analytics 0.6.0. Like #487 and #501, it changes two files: pyproject.toml ([project].version 0.5.4 → 0.6.0) and CHANGELOG.md. It covers the 10 PRs merged since v0.5.4 (#502, #504–#510, #512, #513).

Why 0.6.0 and not 0.5.5

Under 0.x semver a minor bump is where incompatible changes go, and this range has two that affect deployed views:

  • Per-event views gain otel_span_id and otel_trace_id between the standard headers and the event-specific columns. Names and types are unchanged, but once create_all_views() is re-run, anything that reads view columns by position (for example INSERT INTO ... SELECT * from a view) sees the event-specific columns two positions later.
  • Over an events table with no attributes column (written with payload_column_denylist=["attributes"]), 0.5.4 deployed 19 of the 25 per-event views. 0.6.0 deploys none of them unless the caller passes the new denied_columns=["attributes"] or --denied-column=attributes.

It also adds public API: the three Span fields, ViewManager(denied_columns=...) and --denied-column. Installs pinned with ~=0.5.4 or <0.6 will not pick these changes up until they opt in.

The case for 0.5.5. Repo precedent points the other way. This project has bumped the minor version only for headline releases (0.3.0, 0.4.0, 0.5.0), and #501 argued that additive API ships in patch releases. Patch releases have also carried behavior changes:

  • 0.4.1: code that assumed a session_id identifies one trace must catch AmbiguousSessionError.
  • 0.5.2: categorize_failed_session returns the frozen G1 category names instead of the old flag ids.
  • 0.5.1 and 0.5.3 added public modules and EventsTableNotFoundError.

By that precedent this range is 0.5.5. This PR keeps 0.6.0 because the view changes above alter what an unchanged deploy command produces, which is what the 0.x minor number exists to flag. To ship 0.5.5 instead, change the pyproject.toml line, the [0.6.0] heading and the "A minor release" lead.

Included PRs (v0.5.4...main)

PR Change In the wheel
#502 SDK.md: compaction_windows partition limitation no (docs)
#504 Drop unused imports from 11 src/ modules yes
#505 Keep the compiled-only deploy-script test offline no (tests)
#506 IAM-retry stderr in a private temp file, in two deploy scripts no (deploy, examples)
#507 BQCA Prompt & Response Logging starter notebook and manual no (examples, docs)
#508 docs/evalbench.md: the import_version pin no (docs)
#509 Dead private helpers (tracing producer, one test) and the OTLP receiver hash lock no
#510 OTel span correlation columns, Span fields and denied_columns (#312, #321) yes
#512 Agent memory demo (#511) no (examples)
#513 Browser smoke self-test readiness budget no (CI script, tests)

git diff v0.5.4..main -- src/ touches 13 files, all from #504 and #510. Apart from this PR's version line, pyproject.toml is unchanged since v0.5.4, so the wheel's dependencies are too.

Verification

  • CI on 2a4610c (head): every check that ran passed: Format check, Test (Python 3.10–3.14, 5650 passed and 81 skipped on each), Configurator browser smoke, Dashboard queries and contracts, Build package (Package version: 0.6.0), cla/google, scan-pr and check-changes. The four zizmor jobs were skipped. CI on the first commit, 385dc3c, gave the same results. The PR is MERGEABLE and waits on the required review (REVIEW_REQUIRED).

The checks below ran locally on this branch (Python 3.13, macOS arm64).

  • Build: python -m build produces bigquery_agent_analytics-0.6.0-py3-none-any.whl and bigquery_agent_analytics-0.6.0.tar.gz.
    • The wheel's top-level entries are bigquery_agent_analytics/, bigquery_ontology/ and bigquery_agent_analytics-0.6.0.dist-info/; there is no producers/ and no bigquery_ontology/docs.
    • Its METADATA says Version: 0.6.0, Requires-Dist is unchanged, and the same five console scripts are declared. The sdist's PKG-INFO says Version: 0.6.0.
    • A second build from git archive of the head commit gives the same METADATA and the same wheel file list.
    • The sdist is 34.0 MB, against 29.0 MB for 0.5.4 on PyPI. Most of the growth is feat(examples): agent memory demo — short-term, long-term and reasoning traces from agent_events #512's committed recording (demo.mp4, 4.4 MB).
  • release.yml version check: the step's run: body, diffed against the workflow, passes with GITHUB_REF_NAME=v0.6.0 (Package version: 0.6.0, Release tag: 0.6.0, exit 0). As negative controls, v0.5.4 and v0.6.0rc1 exit 1 with the ::error::Version mismatch line.
  • ci.yml "Verify package version": both artifacts match 0.6.0.
  • Format job gates:
    • the SDLC-notes guard finds nothing
    • bash autoformat.sh (pyink 25.12.0, isort 9.0.2, matching CI's pyink>=24.3.0,<26) leaves 379 files unchanged and no diff in src/ tests/ examples/ scripts/ dashboards/
    • the codelab notebook sync check passes
    • git diff --check is clean
  • Full test suite: pytest --tb=short -q with .[dev,streamlit]: 5648 passed, 83 skipped, 0 failed (5731 collected) in 2 min 41 s, including the headless-Chrome configurator smoke test and its self-test.
  • CHANGELOG claims checked against the code:
    • There are 25 per-event views. With denied_columns=["attributes"], the six named views and compaction_windows are skipped and 19 remain. By default, all 25 rendered per-event statements read attributes.
    • denied_columns="attributes" raises TypeError; ["timestamp"] and ["Content"] raise ValueError.
    • views create-all --denied-column bogus exits 2 with Invalid --denied-column: .... views create LLM_REQUEST --denied-column attributes exits 2 before any query is issued.
    • Span.from_bigquery_row() reads JSON-string and dict attributes and the legacy source_event_id, and lets view columns win over attributes. Non-string values are ignored only in the attributes fallback ({"otel": {"span_id": 123}} gives None); a truthy same-named column value is returned unchanged (otel_span_id=123 stays 123). The new fields are the last three dataclass fields.
    • Since v0.5.4, the golden per-event SQL changes only by the two added columns per view, plus a comma after is_truncated where it used to be the last column.
    • Each incidental attribute listed under Removed exists at v0.5.4 and is gone here (ttl_importer.XSD was checked with rdflib installed). extractor_compilation.CompileResult, resolved_spec.ResolvedProperty and bigquery_ontology.PropertyBinding still import.
    • The four tests/examples/test_agent_memory_*.py files pass (182 tests) with network access denied (sandbox-exec, deny network*) and no gcloud credentials.
  • Release notes preview: POST repos/{owner}/{repo}/releases/generate-notes with tag_name=v0.6.0, target_commitish=main and previous_tag_name=v0.5.4 returns the 10 PRs above, a New Contributors line for @TonyZhou05 (feat(views): expose OTel span correlation columns and Span fields (#312) #510) and the v0.5.4...v0.6.0 compare link. It created nothing: no v0.6* tag exists, and v0.5.4 is still Latest. After the merge, the generated list also includes this PR.

Not verified

  • Any BigQuery call. Views were exercised with a mocked client and the CLI offline; nothing was deployed.
  • The TestPyPI and PyPI uploads, which run only after a release is published.

Follow-ups (not in this PR)

After merge: publish runbook (release owner)

Merging does not publish. release.yml runs only when a GitHub Release is published.

  1. Merge with a non-author approval (the main ruleset requires one):
    gh pr merge 514 --repo GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK --squash --match-head-commit 2a4610c221a7113a99c810b6a0ff215a3d4fdc16
  2. Read the squash SHA:
    gh pr view 514 --repo GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK --json mergeCommit --jq .mergeCommit.oid
    It must be 40 hex characters. Before the merge it is empty, and gh release create --target "" falls back to the default branch, so never pass an empty --target.
  3. Create the release on that exact SHA:
    gh release create v0.6.0 --repo GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK --target <squash SHA> --title v0.6.0 --notes-start-tag v0.5.4 --generate-notes
    Publishing it triggers Release to PyPI.
  4. Approve PyPI: in that run, check that the commit is the squash SHA and that Build package (the tag/version check) passed. Then approve the pypi environment deployment, which has a required reviewer. TestPyPI publishes without a gate.
  5. Check that PyPI shows bigquery-agent-analytics 0.6.0.
Guarded version of steps 2–3 (creates nothing unless every check passes)

This is the block reviewed for #501, with the PR number, version and notes start tag changed. Save it to a file and run it with bash (macOS /bin/bash 3.2 works) or zsh. It needs gh and Python 3.11+ (for tomllib). It runs in a subshell, and every check stops it before gh release create, except the final tag check, which runs after the release exists. If that last check fails, do not approve PyPI.

(
set -euo pipefail
R=GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK; PR=514; VERSION=0.6.0
python3 -I -c 'import tomllib' 2>/dev/null || { echo "python3 on PATH must be 3.11 or later (tomllib); stopping." >&2; exit 1; }
state=$(gh pr view "$PR" --repo "$R" --json state --jq .state) || exit "$?"
[ "$state" = MERGED ] || { echo "PR #$PR is $state, not MERGED; stopping." >&2; exit 1; }
SHA=$(gh pr view "$PR" --repo "$R" --json mergeCommit --jq .mergeCommit.oid) || exit "$?"
[[ "$SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "Missing or invalid squash-merge SHA; stopping." >&2; exit 1; }
content=$(gh api -X GET "repos/$R/contents/pyproject.toml?ref=$SHA" --jq .content) || exit "$?"
printf '%s' "$content" | python3 -I -c '
import base64, sys, tomllib
text = base64.b64decode("".join(sys.stdin.read().split()), validate=True).decode()
version = tomllib.loads(text)["project"]["version"]
if version != sys.argv[1]:
    sys.exit("pyproject.toml [project].version is %r, not %s; stopping." % (version, sys.argv[1]))
' "$VERSION" || exit "$?"
existing=$(gh api -X GET "repos/$R/git/matching-refs/tags/v$VERSION" \
  --jq ".[] | select(.ref == \"refs/tags/v$VERSION\") | .ref") || exit "$?"
[ -z "$existing" ] || { echo "Tag v$VERSION already exists; stopping." >&2; exit 1; }
gh release create "v$VERSION" --repo "$R" --target "${SHA:?missing squash-merge SHA}" \
  --title "v$VERSION" --notes-start-tag v0.5.4 --generate-notes || exit "$?"
obj=$(gh api -X GET "repos/$R/git/ref/tags/v$VERSION" --jq '.object.type + " " + .object.sha') || exit "$?"
if [ "${obj%% *}" = tag ]; then obj=$(gh api -X GET "repos/$R/git/tags/${obj#* }" --jq '.object.type + " " + .object.sha') || exit "$?"; fi
[ "$obj" = "commit $SHA" ] || { echo "refs/tags/v$VERSION resolves to '$obj', not commit $SHA; do not approve PyPI." >&2; exit 1; }
echo "v$VERSION resolves to $SHA."
)

Run against this PR while it is open, the block stops at its first check (PR #514 is OPEN, not MERGED; stopping., exit 1) and creates nothing.

Do not

  • Do not tag or publish from this PR.
  • Merge only with a non-author approval.
…umns

Bump [project].version from 0.5.4 to 0.6.0 and cut CHANGELOG.md for
the 10 PRs merged since v0.5.4 (GoogleCloudPlatform#502, GoogleCloudPlatform#504–GoogleCloudPlatform#510, GoogleCloudPlatform#512, GoogleCloudPlatform#513).

[Unreleased] becomes [0.6.0] - 2026-10-08 with a release-highlights
lead, and a new empty [Unreleased] sits above it. The GoogleCloudPlatform#510 entries
already under [Unreleased] are kept and checked against the code:
denied_columns is keyword-only and exact-case, a bare string raises
TypeError, the six per-event views it skips are named, the CLI exits 2
on an invalid name, and the event-specific view columns move two
positions later. The SDK.md correlation guide moves to Documentation.
Every other PR in the range gets an entry marked as in the wheel or
repo side; the Removed entry lists the incidental module attributes
GoogleCloudPlatform#504 dropped.

0.6.0 rather than 0.5.5: besides new public API, per-event views now
select two more columns ahead of the event-specific ones, and over an
events table without an attributes column they deploy only with
denied_columns=["attributes"].

No code, dependency or workflow change.

@caohy1988 caohy1988 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: REQUEST_CHANGES @ 385dc3c

One P3 release-note accuracy finding meets rejection criterion 1 below. The package builds, tests and release dry-runs passed. No P0–P2 findings. The requested change is a narrow correction to the newly added changelog sentence.

Finding

P3 — Restrict the non-string ID guarantee to the attributes fallback

Location: CHANGELOG.md:41–44.

The new text says the three correlation IDs stay None on rows “with non-string values,” immediately after describing both same-named columns and attributes. That is broader than the shipped behavior. trace.py:226–235 applies _str_or_none() only to values extracted from attributes; a truthy top-level column is returned unchanged.

Reproduction against the independently built and installed 0.6.0 wheel:

# Run with: python - <<'PY' ... PY
from bigquery_agent_analytics.trace import Span

for name in ("otel_span_id", "otel_trace_id", "source_event_id"):
    value = getattr(Span.from_bigquery_row({name: 123}), name)
    print(name, repr(value), type(value).__name__)

print(Span.from_bigquery_row({
    "attributes": {"otel": {"span_id": 123}}
}).otel_span_id)

Actual output:

otel_span_id 123 int
otel_trace_id 123 int
source_event_id 123 int
None

Booleans, nonempty lists and dictionaries also pass through top-level columns. This is low severity because it concerns malformed/custom projected rows; the SDK's own OTel view columns use JSON_VALUE and produce strings. Nevertheless, the release adds an unqualified sanitization promise that its code does not implement. Please narrow the sentence to say that non-string fallback values inside attributes are ignored. Align the corresponding PR-body verification claim with that scope. No source-code change is necessary for this correction.

Disproof

Rejection criteria recorded before reading the diff

  1. A 0.6.0 CHANGELOG claim is contradicted by the merged PR or shipped code.
  2. A user-visible change since v0.5.4 is omitted or materially misclassified as wheel versus repository-only content.
  3. A version, package-content, release-workflow or publish-instruction defect can fail this release, publish the wrong artifact or tag the wrong commit under a realistic supported path.

Results: criterion 1 was met by the finding above. Attempts against criteria 2 and 3 found no demonstrated defect in the tested paths. The requested review contract makes an inaccurate changelog claim grounds for REQUEST_CHANGES, including this low-severity wording issue.

Coverage and changelog checks

Fetched origin/main and tags, verified the worktree and PR head both equal the reviewed SHA, and compared git diff v0.5.4..HEAD with the PR inventory. v0.5.4 resolves to 1304d5bff2cfc0ba7d3b9428cf5a112f9b92cbf8. The range contains exactly the ten listed merged PRs plus this release commit. A separate merged-PR lookup found no additional landing in that range. Every downloaded gh pr diff matched its actual squash-commit diff using git patch-id --stable.

PR Changelog claim checked against the actual patch/code Result
#502 SDK.md partition limitation and its regression test; no view implementation change Matches
#504 Import-only cleanup in 11 source modules All 14 listed incidental module attributes exist at the tag and disappear at head; the documented replacement imports still work
#505 Offline deploy-script test stubs and positive deploy-step assertion Matches; deploy script unchanged by this PR
#506 Both IAM helpers use private mktemp files and remove them on normal return paths Matches; associated tests pass
#507 Eight-workflow notebook, companion manual, two compatibility views, navigation links and conditional 0.5.4 installation Matches; no wheel source changes
#508 EvalBench guide documents the existing import_version selectors Matches; documentation-only patch
#509 Two dead private helpers removed and OTLP receiver lock refreshed Matches, including the named dependency pins; producer excluded from SDK wheel
#510 Three appended Span fields; JSON/dict/legacy fallback; 25 view projections; denied-column API/CLI; correlation guide Matches except the new non-string guarantee above
#512 Three memory layers, real SDK reader with offline stand-in, live analyst/consolidation paths, static assets and recording Matches; record contains 36 memory-on and 6 memory-off sessions totaling 1,606 rows; 182 offline tests pass
#513 Default 20 readiness polls, invalid-input rejection and four-poll negative fixture Matches; browser smoke and its self-test pass

For #510, independent probes confirmed 25 default per-event statements read attributes; at v0.5.4, six do and 19 do not. With denied_columns=["attributes"], exactly the six named per-event views plus compaction_windows are skipped, and 19 query calls remain. Invalid names, exact-case validation, the bare-string TypeError, pre-query single-view rejection and CLI exit 2 all behaved as described. Removing the two new projections from the golden SQL reproduces the old snapshot exactly, confirming the column-position warning. The Span fields are appended; valid projected strings, JSON/dict attributes and the legacy source-event key were exercised.

The two-file release format matches #487 and #501. I found no basis to reject the maintainer's 0.6.0 choice: the documented view-position and missing-attributes deployment changes are real.

Artifact and release-path attempts

  • Built both v0.5.4 and this head from separate clean git archive trees with python -m build, including wheel construction from the sdist. Head produced bigquery_agent_analytics-0.6.0-py3-none-any.whl and bigquery_agent_analytics-0.6.0.tar.gz; wheel METADATA and sdist PKG-INFO both report 0.6.0. python -m twine check --strict passed for both head artifacts.
  • Compared actual wheels: the same package-file inventory, the same five console scripts, and all 43 Requires-Dist entries unchanged. Exactly 13 shipped source files differ, matching the complete source diff. Top-level entries are the two intended packages and dist-info; no examples, producer, root docs or bigquery_ontology/docs enter the wheel. Head sdist is 34,022,326 bytes versus 29,049,483 bytes for the clean baseline build.
  • Installed the built wheel and ran independent API/CLI probes against site-packages. Runtime metadata reports 0.6.0; telemetry normalizes it to 0-6-0, and the graph compiler metadata reports bigquery_ontology 0.6.0.
  • Extracted and executed the actual release workflow version-check body: v0.6.0 exits 0; v0.5.4, v0.6.0rc1 and tracing-v0.6.0 exit 1 with ::error::Version mismatch. The workflow's separate tag-prefix job condition excludes tracing releases. The CI artifact-version step also exits 0.
  • Executed the PR body's exact guarded publication block using a local gh stub in /bin/bash and /bin/zsh: 26 cases. Open PR, empty/invalid merge SHA, wrong version, malformed content, existing tag and API failures stop before the create call. Valid lightweight and annotated-tag responses pass, preserving the exact merge SHA in --target and v0.5.4 in --notes-start-tag. Creation errors and failed/wrong post-creation tag checks exit nonzero. As the body states, the final check happens after creation; these tests did not create any real release or tag.
  • Read the head's successful CI check runs, release workflow and prior successful v0.5.4 release jobs. Confirmed the PyPI environment requires a reviewer and TestPyPI has no reviewer gate. At review time, the v0.6 tag lookup returned no refs, and both PyPI and TestPyPI version-specific 0.6.0 lookups returned HTTP 404.

Tests and limits

python -m pytest --tb=short -q --junitxml=... completed with 5,764 passed, 67 skipped, 0 failed in 256.65 seconds on Python 3.13.5. Both real-browser checks passed. This environment includes optional rdflib, so its collected test count differs from the PR body's environment. A separate run of the four agent-memory test files with sandbox-exec denying network access, an unavailable ADC file and an empty Cloud SDK configuration passed 182 tests. git diff --check and the codelab notebook-sync check passed; the worktree is clean.

The initial unrestricted dependency installation hit this machine's native build-tool failure for cryptography 50.0.2. Runtime tests therefore used compatible binary distributions (cryptography 48.0.1); no repository dependency was changed. The isolated package builds succeeded independently of that limitation.

No live BigQuery/model execution, actual upload, trusted-publisher authentication, or new-tag environment deployment was attempted. Existing CI success and local stubs do not prove those external operations will succeed. No code was pushed, merged or tagged.

Local evidence: /Users/haiyuancao/Documents/bqaa-release-060/astra-evidence/ contains the recorded criteria, PR coverage, artifact/probe logs and scripts, full JUnit results and offline-test output. The review was formed from the PR body, code, commits and merged-PR patches without loading PR review/comment endpoints or the context vault.

VERDICT: REQUEST_CHANGES @ 385dc3c

@caohy1988 caohy1988 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: APPROVE @ 385dc3c

Blind review of #514 (release 0.6.0), round 1

Reviewed head 385dc3c3080d21a0f580c56b7452eb1635906d21 in a worktree checked out at that SHA, with origin tags fetched. Inputs: the PR body, the release commit, git diff v0.5.4..HEAD, the diffs and bodies of the ten merged PRs, release.yml, ci.yml, the CI runs on the head SHA, and local builds and test runs. Not read: any comment or review on this PR. Disclosure: my private notes index carried a one-line pointer that named #514 before I started; I did not open that note.

The diff is two files, as in #487 and #501: pyproject.toml (0.5.4 → 0.6.0, one line) and CHANGELOG.md (+164/−28). git diff v0.5.4..HEAD -- pyproject.toml .github/ shows only the version line, so dependencies, extras, console scripts and workflows are unchanged since v0.5.4.

Disproof

Rejection criteria, written before reading the diff:

  • R1 CHANGELOG mismatch. An entry whose claim (behaviour, PR number, in-wheel vs repo-only) does not match the merged code, or a user-visible change since v0.5.4 that is missing.
  • R2 Version/artifact mismatch. Any version string left at 0.5.4, or anything that makes release.yml fail or publish the wrong artifact (tag check, build, metadata, wheel contents).
  • R3 Wrong-commit risk. A workflow or runbook step that could tag or publish something other than the merged release commit.

Result: none met. Evidence per criterion follows.

R1: every CHANGELOG entry against the merged code

Range check: git log --oneline v0.5.4..HEAD lists exactly the ten PRs the CHANGELOG covers (#502, #504–#510, #512, #513) plus this commit. The two gaps, #503 and #511, are issues, not PRs (#511 is the one #512 closes). git diff --name-status v0.5.4..HEAD touches 61 files; every one maps to a listed PR, and src/ is touched by #504 and #510 only (13 files), as the PR body says.

Entry What I checked Result
Added: Span OTel fields (#312 / #510) dataclasses.fields(Span); Span.from_bigquery_row() on JSON-string attributes, dict attributes with legacy source_event_id, non-string values, a row where the view column and attributes disagree, and a bare row New fields are the last three, in the stated order. JSON string and dict both read; legacy key read; 123/None → None; view column wins; bare row → all None. #312, #209, #220, #320, #321 are the issues named (titles match the topics). SDK.md:175 states google-adk>=2.4.0.
Added: ViewManager(denied_columns=...) (#321 / #510) inspect.signature (views.py:580-594); construction with "attributes", ["timestamp"], ["Content"], ["ATTRIBUTES"], positional Keyword-only; bare string → TypeError; other names and wrong case → ValueError; positional → TypeError. create_all_views() with a fake client and denied_columns=["attributes"] returned 19 views, issued 19 queries, skipped exactly A2A_INTERACTION, LLM_REQUEST, LLM_RESPONSE, STATE_DELTA, TOOL_COMPLETED, TOOL_PAUSED and did not create compaction_windows; default run creates 26 (25 + compaction_windows). create_view("LLM_REQUEST") raised ValueError with zero queries issued.
Added: --denied-column CLI views create-all --denied-column bogus and views create LLM_REQUEST --denied-column attributes through CliRunner with a counting fake client; --help for both subcommands Both exit 2 with Invalid --denied-column: ... / reads denied column(s), zero queries; the flag appears in both help texts (cli.py:1868-1906, Optional[list[str]], so repeatable).
Changed: per-event views select two more columns git diff v0.5.4..HEAD -- tests/fixtures/views/per_event_views.golden.sql line classes; get_view_sql("LLM_REQUEST") Diff is exactly 25 × otel_span_id, 25 × otel_trace_id (5 without a trailing comma where it became the last column) and 5 × is_truncated → is_truncated,. The two columns sit after is_truncated and before model. At v0.5.4 (tree from git archive), 6 of 25 per-event views read attributes (the same six), so "19 deployed before, 19 deploy now with the opt-in" is correct; at 0.6.0 all 25 default statements read attributes.
Removed: unused imports (#504) Imported each of the 14 listed attributes from the v0.5.4 tree and from HEAD (rdflib installed for ttl_importer.XSD) All 14 exist at v0.5.4 and are gone at HEAD; extractor_compilation.CompileResult, resolved_spec.ResolvedProperty, bigquery_ontology.PropertyBinding, rdflib.XSD still import. The two other removed lines (cli.py ResolvedGraph, feedback.py bigquery) were indented local/type-checking imports and never module attributes, so the list is complete. None of the 14 names appears in any __all__ or in docs. 11 modules, import lines only.
Examples: agent memory demo (#511 / #512) README and recorded-run README; live_run.json; source greps; test run 42 sessions in live_run.json (36 with memory + 6 without), 1,606 rows, run dated 2026-10-07; gemini-3.8-flash in analyst_agent.py; AI.GENERATE, AI.EMBED, ML.DISTANCE in memory_consolidation.py; get_context() at memory_layers.py:1176; --project-id/--dataset-id in the demo; demo.mp4 4,448,106 bytes, viz/index.html, narration.md; offline_bigquery.py raises NotImplementedError on anything it does not model. The four tests/examples/test_agent_memory_*.py files contribute 182 test cases, all passed.
Examples: BQCA notebook and manual (#507) Notebook H2 headings; view ids; install cell; README rows; link targets Eight H2 sections matching the entry; COMPAT_VIEW_ID = "v_bqca_customer_sdk_events", TURNS_VIEW_ID = "v_bqca_customer_turns", both created with CREATE OR REPLACE VIEW; install cell runs _pip("bigquery-agent-analytics[llm]==0.5.4") only when the installed version parses < (0, 5, 4); README.md and examples/README.md each gained one row. All repo links point at GoogleCloudPlatform/..., so issue #503 (links to a personal repo) does not recur here.
Documentation: correlation guide (#510) Headings added to SDK.md; option names; recipes Six new headings (Trace & Span Correlation, Producer configuration, Reading correlation IDs, Which OpenTelemetry span a row records, Join recipes for an otel_spans table, OTel correlation columns and denied_columns); enable_otel_correlation, custom_metadata_allowlist, payload_column_denylist all present; two otel_spans joins, each under WHERE timestamp BETWEEN @start_ts AND @end_ts; a 14-callback span table. No QUALIFY/DISTINCT in the recipes, which confirms the PR body's dedupe follow-up. denied_columns and --denied-column are documented at SDK.md:1623-1661.
Documentation: compaction_windows limitation (#502) git show 6e536dc Seven-line SDK.md note (no timestamp, no pruning, require_partition_filter failure, adk_event_compactions not a drop-in) plus test_partition_limitation_is_documented, which asserts the view row has no timestamp and the SDK.md section names both.
Documentation: EvalBench import_version pin (#508) git show e158bf6; evalbench.py:2410-2430 and :2652-2680 Doc text matches; the code it describes is real: trace_selector() returns session_id, experiment_id, import_version; trace_filter() raises ValueError on an empty session set and returns TraceFilter(..., session_ids=..., import_version=self.import_version). #463 is the native-writer issue.
Security: IAM-retry stderr (#506) _retry_iam at deploy/skill_evolution_job/deploy.sh:372-396 and examples/context_graph/periodic_materialization/deploy_cloud_run_job.sh:483-507 mktemp -t bqaa-iam-err-XXXXXXXX (0600, random name), removed on all three return paths; a mktemp failure returns 1 before any file exists; the 20 × 3 s retry loop is unchanged. Old code wrote /tmp/_iam_err.$$.
CI: compiled-only deploy test offline (#505) git show 9acf16a Only tests/test_materialize_window.py changed; stubs python3 (exit 0), bq, gcloud (fail fast) on a prepended PATH; positive assertion "==> ensuring graph dataset exists: p:g".
CI: browser smoke readiness budget (#513) browser_smoke.sh:81-85, :654-664, :511; test_browser_smoke_rejects_invalid_readiness_budget READY_POLLS="${SMOKE_READY_POLLS:-20}" validated at line 82 before find_chrome (88) and the first server start (142); loop is seq 1 "$READY_POLLS" with sleep 0.5; the self-test fixture passes SMOKE_READY_POLLS=4; test parametrised over 0, -1, abc.
CI: dead helpers and hash lock (#509) git show 2e9331c -- producers/ tests/; lock pins Removes _str from producers/.../otlp/writer.py and _common_args from tests/test_extractor_compilation_cli_revalidate.py; requirements.lock has cryptography==50.0.2, google-auth==2.60.0, google-cloud-bigquery==3.46.1, opentelemetry-api/sdk==1.45.1. The only tracing tag, tracing-v0.1.0, has no _str in that file, so "no tracing release includes it" holds.
Release highlights paragraph and structure GitHub markdown API render of lines 10–187 Renders one h2 and eight h3s in the stated order; the wrapped line starting #509, #513). is not a heading; [Unreleased] is present and empty; no compare-link footers exist to update (only a [#187] issue link at line 1278). All 17 issue/PR references resolve.

Missing-change search: README.md and examples/README.md changes are the #507/#512 rows (covered); tests/test_adk2_event_types.py is test-only. No user-visible change since v0.5.4 is unlisted.

R2: version strings, build, metadata, workflow checks

  • Version strings. git grep for __version__ and 0.5.4 outside CHANGELOG: the SDK has no __version__ constant (the __version__ hits are the separately versioned tracing producer and the skill-evolution job at 0.1.0). _telemetry._read_version() and bigquery_ontology.cli._default_compiler_version() both read importlib.metadata. No lock, requirements or Dockerfile pins this package (deploy/skill_evolution_job/requirements.txt has >=0.5.1). The remaining 0.5.4 strings are the #507 notebook/manual and examples/agent_memory/offline_bigquery.py:45, which the PR body already lists as follow-ups.
  • Build. python -m build (arm64 Python 3.13.7, hatchling) produced bigquery_agent_analytics-0.6.0-py3-none-any.whl (703,165 bytes) and bigquery_agent_analytics-0.6.0.tar.gz (34,022,326 bytes), the same byte sizes the CI Build-package job logged. twine check PASSED on both. Wheel top level: bigquery_agent_analytics/ (78 files), bigquery_ontology/ (15), dist-info (5); zero bigquery_ontology/docs entries. METADATA Version: 0.6.0; Requires-Dist, Requires-Python and License lines identical to a wheel built from git archive v0.5.4 (diff is the Version line only); the same five console scripts. Module file list identical to the 0.5.4 wheel, consistent with "no public API removed or renamed". A build from git archive HEAD gives identical wheel and sdist file lists and identical METADATA; building a wheel from the sdist gives the same file list.
  • Clean install. The wheel installed into a fresh venv: importlib.metadata.version → 0.6.0, _read_version() → 0-6-0, gm reports bigquery_ontology 0.6.0, bq-agent-sdk --help runs.
  • release.yml tag check. Extracted the Verify package version matches release tag run: body with a YAML parser and ran it against the HEAD pyproject.toml: GITHUB_REF_NAME=v0.6.0 → Package version: 0.6.0, Release tag: 0.6.0, exit 0; v0.5.4 and v0.6.0rc1 → ::error::Version mismatch, exit 1. The build job guard startsWith(tag_name, 'v') admits v0.6.0 and skips tracing-v*. release.yml is the only workflow on the release event; release-tracing.yml triggers on tracing-v* tag pushes only. The ci.yml Verify package version step passes against the built dist/.
  • CI on the head SHA. actions/runs?head_sha=385dc3c… shows four completed runs, all success (no action_required): Format check, Test 3.10–3.14, Configurator browser smoke, Dashboard queries, Build package (Package version: 0.6.0), scan-pr, check-changes, cla/google; zizmor jobs skipped. The Python 3.13 job logged 5650 passed, 81 skipped, as the PR body says. The main ruleset requires Test (Python 3.10–3.14) and Format check and one approving review.
  • Local tests. .[dev,streamlit,owl] + pytest -q: 5764 passed, 67 skipped, 0 failed in 2 min 37 s (5831 collected). The extra 100 cases over CI are the rdflib-gated tests that CI skips because it installs only .[dev,streamlit]. git diff --check on the PR diff is clean. (A first attempt under a timeout wrapper collected under Rosetta and failed to load arm64 wheels; that was my toolchain, not the code, and the native rerun is the result above.)
  • Upstream state. No v0.6* tag or release exists; v0.5.4 is still Latest. POST releases/generate-notes (v0.6.0, main, previous v0.5.4) lists exactly the ten PRs, a New Contributors line and the v0.5.4...v0.6.0 compare link; it created nothing.

R3: can the release path tag or publish the wrong commit?

  • The workflow builds from the release's own ref (actions/checkout on the release event checks out the tag) and compares that commit's pyproject.toml to the tag, so a tag placed on a pre-bump commit fails the build job, as the negative controls above show.
  • The runbook merges with --squash --match-head-commit 385dc3c…, reads mergeCommit.oid, and targets that SHA. The PR body's warning that an empty --target falls back to the default branch is the right one, and the guarded block covers it.
  • I dry-ran the guarded block under /bin/bash 3.2.57 and zsh 5.9 with a logging fake gh on PATH (no network). Scenarios and outcomes, identical in both shells: PR OPEN → PR #514 is OPEN, not MERGED; stopping. exit 1, nothing created; empty merge SHA → stop, nothing created; pyproject.toml at the SHA says 0.5.4 → stop, nothing created; refs/tags/v0.6.0 already exists → stop, nothing created; happy path → one gh release create v0.6.0 --repo … --target <sha> --title v0.6.0 --notes-start-tag v0.5.4 --generate-notes, then v0.6.0 resolves to <sha>. exit 0; annotated tag object → dereferenced to the commit, exit 0; tag resolving to a different commit → exit 1 with do not approve PyPI. The block contains no rm and makes no call outside gh and python3.
  • Publishing gates match the PR body: environment pypi has required reviewer caohy1988 plus a branch policy; testpypi has no reviewers; release-promote belongs to the tracing pipeline.

Findings

No P0, P1 or P2.

  • P3 (preference, not a change request): 0.6.0 vs 0.5.5. Evidence on both sides is as the PR body states. For 0.6.0: create_all_views() over a denylisted table changes from "19 views deploy" to "nothing deploys without the opt-in", and every per-event view's column positions shift; both are default-behaviour changes rather than additions. For 0.5.5: #501 stated the project's precedent as "minor for headline releases, additive API in patches", and 0.4.1 / 0.5.2 shipped behaviour changes as patches. Either number is defensible under 0.x; I would keep 0.6.0 for the reasons given, and the only edits for 0.5.5 are the three the PR body names.
  • P3 (follow-up, outside a two-file release PR): the #507 notebook and manual pin 0.5.4. examples/bqca_prompt_response_logging_customer_notebook.ipynb:122/130/134 installs ==0.5.4 (or @v0.5.4 from git) when the SDK is missing or older, and both titles say v0.5.4 (docs/guides/bqca-prompt-response-logging-manual.md:2,106,209). After the release, a fresh Colab run of the starter notebook installs 0.5.4, not 0.6.0. It keeps working, as the PR body says; it just lags. Already listed under Follow-ups.
  • P3 (hygiene, pre-existing): the sdist carries the whole repo. Hatchling's default sdist includes examples/, so the 4.4 MB demo.mp4, viz/data/memory_export.json and screenshot.png ride in the 34.0 MB sdist (29.0 MB at 0.5.4). Well under PyPI's limits and not a release risk; a [tool.hatch.build.targets.sdist] exclude for recordings would be a reasonable later cleanup.

Not verified

  • Any BigQuery call: views and CLI were exercised with a fake client; nothing was deployed.
  • The TestPyPI and PyPI uploads and the pypi environment approval, which run only after a release is published.
  • The main ruleset's non-author approval requirement was read from the API, not exercised.

VERDICT: APPROVE @ 385dc3c

…fallback

The [0.6.0] Span entry said the three correlation IDs stay None on rows
"with non-string values". Span.from_bigquery_row() applies that check
only to values it reads from attributes: a truthy same-named column
value is returned unchanged ({"otel_span_id": 123} gives 123), while a
non-string value in attributes is ignored and gives None. Say that the
attributes fallback ignores non-string values, and that the fields stay
None on rows without those columns or keys.

CHANGELOG wording only; the version stays 0.6.0.

@caohy1988 caohy1988 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: APPROVE @ 2a4610c

Blind release review of the pinned head against v0.5.4. No P0, P1, P2, or P3 findings. The attempted disproof below did not establish a rejection criterion. This verdict is submitted as a COMMENT, not a GitHub approval event.

Disproof

Before reading the diff, I recorded these rejection criteria:

  1. A changelog claim contradicts the merged code, omits a material user-visible change, or presents repo-only work as shipped package behavior.
  2. The version, build, or package contents would make the release workflow fail or publish the wrong artifact.
  3. The publish instructions could tag the wrong commit.

1. Changelog accuracy and completeness

Commands: git fetch origin main --tags, git log v0.5.4..HEAD, git diff v0.5.4..HEAD, and gh pr view --json number,title,body,mergeCommit,mergedAt,files / gh pr diff for #502, #504, #505, #506, #507, #508, #509, #510, #512, and #513. I also fetched the bodies/diffs of the #487 and #501 release precedents. No PR reviews or comments were consulted.

The ten merged PR file lists exactly match their git commits; their union is the complete 60-file v0.5.4..main change set. This release adds only the version edit and changelog cut. Only #504 and #510 touch src/: 13 distinct files, with cli.py shared by both PRs. The older changelog sections remain unchanged.

PR Changelog location Attempt and result
#502 CHANGELOG.md:142 Checked the SDK reference addition and its regression test against the unchanged compaction SQL: the limitation and non-equivalent per-event alternative are accurately described as documentation.
#504 CHANGELOG.md:86 Diff contains imports only in 11 modules. Imported baseline and head modules with RDF support present: all 14 listed incidental module attributes exist at 0.5.4 and disappear at head; every stated alternative import succeeds. The two function-local removals do not add missing module attributes to the list.
#505 CHANGELOG.md:169 The actual test diff shadows python3, bq, and gcloud, and asserts the first deploy step. No production script change belongs to this PR.
#506 CHANGELOG.md:158 Both actual shell diffs replace the predictable stderr path with mktemp, retain retry behavior, and remove the file on their normal return paths. The symlink, file-mode, and retry tests passed in the full suite. Correctly excluded from the wheel.
#507 CHANGELOG.md:122 Inspected notebook code and manual: all eight described subject areas, two compatibility views, nested response handling, doctor/ping, notebook-local adapters, and conditional 0.5.4 installation are present. Both README links are in the diff. No wheel behavior is attributed to the adapters.
#508 CHANGELOG.md:148 Matched the documentation to evalbench.py:2410 and :2652: both helper paths carry import_version. The source implementation was already present at the previous tag.
#509 CHANGELOG.md:181 Checked the two private-helper deletions and actual hash-lock diff, including all named versions. The producer is outside the SDK wheel; the fetched tracing tags contain only tracing-v0.1.0.
#510 CHANGELOG.md:39, :53, :72, :136 Independently exercised the correlation, view, and CLI claims as detailed below. Inspected both partition-bounded join recipes and the guide additions. Verified the advertised opt-in producer fields against upstream ADK's v2.4.0 source.
#512 CHANGELOG.md:102 Checked the three-layer example, real SDK read path, rejecting offline SQL stand-in, provenance, model/table constants, extraction/embedding/recall SQL, and committed recording/export. The record has 36 memory=on sessions, 6 off, and 1,606 rows. All 182 example tests passed with network access denied. Correctly excluded from the wheel.
#513 CHANGELOG.md:175 Actual diff preserves the default 20 polls, gives fixture 13 four polls, and validates bad budgets before startup. Its tests, including browser gates, passed.

Independent #510 probes against the installed package and baseline source:

  • All 25 rendered per-event statements are byte-identical to 0.5.4 after removing the two inserted OTel columns. Both event registries and the cross-event SQL are unchanged.
  • A mock rejecting SQL that reads a missing attributes column produced 19 / 0 / 19 created views for 0.5.4 default / 0.6.0 default / 0.6.0 with the denylist. The six named per-event views plus compaction_windows are precisely the skipped set.
  • Exercised all 16 subsets of the four allowed denied columns: no issued statement references a denied column. Confirmed keyword-only argument, exact-case validation, bare-string TypeError, and single-view rejection before a query.
  • Invalid-name views create-all and denied-view views create both exit 2, without constructing a BigQuery client.
  • Exercised dict and JSON-string attributes, absent/malformed attributes, legacy source IDs, column precedence, unchanged tree IDs, and appended dataclass fields. Non-string fallback IDs are ignored; a truthy non-string column value survives. The revised changelog correctly limits its guarantee to the attributes fallback (CHANGELOG.md:45).

The view compatibility evidence supports the maintainer's 0.6.0 choice. I found no version-policy defect requiring a change to 0.5.5.

2. Build, contents, version, and tests

Built independent clean git archive trees of the pinned head and v0.5.4 using python -m build; this also builds each wheel from its sdist.

head: bigquery_agent_analytics-0.6.0-py3-none-any.whl  703165 bytes
head: bigquery_agent_analytics-0.6.0.tar.gz            34022335 bytes
base: bigquery_agent_analytics-0.5.4.tar.gz            29049483 bytes
twine check <head wheel> <head sdist>: PASSED / PASSED

Both metadata versions are 0.6.0. The wheel contains the two intended packages and dist-info, with no producer, examples, or ontology docs. All package payload bytes match the archived head; no payload files were added or removed, and exactly 13 changed. Requires-Dist and all five console scripts are identical to the baseline. The sdist includes repository examples and the video, consistent with the disclosed size increase. Installed runtime metadata produces sdk_version=0-6-0 and compiler version bigquery_ontology 0.6.0.

Executed the exact release.yml:56 shell body, extracted from the workflow, under bash with -e -o pipefail:

GITHUB_REF_NAME=v0.6.0       -> exit 0; Package version: 0.6.0; Release tag: 0.6.0
GITHUB_REF_NAME=v0.5.4       -> exit 1; ::error::Version mismatch
GITHUB_REF_NAME=v0.6.0rc1    -> exit 1; ::error::Version mismatch
GITHUB_REF_NAME=v0.6.1      -> exit 1; ::error::Version mismatch
GITHUB_REF_NAME=tracing-v0.1.0 -> exit 1 in the isolated version step

The complete workflow excludes tracing releases earlier via its job condition (release.yml:38). The exact CI artifact-version step also passes. git diff --check and the final worktree status are clean.

Local validation, Python 3.13.7 arm64, installed with [dev,streamlit,owl]:

python -m pytest --tb=short -q
5764 passed, 67 skipped, 20 warnings in 166.52s

sandbox-exec -p '(version 1) (allow default) (deny network*)' <python> -m pytest <four agent-memory test files> -q
182 passed in 11.72s

The initial Intel-interpreter dependency installation hit a local compiler architecture mismatch; switching to native ARM resolved it without changing dependencies. The optional RDF extra makes the local test count differ from the PR's environment. I separately inspected CI run 37745328931, verified its head SHA, and read all five test summaries: 5650 passed, 81 skipped on each Python 3.10–3.14 job, plus Package version: 0.6.0. The listed passing/skipped check statuses match the body.

3. Attempt to break the publish runbook

Extracted the body's guarded block verbatim and executed it under bash 3.2 and zsh, replacing gh with a strict local stub that never delegates to the real CLI. 13 scenarios per shell passed:

  • OPEN state, empty/invalid merge SHA, API failure, content-fetch failure, corrupt base64, version mismatch, tag-query failure, and existing exact tag all stop before the mocked release creation.
  • Creation failure propagates its failure status.
  • Successful lightweight and annotated tag scenarios pass, and the creation arguments contain exactly the validated 40-character SHA, v0.6.0, and the expected notes start tag.
  • A wrong resolved tag target fails the final check. This is a post-creation check, as the body explicitly states; it is not an atomic tag-creation guarantee.

Inspected the manual path's pinned --match-head-commit, squash-SHA retrieval, and explicit --target. Read-only GitHub API checks confirm a required reviewer for pypi, no protection gate for testpypi, and no current v0.6* tag. The workflow builds from the release event checkout and passes the same uploaded dist artifact to both publishers. I found no release-specific wrong-target or wrong-artifact path in the documented procedure.

Limits

No live BigQuery deployment, model execution, TestPyPI/PyPI upload, merge, tag, or release creation was performed. The SQL checks use mocks/source comparison; the committed live-record counts were checked without rerunning that workload. External publishing credentials, index acceptance, and concurrent tag mutation were not exercised. The PR already discloses the notebook's older install pin and raw-OTLP join replay limitation.

VERDICT: APPROVE @ 2a4610c

@haiyuan-eng-google
haiyuan-eng-google merged commit 98cbf8c into GoogleCloudPlatform:main Oct 8, 2026
16 checks passed
@caohy1988 caohy1988 mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants