-
Notifications
You must be signed in to change notification settings - Fork 8
chore: release main #506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stainless-app
wants to merge
3
commits into
main
Choose a base branch
from
release-please--branches--main--changes--next
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
chore: release main #506
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| ".": "0.25.0", | ||
| "adk": "0.25.0" | ||
| ".": "0.26.0", | ||
| "adk": "0.26.0" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| configured_endpoints: 75 | ||
| openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-7acaeb315af90255109ae17afc71e32a8e5851bb8a956a2a284cb4d344dfab51.yml | ||
| openapi_spec_hash: 3044e94b48d60311b6048e8df88e7552 | ||
| openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-7074b9156acbeefa63e9ca2173e9c22768268e894a48f511ec902fdcff043407.yml | ||
| openapi_spec_hash: 400e8dc4ce4d49db45e2943f67fe255a | ||
| config_hash: 593e89b291976a5e84e4c3c3f8324354 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
|
||
| __title__ = "agentex" | ||
| __version__ = "0.25.0" # x-release-please-version | ||
| __version__ = "0.26.0" # x-release-please-version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| """Opt-in stamping of the agent's source commit onto its spans. | ||
|
|
||
| Nothing is stamped until the agent calls :func:`enable`, mirroring the | ||
| ``lineage`` registry next door: a process-wide switch the agent sets once at | ||
| import, rather than automatic behaviour every agent inherits. When enabled the | ||
| resolved commit lands in span data under ``__commit_sha__`` and is searchable in | ||
| the SGP Traces UI as ``__commit_sha__:<sha>``. | ||
|
|
||
| This is deliberately separate from ``__agent_version__``, which is automatic and | ||
| carries the deployed image tag verbatim ("image tag or git sha"). That tag is a | ||
| real commit on some build paths but an ``<image-name>-<sha>`` composite (AWS | ||
| ECR), ``latest``, or a hand-passed tag on others -- so a field named for a commit | ||
| must not simply mirror it. Values that are not git object names are refused, and | ||
| a field named ``__commit_sha__`` therefore only ever holds one. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| import re | ||
|
|
||
| from agentex.lib.utils.logging import make_logger | ||
|
|
||
| __all__ = ("COMMIT_SHA_KEY", "enable", "disable", "is_enabled", "commit_sha") | ||
|
|
||
| logger = make_logger(__name__) | ||
|
|
||
| COMMIT_SHA_KEY = "__commit_sha__" | ||
|
|
||
| # A git object name: 40 hex for SHA-1, 64 for SHA-256, or an abbreviation down to | ||
| # git's own 7-character minimum. | ||
| _GIT_SHA_RE = re.compile(r"[0-9a-fA-F]{7,64}") | ||
|
|
||
| _COMMIT_SHA_ENV = "AGENT_COMMIT_SHA" | ||
| # Fallback only: automatic, and only usable when it happens to be SHA-shaped. | ||
| _AGENT_VERSION_ENV = "AGENT_VERSION" | ||
|
|
||
| # Resolved once at enable() rather than per span: the value is fixed for the | ||
| # life of the process, and resolving eagerly means a bad value is reported at | ||
| # startup instead of silently producing unstamped spans. | ||
| _commit_sha: str | None = None | ||
|
|
||
|
|
||
| def enable(commit_sha: str | None = None) -> None: | ||
| """Opt this process in to stamping ``__commit_sha__`` onto every span. | ||
|
|
||
| Value precedence: the explicit ``commit_sha`` argument, else | ||
| ``AGENT_COMMIT_SHA``, else ``AGENT_VERSION`` when the deployment happened to | ||
| set it to a bare commit SHA. A value that is not a git object name is | ||
| refused with a warning and leaves stamping off -- better an absent field | ||
| than one named for a commit that holds an image tag. | ||
| """ | ||
| global _commit_sha | ||
|
|
||
| for value, source in ( | ||
| (commit_sha, "the commit_sha argument"), | ||
| (os.environ.get(_COMMIT_SHA_ENV), _COMMIT_SHA_ENV), | ||
| (os.environ.get(_AGENT_VERSION_ENV), _AGENT_VERSION_ENV), | ||
| ): | ||
| candidate = (value or "").strip() | ||
| if not candidate: | ||
| continue | ||
| if _GIT_SHA_RE.fullmatch(candidate): | ||
| _commit_sha = candidate | ||
| logger.info("code revision stamping enabled from %s", source) | ||
| return | ||
| # An explicit argument or AGENT_COMMIT_SHA is a direct statement of | ||
| # intent, so a bad value there is worth surfacing. AGENT_VERSION is only | ||
| # a fallback and is expected to be a non-SHA tag much of the time, so | ||
| # falling through it quietly is correct, not a silent failure. | ||
| if source != _AGENT_VERSION_ENV: | ||
| logger.warning( | ||
| "%s=%r is not a git commit SHA; __commit_sha__ will not be stamped.", | ||
| source, | ||
| candidate, | ||
| ) | ||
| _commit_sha = None | ||
| return | ||
|
|
||
| _commit_sha = None | ||
| logger.warning( | ||
| "code revision stamping was enabled but no commit SHA was found " | ||
| "(checked the commit_sha argument, %s, and %s); __commit_sha__ will not " | ||
| "be stamped. Set %s in the agent's environment -- e.g. bake it at build " | ||
| "time with a Dockerfile ARG/ENV.", | ||
| _COMMIT_SHA_ENV, | ||
| _AGENT_VERSION_ENV, | ||
| _COMMIT_SHA_ENV, | ||
| ) | ||
|
|
||
|
|
||
| def disable() -> None: | ||
| """Turn stamping back off (also used for test isolation).""" | ||
| global _commit_sha | ||
| _commit_sha = None | ||
|
|
||
|
|
||
| def is_enabled() -> bool: | ||
| """Whether a commit SHA resolved and will be stamped.""" | ||
| return _commit_sha is not None | ||
|
|
||
|
|
||
| def commit_sha() -> str | None: | ||
| """The resolved commit SHA, or ``None`` when stamping is not enabled.""" | ||
| return _commit_sha | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an opted-in deployment supplies a 41–63-character hexadecimal value, this regex accepts it even though it cannot be a SHA-1 or SHA-256 object name, causing SGP to store misleading
__commit_sha__metadata that cannot identify a real commit.Knowledge Base Used: Tracing pipeline
Prompt To Fix With AI