Skip to content

test(BA-7806): add scenario tests for the deployment adapter's own calls - #14501

Open
fregataa wants to merge 4 commits into
mainfrom
test/BA-7806-deployment-scenarios
Open

test(BA-7806): add scenario tests for the deployment adapter's own calls#14501
fregataa wants to merge 4 commits into
mainfrom
test/BA-7806-deployment-scenarios

Conversation

@fregataa

@fregataa fregataa commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Write adapters/deployment/KNOWLEDGE.md for the deployment's own calls (create, read, search, update, options, sync, delete) and transcribe it into tests/scenario/bai_scenario/manager/deployment/ — 32 rows over 7 modules.
  • Add SeedDeployment (lays a deployment through DeploymentCreator, no revision), fakes for the schedule client and the coordinator's handler registry, and deployment components.
  • Pin behaviours found while transcribing:
    • an unknown id is refused as NotEnoughPermission for a plain user; only a superadmin sees EndpointNotFound
    • my_search is guarded by READ at the caller's own scope, not just narrowed to it
    • replace_options replaces the options whole — an empty handler list drops the inherited entries

Not covered here:

Rows Why
create with an initial revision, current revision, activate / refresh revisions need revision, vfolder, runtime-variant and policy seeds (overlaps BA-7825)
schedule marks left by delete / sync_replicas run_scenario does not hand fakes to then (BA-7830)

Test plan

  • pants test tests/scenario/bai_scenario/manager/deployment::
  • Generate report.md with scripts/scenario-report.py --split and commit it

Resolves BA-7806

🤖 Generated with Claude Code

https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc

@github-actions github-actions Bot added the size:XL 500~ LoC label Sep 10, 2026
fregataa added a commit that referenced this pull request Sep 10, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
fregataa added a commit that referenced this pull request Sep 11, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
@fregataa
fregataa force-pushed the test/BA-7806-deployment-scenarios branch from 372e154 to 273e08d Compare September 11, 2026 01:00
fregataa added a commit that referenced this pull request Sep 11, 2026
Split from the CI run of #14501, where all 32 deployment rows passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
@fregataa
fregataa marked this pull request as ready for review September 11, 2026 01:51
@fregataa
fregataa requested a review from a team as a code owner September 11, 2026 01:51
Copilot AI balanced review requested due to automatic review settings September 11, 2026 01:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

| 읽기 권한을 받은 사용자가 읽는다 | deployment 하나, 읽기 권한 있음 | id로 조회 | 그 deployment 전체 |
| 읽기 권한이 없는 사용자가 읽는다 | 같은 deployment, 읽기 권한 없음 | id로 조회 | 권한 부족으로 거부 |
| 아무것도 갖지 않은 id로 읽는다 | 읽기 권한 있음 | 없는 id로 조회 | 권한 부족으로 거부 |
| 슈퍼관리자가 아무것도 갖지 않은 id로 읽는다 | 슈퍼관리자 | 없는 id로 조회 | 대상 없음으로 거부 |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a scenario in which "superadmin" could successfully read a value that does not belong to them.

jopemachine added a commit that referenced this pull request Sep 11, 2026
Follow the conventions #14501 settled, which the first draft missed:

- Drop the rows a request type already refuses (a blank URL, a blank registry
  name). The adapter does not guarantee those.
- Add the enforcement-switch row to each gate, so the two answer differently:
  the registry's own calls stay refused because a role guards them, while the
  allowed-project link goes through because the graph does.
- Name the permission the caller holds in every 상황 cell, rather than "권한 없음".
- Keep 아직 적지 않은 것 for adapter calls only; every call is covered, so it
  says so, and the wirings that never reach an adapter moved to the header.

Also correct two things the first draft got wrong:

- The registry search does not refuse a mixed pagination mode. The request type
  carries cursor fields but the adapter reads only limit and offset, so a cursor
  is dropped in silence; that is now written as a question to settle.
- Replace 물리기/물린다 for the soft delete with 잊기, the adapter's own word
  (`admin_forget`), and say in the section that the row survives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013TYyokzEfpr9AF2NnHtyXB
fregataa and others added 3 commits September 11, 2026 11:55
Cover create, get, update, replace_options, sync_replicas, delete,
admin_search, project_search and my_search with 32 scenario rows, and
write the deployment KNOWLEDGE.md they are transcribed from.

- Seed a deployment through DeploymentCreator, without a revision
- Fake the schedule client and the coordinator's handler registry
- Pin that an unknown id is refused as permission for a plain user and
  as not-found only for a superadmin

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
Split from the CI run of #14501, where all 32 deployment rows passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
@fregataa
fregataa force-pushed the test/BA-7806-deployment-scenarios branch from 7db485a to c784c10 Compare September 11, 2026 03:01
…hout a grant

One row each for reading, renaming and retiring a deployment the caller
did not make and holds no permission on. The role passes the permission
graph; the earlier superadmin rows only touched the superadmin's own row.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d4RfANyMk9v2RgtWUozpc
| 수정 권한을 받은 사용자가 이름을 바꾼다 | deployment 하나, 수정 권한 있음 | 이름 수정 | 이름은 새 값, 나머지는 그대로 |
| 태그를 지운다 | 태그가 붙은 deployment, 수정 권한 있음 | 태그를 비우는 수정 | 태그가 없어진다 |
| 복제 수를 올린다 | 복제 수가 하나인 deployment, 수정 권한 있음 | 복제 수 수정 | 원하는 복제 수가 새 값이 된다 |
| 공개 여부를 바꾼다 | 공개가 아닌 deployment, 수정 권한 있음 | 공개 여부 수정 | 공개로 바뀐 상태를 실은 답 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be impossible to change the deployment to "public" right now?

@fregataa fregataa Sep 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible on API but it is not synced with app proxy

Comment on lines +132 to +134
| 슈퍼관리자가 전체를 새로 고친다 | 살아 있는 deployment 둘, 전역 역할 있음 | 전체 새로 고침 | 둘 다 새 리비전을 얻고 그것이 현재가 된다 |
| 하나가 실패해도 나머지가 돈다 | 현재 리비전이 없는 것이 섞여 있음, 전역 역할 있음 | 전체 새로 고침 | 실패한 것과 성공한 것을 함께 답한다 |
| 슈퍼관리자가 아닌 사용자가 전체를 새로 고친다 | 전역 역할 없음, 모든 deployment에 수정 권한 있음 | 전체 새로 고침 | 역할로 거부 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that the "refresh" operation is a one-time action for migration—is it subject to validation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is for migration but I don't want to skip testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants