-
Notifications
You must be signed in to change notification settings - Fork 10
chore: promote staging bc1a463 to production #530
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
agentex-sdk-sync
wants to merge
21
commits into
main
Choose a base branch
from
stlc/promote
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
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0fa93b6
codegen metadata
stainless-app[bot] 76252a9
feat(tracing): add opt-in commit SHA stamping for SGP spans (#505)
cyntwang99 f394ce7
codegen metadata
stainless-app[bot] f44750a
Repository Setup
github-actions[bot] cd28f5f
Merge remote-tracking branch 'stainless/next' into next
aringuyen3 490843e
chore(sync): back-sync production release #506 (a71fa670)
e5697db
ci: guard production-only workflows so they no-op on staging
ebbf900
ci(bandit): read scan results from file instead of passing them as argv
18bc39d
chore(stlc): reconcile staging main and back-sync production release …
aringuyen3 cb47a16
chore(sync): back-sync production releases #520 and #525
86514dd
chore(stlc): restore trunk ancestry and back-sync production
c051379
Merge pull request #5 from scaleapi/stlc/restore-trunk-ancestry
aringuyen3 567abff
Build SDK
aringuyen3 9ae1fa1
chore(stlc): back-sync the 0.28.1 release from production
aringuyen3 90387d2
chore(release): point release-please config at the stock schema
aringuyen3 40ab658
ci(stlc): stand up Promote and Release
agentex-sdk-sync[bot] 24aa92b
ci(release): wire release-please to the App token and the CLI
aringuyen3 6da13c3
ci(lint-pr): exempt the SDK automation App from the PR title and base…
aringuyen3 86d29c7
ci(bandit): add the jq template the scan's logging step feeds
aringuyen3 73ea73e
fix(stlc): restore the custom-code tree a stale seal anchor reverted
aringuyen3 bc1a463
fix: align the base-URL test with this trunk, and stop Bandit failing…
aringuyen3 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
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,82 @@ | ||
| name: Bandit | ||
|
|
||
| on: | ||
| # Scan changed files in PRs: | ||
| pull_request: {} | ||
|
|
||
| jobs: | ||
| bandit-scan: | ||
| name: Bandit | ||
| runs-on: ubuntu-22.04 | ||
| if: (github.actor != 'dependabot[bot]') && (github.actor != 'github-actions[bot]') | ||
| steps: | ||
| - name: Install PyCQA/bandit | ||
| shell: bash | ||
| run: | | ||
| pip install bandit | ||
| - name: Checkout base branch | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.ref }} | ||
| fetch-depth: 1 | ||
| submodules: false | ||
| - name: Run a baseline scan | ||
| shell: bash | ||
| run: | | ||
| bandit --recursive --aggregate file . -f json -o baseline.json || true | ||
| - name: Checkout feature branch | ||
| shell: bash | ||
| run: | | ||
| git fetch origin $GITHUB_HEAD_REF | ||
| git checkout $GITHUB_HEAD_REF | ||
| - name: Run Scan off of baseline | ||
| shell: bash | ||
| run: | | ||
| bandit --recursive --aggregate file . --baseline baseline.json -f json -o results.json || true | ||
| - name: Install logging prerequisites | ||
| shell: bash {0} | ||
| run: | | ||
| sudo apt-get -y install jq curl | ||
| - name: Generate logger template | ||
| shell: bash {0} # don't fail the job if the logging fails | ||
| run: | | ||
| jq -n --arg organization $GITHUB_REPOSITORY_OWNER \ | ||
| -n --arg time $( date +'%Y-%m-%dT%H:%M:%SZ' ) \ | ||
| -n --arg action $GITHUB_WORKFLOW \ | ||
| -n --arg repository $GITHUB_REPOSITORY \ | ||
| -n --arg sha $GITHUB_SHA \ | ||
| -n --arg branch $GITHUB_HEAD_REF \ | ||
| -n --arg link "https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \ | ||
| -f .github/workflows/output-template.json > tmp-output.json | ||
| - name: Format results appropriately from results.json | ||
| shell: bash {0} # don't fail the job if the logging fails | ||
| run: | | ||
| jq '.results | map({"path": .filename, "message": .issue_text, "line": .line_number})' results.json > tmp.json | ||
| # --slurpfile, not --argjson "$(<tmp.json)": the latter passes the whole results file | ||
| # as a single argv entry, which Linux caps at MAX_ARG_STRLEN (128KB) regardless of the | ||
| # much larger total ARG_MAX. Once a scan produced more than ~128KB of findings the step | ||
| # died with "Argument list too long" (exit 126) and failed the job -- despite the | ||
| # `shell: bash {0}` above intending it to be non-fatal. --slurpfile reads the file | ||
| # directly, so size is irrelevant; it wraps the file's values in an array, hence [0]. | ||
| jq --slurpfile scanResults tmp.json '.results += $scanResults[0]' tmp-output.json > output.json | ||
| - name: Send unified results to logging cluster | ||
| # `shell: bash {0}` drops `-e`, but a step still fails when its LAST command does, | ||
| # and curl was the last command -- so a repo without these secrets failed the whole | ||
| # Bandit job on a reporting problem, contradicting the intent stated right here. | ||
| # Neither this repo nor the production repo defines them, so this failed every run. | ||
| # Stay non-fatal, but say so rather than reporting nothing silently. | ||
| shell: bash {0} # don't fail the job if the logging fails | ||
| env: | ||
| ENDPOINT: ${{ secrets.N8N_PRODSEC_ACTIONS_ENDPOINT }} | ||
| TOKEN: ${{ secrets.N8N_PRODSEC_ACTIONS_TOKEN }} | ||
| run: | | ||
| if [ -z "${ENDPOINT:-}" ]; then | ||
| echo "::warning title=Bandit results not reported::N8N_PRODSEC_ACTIONS_ENDPOINT is not set on this repository, so the scan results were not sent to the logging cluster. The scan itself ran and its findings are in the job log." | ||
| exit 0 | ||
| fi | ||
| curl -sS -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer ${TOKEN}" \ | ||
| -d @./output.json \ | ||
| "$ENDPOINT" \ | ||
| || echo "::warning title=Bandit results not reported::the POST to the logging cluster failed; the scan itself still ran." | ||
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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: OpenGrep | ||
|
|
||
| on: | ||
| pull_request: {} | ||
|
|
||
| concurrency: | ||
| group: opengrep-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| opengrep: | ||
| uses: scaleapi/required-actions/.github/workflows/opengrep-ci.yml@opengrep-4core-runner | ||
| secrets: inherit |
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,18 @@ | ||
| name: OpenGrep FP Triage | ||
|
|
||
| on: | ||
| pull_request_review_comment: | ||
| types: [created] | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| triage: | ||
| if: | | ||
| (startsWith(github.event.comment.body, '/fp') || | ||
| startsWith(github.event.comment.body, '/FP')) && | ||
| !endsWith(github.actor, '[bot]') | ||
| uses: scaleapi/required-actions/.github/workflows/opengrep-fp.yml@main | ||
| secrets: inherit |
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,13 @@ | ||
| { | ||
| "source": "github", | ||
| "organization": "\($organization)", | ||
| "timestamp": "\($time)", | ||
| "action": "\($action)", | ||
| "meta": { | ||
| "repository": "\($repository)", | ||
| "commit": "\($sha)", | ||
| "branch": "\($branch)", | ||
| "link": "\($link)" | ||
| }, | ||
| "results": [] | ||
| } |
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,80 @@ | ||
| name: Release Please | ||
|
|
||
| # Hand-edited from the stlc-generated template. `.github/workflows/*.yml` is | ||
| # scaffold-once, so this survives every later build -- upstream's own source cites | ||
| # exactly this PAT-to-App swap as the reason that preservation exists. Do NOT run | ||
| # `stlc build --rewrite-scaffold` without reapplying these three changes. | ||
| # | ||
| # What changed from the generated file, and why each is load-bearing: | ||
| # | ||
| # 1. App token instead of `secrets.RELEASE_PLEASE_TOKEN`, which does not exist | ||
| # and which we do not want to create -- eliminating PATs was the point of the | ||
| # App migration. It is deliberately NOT `GITHUB_TOKEN`: releases created by | ||
| # GITHUB_TOKEN do not trigger other workflows, so publish-*.yml would never | ||
| # fire and the release would stop one hop short of the registry. | ||
| # | ||
| # 2. The `npx release-please@16` CLI instead of googleapis/release-please-action. | ||
| # scale-agentex-typescript sets `allowed_actions: selected` and does not permit | ||
| # that action; the CLI needs only actions/-owned steps, which | ||
| # `github_owned_allowed: true` covers on both production repos. | ||
| # | ||
| # 3. `issues: write` on the minted token. release-please drives its | ||
| # autorelease:pending -> autorelease:tagged labels through the Issues API. | ||
| # Without it you get duplicate release pull requests. The generated file omits | ||
| # it, and the omission is silent until it bites. | ||
| # | ||
| # Requires AGENTEX_SDK_SYNC_PRIVATE_KEY (secret) and AGENTEX_SDK_SYNC_APP_ID | ||
| # (variable) on the PRODUCTION repo -- a workflow only reads secrets from the repo | ||
| # it runs in, and the guard below means that is production. | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release-please: | ||
| # Self-routing: this file is SHA-identical on the staging trunk, where it must | ||
| # stay inert. Only production cuts releases. | ||
| if: github.repository == 'scaleapi/scale-agentex-python' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Mint release token | ||
| id: release-token | ||
| uses: actions/create-github-app-token@v2 | ||
| with: | ||
| app-id: ${{ vars.AGENTEX_SDK_SYNC_APP_ID }} | ||
| private-key: ${{ secrets.AGENTEX_SDK_SYNC_PRIVATE_KEY }} | ||
| owner: scaleapi | ||
| repositories: scale-agentex-python | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
| permission-issues: write | ||
| permission-metadata: read | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Release PR + GitHub release | ||
| env: | ||
| RP_TOKEN: ${{ steps.release-token.outputs.token }} | ||
| run: | | ||
| # release-pr opens or updates the version-bump pull request; | ||
| # github-release turns an already-merged one into the tag + GitHub Release | ||
| # that publish-pypi.yml / publish-npm.yml trigger on. Both are idempotent, | ||
| # so running the pair on every push carries a release the whole way. | ||
| # | ||
| # No checkout step is needed: release-please reads the config and manifest | ||
| # from the repo over the API. | ||
| npx --yes release-please@16 release-pr \ | ||
| --token="$RP_TOKEN" --repo-url="${{ github.repository }}" \ | ||
| --config-file=release-please-config.json \ | ||
| --manifest-file=.release-please-manifest.json | ||
| npx --yes release-please@16 github-release \ | ||
| --token="$RP_TOKEN" --repo-url="${{ github.repository }}" \ | ||
| --config-file=release-please-config.json \ | ||
| --manifest-file=.release-please-manifest.json |
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,16 @@ | ||
| name: TruffleHog Bypass Handler | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| bypass: | ||
| if: | | ||
| github.event.issue.pull_request && | ||
| contains(github.event.comment.body, '/trufflehog-bypass') | ||
| uses: scaleapi/required-actions/.github/workflows/trufflehog-bypass-handler.yml@main | ||
| permissions: | ||
| pull-requests: write | ||
| contents: read | ||
| actions: write |
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,13 @@ | ||
| name: TruffleHog Secret Scan | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [master, main] | ||
|
|
||
| jobs: | ||
| scan: | ||
| uses: scaleapi/required-actions/.github/workflows/trufflehog-scan.yml@main | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| id-token: write |
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,26 @@ | ||
| name: TruffleHog Weekly Scan | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 3 * * 0' | ||
| workflow_dispatch: | ||
| inputs: | ||
| since_commit: | ||
| description: 'Override: Scan from this commit SHA (leave empty to use stored value)' | ||
| required: false | ||
| type: string | ||
| full_scan: | ||
| description: 'Run full history scan (ignores since_commit)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| scan: | ||
| uses: scaleapi/required-actions/.github/workflows/trufflehog-weekly-scan.yml@main | ||
| with: | ||
| since_commit: ${{ inputs.since_commit || '' }} | ||
| full_scan: ${{ inputs.full_scan || false }} | ||
| permissions: | ||
| contents: read | ||
| id-token: write |
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 @@ | ||
| configured_endpoints: 75 | ||
| openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-fbc0683871d6abb03588f30d9468eeeeacb2b8538eb0c9002813e6df68c5802b.yml | ||
| openapi_spec_hash: 4ecd8d496f056dccf80826264ddf8fe1 | ||
| 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
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.
origin, but$GITHUB_HEAD_REFnames the source branch. For a fork pull request, that branch usually exists only in the fork, sogit fetchexits before the changed-code scan runs. Check out the pull request head SHA or fetch fromgithub.event.pull_request.head.repoinstead.Prompt To Fix With AI