Skip to content

SchemaLock adapter: support multiple base URLs (staging + prod) - #65

Open
qiaobochi040726-source wants to merge 2 commits into
BreachDirect:mainfrom
qiaobochi040726-source:20260806-schemalock-multi-url
Open

SchemaLock adapter: support multiple base URLs (staging + prod)#65
qiaobochi040726-source wants to merge 2 commits into
BreachDirect:mainfrom
qiaobochi040726-source:20260806-schemalock-multi-url

Conversation

@qiaobochi040726-source

Copy link
Copy Markdown
Contributor

Fixes #20

SchemaLock 一次运行支持多个环境,findings 标注环境:

  • _resolve_base_urls() 统一解析三种形态:base_urls dict {env: url}(标签=env key)、base_urls list(标签=URL)、旧单值 base_url(兼容,标签=URL)
  • 每个环境各跑一次 schemalock test,findings 的 location 前缀环境标签(如 "staging: GET /escrows/{id}")
  • stellargate.example.yaml 补充多环境示例注释
  • 新增 3 个测试:多 URL 各调一次且标签正确、dict 用 env key 作标签、旧 base_url 单次调用

验证:pytest 18 passed(基线 15+3)。遗留:旧单值写法的 findings 现带 URL 前缀(格式轻微变化,数量与调用行为不变);某环境 CLI 缺失会中断整次运行(未做部分失败继续)。

qiaobochi040726-source and others added 2 commits August 6, 2026 05:25
Issue BreachDirect#20: run the same contract checks against multiple environments in a
single run and label findings by environment.

- base_urls dict {env: url} -> one schemalock test per URL, findings tagged
  with the env key (e.g. 'staging: GET /escrows/{id}')
- base_urls list of URLs -> each URL tested, URL used as the env label
- legacy single base_url still works unchanged (single invocation)
- tests mock subprocess.run: two URLs -> two CLI calls + labelled findings,
  dict env keys used as labels, legacy base_url -> single call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SchemaLock adapter: support multiple base URLs (staging + prod)

2 participants