assessing-external-test-risk

작성자: streamlit

브랜치 또는 PR 변경 사항이 외부 호스팅 또는 임베디드 Streamlit 사용에 대해 고위험인지 평가하고, 외부 e2e 커버리지로…를 권장합니다.

npx skills add https://github.com/streamlit/streamlit --skill assessing-external-test-risk

Assessing external test risk

Use this skill to decide whether a branch or PR should include external e2e coverage using @pytest.mark.external_test.

This helps protect deployments that commonly involve proxies, embedded iframe contexts, CSP constraints, and other browser security boundaries.

This skill is for risk assessment and recommendation. It does not auto-mark tests unless explicitly requested.

Decision rule

Use an any-hit policy:

  • If any checklist category is hit, output Recommend external_test: Yes
  • If no categories are hit, output Recommend external_test: No

Inputs to review

  • Branch or PR diff against its base branch
  • Changed files and related tests
  • PR description (if available)

Assessment workflow

  1. Gather the changed files and full diff against the base branch.
  2. Evaluate each checklist category below as hit or not hit.
  3. Record concrete evidence from file paths and diff snippets.
  4. Produce a recommendation and specific external-test focus areas.

Checklist categories

Evaluate all categories. A single hit is enough to recommend external coverage.

  1. Routing and URL behavior

    • Hit when changes introduce or modify Starlette routes, server.baseUrlPath, catch-alls, request methods, URL resolution, redirects, or status codes.
  2. Auth, cookies, CSRF, and identity binding

    • Hit when changes touch login/logout or OAuth flows, _streamlit_user, _streamlit_xsrf, CSRF/XSRF handling, server.trustedUserHeaders, or session-to-identity binding.
  3. Websocket handshake and session transport

    • Hit when changes affect websocket handshake or subprotocols, session affinity, reconnect behavior, ping or timeout behavior, message size limits, or fragmentation.
  4. Embedding and iframe boundary

    • Hit when changes modify host-to-guest communication (postMessage), iframe sizing or resize behavior, iframe sandbox or allow attributes, or permissions policy behavior in embedded contexts.
  5. Static and component asset serving

    • Hit when changes alter asset handlers, cache headers, size limits, base paths (including server.customComponentBaseUrlPath), or proxying rules for static/component assets.
  6. Service worker, uploads, and downloads

    • Hit when changes modify service worker registration, scope, or caching strategy; upload/download endpoints; JWT or CSRF wrapping; or download attribute behavior.
  7. Cross-origin behavior and external networking

    • Hit when changes alter CORS allowlists, crossOrigin usage, external-origin fetches or external networks behavior, or backend URL discovery via window.__streamlit.*.
  8. Cross-origin theming and resource discovery

    • Hit when changes introduce or modify theme/resource loading across origins (fonts, images, theme globals), CSS isolation with host pages, or manifest/asset discovery when HTML is not served by Starlette.
  9. SiS and Snowflake runtime dependencies

    • Hit when changes rely on or modify SiS/Snowflake runtime behavior, including running_in_sis(), get_active_session(), Snowflake connection/session semantics, or SiS-specific environment flags.
  10. Client storage behavior

    • Hit when changes introduce or modify cookies, localStorage, or sessionStorage usage that may differ in embedded or third-party contexts.
  11. Security headers and browser policies

    • Hit when changes adjust CSP, Referrer-Policy, Permissions-Policy, or related headers that can impact embedding or resource loading.

Output format

Use this exact structure:

## External test recommendation

- Recommend external_test: [Yes/No]
- Triggered categories: [List category numbers and names, or "None"]
- Evidence:
  - `<path>`: [short reason from diff]
  - `<path>`: [short reason from diff]
- Suggested external_test focus areas:
  - [Concrete scenario to validate externally]
  - [Concrete scenario to validate externally]
- Confidence: [High/Medium/Low]
- Assumptions and gaps: [Unknowns, missing context, or why confidence is reduced]

Interpretation guidance

  • Prefer evidence over intuition. Tie each hit to concrete diff details.
  • When in doubt, err toward Yes if externally hosted or embedded behavior could diverge from local runs.
  • Keep focus areas specific and testable (route, auth handshake, iframe boundary, asset loading, SiS runtime behavior).

Examples

Example yes recommendation

Diff includes:

  • lib/streamlit/web/server/starlette/starlette_routes.py route changes
  • Cookie/XSRF handling updates in request auth middleware
  • Frontend embed code changing iframe allow attributes

Expected output:

  • Recommend external_test: Yes
  • Triggered categories include routing, auth/cookies/CSRF, and embedding boundary
  • Focus areas include external host iframe embedding + auth/session continuity checks

Example no recommendation

Diff includes:

  • Pure refactor in internal utility functions with no network, auth, embedding, storage, or runtime integration impact
  • Docs and test name cleanup only

Expected output:

  • Recommend external_test: No
  • Triggered categories: None
  • Confidence is high if no indirect integration points are touched

streamlit의 다른 스킬

developing-with-streamlit
streamlit
**[필수]** 모든 Streamlit 작업(Streamlit 애플리케이션 생성, 편집, 디버깅, 미화, 스타일링, 테마 적용, 최적화)에 사용하세요. 또한 필요합니다…
official
addressing-pr-review-comments
streamlit
현재 브랜치의 streamlit/streamlit 저장소에 있는 PR의 모든 유효한 리뷰 코멘트를 처리합니다. 인라인 리뷰 코멘트와 일반 PR(이슈) 코멘트를 모두 포함합니다.
official
checking-changes
streamlit
커밋 전에 포맷, 린트, 타입, 단위 테스트 검사를 실행하여 모든 코드 변경 사항을 검증합니다. 백엔드(Python) 또는 프론트엔드(TypeScript) 작업 후에 사용하세요…
official
discovering-make-commands
streamlit
Streamlit 개발에 사용 가능한 make 명령어를 나열합니다. 빌드, 테스트, 린트 또는 포맷 작업에 사용하세요.
official
finalizing-pr
streamlit
병합을 위해 브랜치 변경 사항을 최종 확정하며, 코드 단순화, 검사 실행, 변경 사항 검토, 필요 시 PR 생성을 수행합니다. 변경 사항을 병합할 준비가 되었을 때 사용하세요.
official
fixing-flaky-e2e-tests
streamlit
불안정한 Playwright e2e 테스트를 진단하고 수정합니다. 테스트가 간헐적으로 실패하거나, 시간 초과 오류가 발생하거나, 스냅샷 불일치가 있거나, 브라우저별 특성을 보일 때 사용하세요.
official
fixing-streamlit-ci
streamlit
현재 브랜치/PR에서 실패한 GitHub Actions CI 작업을 분석하고 수정합니다. CI 검사가 실패하거나, PR 검사에서 오류가 표시되거나, 진단이 필요할 때 사용하세요…
official
generating-changelog
streamlit
두 개의 git 태그 사이에 있는 docs.streamlit.io용 정리된 웹사이트 릴리스 노트를 생성합니다. 새로운 Streamlit 릴리스를 준비하거나 변경 사항을 검토할 때 사용합니다.
official