[tests-only][full-ci] test(spaces): add acceptance test for creating a space with a caller-supplied id#12547
Draft
dj4oC wants to merge 1 commit into
Draft
[tests-only][full-ci] test(spaces): add acceptance test for creating a space with a caller-supplied id#12547dj4oC wants to merge 1 commit into
dj4oC wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
df1dd91 to
4dcfa54
Compare
…supplied id The Graph API already honors a caller-supplied space id on create (services/graph/pkg/service/v0/drives.go forwards drive.Id via the "spaceid" opaque, added in #11256), but no acceptance test exercised passing a custom id in the create-space body or asserted it is honored in the response. This adds a scenario in createSpace.feature that creates a project space with an explicit UUID and asserts the returned id, root.webDavUrl and webUrl reflect that UUID, plus a step definition that allows an id in the create-space request body. Closes: #11265 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: dj4oC <noreply@github.com>
4dcfa54 to
d5c1df1
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds acceptance-test coverage for creating a Space with a caller-supplied id through the Graph API.
theUserCreatesASpaceWithIdUsingTheGraphApiintests/acceptance/bootstrap/SpacesContext.php, allowing anidfield in the create-space request body (the existing...WithQuota...step only setname,driveTypeandquota).tests/acceptance/features/apiSpaces/createSpace.featurethat creates a project space with an explicit UUID and asserts the response'sid,root.webDavUrlandwebUrlall reflect the supplied UUID.Related Issue
Motivation and Context
The Graph API already honors a caller-supplied space id on create —
createDriveinservices/graph/pkg/service/v0/drives.goforwardsdrive.Idto reva via the"spaceid"opaque (csr.Opaque = utils.AppendPlainToOpaque(csr.Opaque, "spaceid", *drive.Id)), implemented in #11256 (ticket #11235). No acceptance test exercised passing a customidin the request body or asserted the server honors it, leaving this behavior unverified against regressions. This PR closes that gap.Root cause of the gap: the only create-space step definition built a fixed body (
name/driveType/quota) with no way to include anid, so no.featurescenario could cover the supplied-id path.How Has This Been Tested?
[full-ci]).php -l tests/acceptance/bootstrap/SpacesContext.php— no syntax errors.--dry-run(apiSpaces suite) — the new scenario's 5 steps all bind to step definitions (0 undefined, 0 ambiguous for this scenario); the new step regex is unambiguous against existing ones. (The suite reports 4 pre-existing undefined steps for an unrelated...requests these endpoints ... with basic authstep, not touched here.)matchblock was validated as well-formed JSON, and theidpattern^%user_id_pattern%\$<uuid>$was verified to match the correct<provider-uuid>$<supplied-uuid>form and reject a wrong space UUID.admin user creates a space with a caller-supplied id via the Graph API→ expects201andid/webDavUrl/webUrlcontaining the supplied UUID11111111-1111-4111-8111-111111111111.Architecture notes
Test-only, additive change. It introduces no service, topology, dependency, or API-contract change — the underlying feature already shipped in #11256. The new step reuses the existing
GraphHelper::createSpace(...)helper (which already accepts a raw body) and mirrors the existing create-space step exactly, includingaddToCreatedSpace(...)bookkeeping. Assertion reuses the established%user_id_pattern%/%base_url%inline-code + JSON-schemapatternidiom already used elsewhere in the suite.Documentation
[tests-only][full-ci]PRs such as [tests-only][full-ci] test: add oc:spaceid to REPORT response acceptance tests #12489, [tests-only][full-ci] test: add spaceId to remoteItem in incoming shares #12485, [tests-only][full-ci]test(cli): add clean-orphaned-grants CLI test scenarios #12470, which add no changelog fragment).REUSE.tomllicensespath = "**"globally; no new files, and modified files need no inline header.Types of changes
Checklist:
Reviewer notes (automated pipeline)
🤖 Generated with Claude Code
https://claude.ai/code/session_01WsjpVPM1fMMD5DkxWE7575
Generated by Claude Code