Skip to content

[pull] main from tinacms:main#193

Merged
pull[bot] merged 5 commits intocode:mainfrom
tinacms:main
Apr 24, 2026
Merged

[pull] main from tinacms:main#193
pull[bot] merged 5 commits intocode:mainfrom
tinacms:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 24, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

JackDevAU and others added 5 commits April 24, 2026 03:52
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Tihomir Ivanov <tihomir@devlings.dev>
…l.ts (#6734)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Added src/parse/index.test.ts with 3 unit tests covering error
recovery in the MDX parser (type: 'mdx' path):
- JSX child expression inside a registered component (<Cta>{name}</Cta>)
produces invalid_markdown
- Malformed/truncated tag (<Cta) produces invalid_markdown
- Serializing an invalid_markdown node roundtrips back to the original
string (no data loss on save)
Closes #6467.

### 🧪 Test coverage summary

| Test Area | New tests | Describe block |
|-----------|-----------|----------------|
| 1. Request construction and dispatching | **3** | `request() — wire
format` |
| 2. Branch resolution and management | **10** | `branch resolution` (5)
+ `branch management` (5) |
| 3. Error handling | **5** | `request() — error handling` |
| 4. Auth token flow | **3** | `auth token flow` |
| 5. `isLocalMode` detection (extended) | **2** | `LocalClient — default
wiring` |
| **Total** | **23 new** | across 5 new `describe` blocks |

### 📝 New tests

**`LocalClient — default wiring`**
- `defaults to the local dev server URL when no customContentApiUrl is
provided`
- `uses a LocalAuthProvider by default`

**`request() — wire format`**
- `sends a POST with JSON content-type to the branch-derived content API
URL`
- `stringifies the query and variables into the request body`
- `prints a graphql-tag function into the body's query string`

**`branch resolution`**
- `encodes the branch into the content API URL`
- `re-derives the content API URL when setBranch is called`
- `prefers customContentApiUrl over the branch-derived URL`
- `applies tinaioConfig.contentApiUrlOverride to the base URL`
- `promotes schema.config.contentApiUrlOverride to the content API URL`

**`branch management`**
- `createBranch sends a POST with baseBranch and branchName in the JSON
body`
- `createBranch returns the branch name parsed from the response ref`
- `createBranch throws with the response body message when the response
is not ok`
- `listBranches GETs the list_branches endpoint and parses the response
through the zod schema`
- `branchExists returns true in local mode without calling listBranches`

**`request() — error handling`**
- `throws with clientId and branch context on a non-200 against a
tina.io URL`
- `omits the clientId/branch hint when a custom content API URL is set`
- `appends the response body's message to the thrown error`
- `joins GraphQL error messages from a 200 response`
- `propagates a fetch rejection unchanged`

**`auth token flow`**
- `includes an Authorization Bearer header when getToken returns an
id_token`
- `omits the Authorization header when getToken returns null`
- `fetches a fresh token for each request`

### ✅ Verification

From `packages/tinacms/`:

```sh
pnpm test
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Ivan Gaiduk <ivangaiduk@ssw.com.au>
@pull pull Bot locked and limited conversation to collaborators Apr 24, 2026
@pull pull Bot added the ⤵️ pull label Apr 24, 2026
@pull pull Bot merged commit 57b953a into code:main Apr 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants