-
Notifications
You must be signed in to change notification settings - Fork 10
chore: promote staging 73ea73e to production #529
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
Changes from all commits
0fa93b6
76252a9
f394ce7
f44750a
cd28f5f
490843e
e5697db
ebbf900
18bc39d
cb47a16
86514dd
c051379
567abff
9ae1fa1
90387d2
40ab658
24aa92b
6da13c3
86d29c7
73ea73e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| 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} # don't fail the job if the logging fails | ||
| run: | | ||
| curl -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer ${{ secrets.N8N_PRODSEC_ACTIONS_TOKEN }}" \ | ||
| -d @./output.json \ | ||
| ${{ secrets.N8N_PRODSEC_ACTIONS_ENDPOINT }} | ||
| 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 |
| 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 |
| 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": [] | ||
| } |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ | |
| ] | ||
|
|
||
| ENVIRONMENTS: Dict[str, str] = { | ||
| "production": "http://localhost:5003", | ||
| "production": "https://agentex.sgp.scale.com", | ||
| "development": "http://localhost:5003", | ||
|
Comment on lines
+74
to
75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Context Used: Keep manual code separate from generated SDK code (source) Prompt To Fix With AIThis is a comment left during a code review.
Path: src/agentex/_client.py
Line: 74-75
Comment:
`ENVIRONMENTS["production"]` now points at the remote host, but `test_base_url_env` still requires `http://localhost:5003`. The normal test suite will fail. Update the generated source and its test together. The repository also requires generated edits to be backed by generator config or an upstream schema change.
**Context Used:** Keep manual code separate from generated SDK code ([source](https://github.com/scaleapi/scale-agentex-python/blob/main/.cursor/rules/20_codegen_boundaries.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
| } | ||
|
|
||
|
|
||
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.
$GITHUB_HEAD_REFfrom the base repository'sorigin. For a fork PR, that branch exists only in the fork, so the job stops before Bandit runs. Check out the pull request head SHA or fetch fromgithub.event.pull_request.head.repoinstead.Prompt To Fix With AI