Skip to content

Release 0.5.4: compaction_windows view, smoke-test unpickling allowlist - #501

Merged
haiyuan-eng-google merged 3 commits into
mainfrom
release/0.5.4
Sep 29, 2026
Merged

haiyuan-eng-google merged 3 commits into
mainfrom
release/0.5.4

Conversation

@caohy1988

@caohy1988 caohy1988 commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This bumps the version from 0.5.3 to 0.5.4 and cuts the CHANGELOG for the 10 PRs merged since v0.5.3 (#490–#497, #499, #500). Like #487, it touches two files: pyproject.toml and CHANGELOG.md. It is a patch release: no public API is removed or renamed, and the wheel's dependencies are unchanged.

Why 0.5.4 and not 0.6.0

This project bumps the minor version for headline releases: 0.3.0, 0.4.0, and 0.5.0 (LangSmith export plus Grafana). Additive API ships in patch releases: 0.4.1, 0.5.1, 0.5.2 and 0.5.3. The 0.5.3 release added EventsTableNotFoundError, new extras, and the cross-event registry that #494 now fills.

This range is smaller than any of those releases:

  • one additive view
  • one security hardening
  • private and incidental-import cleanup
  • docs, tests, CI and lock files

That fits the project's patch-release precedent, though it is not a promise of full behavioral compatibility. This wheel has two compatibility effects, both described in the CHANGELOG:

The tracing path changes (#499) belong to the separately versioned producer and are not in this wheel.

Verification (local, on this branch)

  • python -m build produces bigquery_agent_analytics-0.5.4-py3-none-any.whl and bigquery_agent_analytics-0.5.4.tar.gz. The wheel contains only bigquery_agent_analytics and bigquery_ontology, not producers/.

  • ci.yml "Verify package version" passes on the built artifacts.

  • release.yml's tag check passes when simulated with GITHUB_REF_NAME=v0.5.4: pyproject 0.5.4 equals tag 0.5.4.

  • The CI Format-job gates pass:

    • the SDLC-notes guard finds nothing
    • autoformat.sh leaves no diff in src/ tests/ examples/ scripts/ dashboards/
    • the codelab notebook sync check passes
  • Full pytest --tb=short -q with .[dev,streamlit] on Python 3.12: 5277 passed, 83 skipped, 0 failed (4 min 41 s, including the live headless-Chrome configurator smoke test)

  • git diff --check is clean.

  • The audit: restrict unpickling of smoke-test child output (nightly security) #492 claim was checked by running _restricted_loads on pickled ExtractedProperty values:

    • accepted: str, int/float/bool/None in a dict/list, sets, tz-aware datetime, Decimal
    • refused: a custom class instance, uuid.UUID
  • The second commit (44c1d71) changes only CHANGELOG wording after review:

    • the complete list of removed incidental names
    • chmod go-w
    • the log-directory symlink scope
    • the platform fallbacks

    After it, the wheel and sdist were rebuilt, git diff --check is clean, and the longest line in [0.5.4] is 76 characters.

  • The third commit (699c31a) only changes the [0.5.4] date to 2026-09-29.

After merge (release owner only)

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

Copy the release step below, save it to a file, and run it with Bash: pbpaste > /tmp/v0.5.4-release.sh && bash /tmp/v0.5.4-release.sh (macOS /bin/bash 3.2 works). It needs gh and Python 3.11+ (for tomllib). Pasting it into zsh also works. Don't paste it into macOS /bin/bash 3.2: that shell has no bracketed paste, so a long paste can lose characters and leave the prompt waiting with nothing run.

The block runs in a subshell, so a failed check ends only the block. Each check has an explicit stop, and every gh call's exit status is checked, so a failed check or lookup stops the block. Every check except the final tag check runs before gh release create. Before the PR merges, mergeCommit.oid is empty, and gh release create --target "" falls back to the default branch, which would tag main.

(
set -euo pipefail
R=GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK; PR=501; VERSION=0.5.4
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.3 --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."
)

The final check reads the exact ref refs/tags/v0.5.4, so a branch named v0.5.4 cannot satisfy it, and it peels an annotated tag to its commit.

This produces the same flat body as v0.5.3. You can add a short --notes pointer to the CHANGELOG and a note that #499 is not in this wheel.

The tag check and gh release create are separate calls, not one atomic step. If someone else creates v0.5.4 between them, GitHub publishes the release on that tag and ignores --target. If that tag is on another commit, the block's last check fails after the release exists: do not approve PyPI then.

Approve PyPI only after the block has printed v0.5.4 resolves to <squash SHA>:

  1. Wait for the run's Build job (the version check) to pass.
  2. Check again that v0.5.4 still resolves to the squash SHA. There must be exactly one "Release to PyPI" run for v0.5.4; if there is more than one, stop and find out why before approving anything. On that run's page, confirm the commit is the squash SHA and Build package passed. Then approve the pypi environment deployment. It has a required reviewer; TestPyPI publishes without a gate.
  3. Check that PyPI shows bigquery-agent-analytics 0.5.4.

Do not

  • Do not tag or publish from this PR.
  • Merge only with a non-author approval (haiyuan-eng-google): the ruleset requires one, and the author cannot approve their own PR.
…g allowlist

Bump the version to 0.5.4 and cut the CHANGELOG for the ten PRs merged
since v0.5.3 (#490–#497, #499, #500). [Unreleased] is left empty; the
#494 entry moves into [0.5.4].
List every incidental name #490/#496 removed and where each lives
now, fix the permission repair to `chmod go-w`, scope the log-dir
symlink rule to logs outside the state directory, and qualify the
tracing checks' platform fallbacks.
@caohy1988
caohy1988 marked this pull request as ready for review September 29, 2026 16:47
@haiyuan-eng-google
haiyuan-eng-google merged commit 1304d5b into main Sep 29, 2026
16 checks passed
haiyuan-eng-google pushed a commit that referenced this pull request Sep 30, 2026
…ghtly) (#502)

* audit: document compaction_windows partition limitation in SDK.md (nightly)

The 0.5.4 CHANGELOG (#501) records a known limitation of the
compaction_windows view (#494): it exposes no event `timestamp`
column, so a query through it reads every partition of the events
table and fails on a table that sets `require_partition_filter`.
SDK.md's compaction_windows section, the view's reference doc, did
not say so.

Add the limitation to SDK.md, with a pointer to the
adk_event_compactions per-event view for time-bounded queries. A new
test ties the note to the view: it fails while the view has no
`timestamp` column and SDK.md omits the limitation, and it fails once
a `timestamp` column is added, so the note goes away with that fix.

* audit: scope compaction_windows doc test to its SDK.md section (nightly)

Review of c3c5cc8 found that test_partition_limitation_is_documented
searched all of SDK.md for `require_partition_filter`. The test still
passed after the limitation paragraph was deleted, as long as the token
appeared anywhere else in the file.

Scope the search to the "Cross-event views" section, and require one
paragraph there to name both `require_partition_filter` and the
`adk_event_compactions` pointer. A renamed heading now raises
ValueError instead of widening the search.

SDK.md now also says that `adk_event_compactions` is not a drop-in
replacement: it does not deduplicate windows or skip malformed
boundaries, and it has `agent` rather than `app_name`.
@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