fix(confluence): normalize space identifiers - #7324
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR separates key-based Confluence scoped search from numeric-ID V2 operations while preserving legacy saved workflows.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security defects identified. The selector split, operation-scoped migration, canonical parameter mapping, and runtime identifier normalization remain aligned across legacy and newly configured workflows.
|
| Filename | Overview |
|---|---|
| apps/sim/blocks/blocks/confluence.ts | Introduces a key-specific selector pair for scoped search and maps its canonical value to the existing public spaceKey tool parameter. |
| apps/sim/lib/internal/confluence/operations.ts | Adds bidirectional space identifier normalization and applies numeric IDs consistently to V2 space operations. |
| apps/sim/lib/workflows/migrations/subblock-migrations.ts | Migrates legacy scoped-search fields into the new key-specific basic and advanced fields without affecting other operations. |
| apps/sim/blocks/blocks/confluence.test.ts | Verifies legacy basic and advanced search values survive migration and serialization. |
| apps/sim/lib/internal/confluence/operations.test.ts | Verifies key-to-ID normalization for V2 calls and ID-to-key normalization for V1 CQL search. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Saved or selected space value] --> B{Operation}
B -->|V2 space operation| C{Numeric value?}
C -->|Yes| D[Use numeric space ID]
C -->|No| E[Look up exact current or archived key]
E --> D
B -->|V1 search_in_space| F{Numeric value?}
F -->|Yes| G[Resolve ID to space key]
F -->|No| H[Use space key]
G --> I[Construct key-based CQL]
H --> I
Reviews (1): Last reviewed commit: "fix(confluence): normalize space identif..." | Re-trigger Greptile
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 3/5
- In
apps/sim/lib/workflows/migrations/subblock-migrations.ts, migrating a numeric legacyspaceSelectorinto the key-based selector leaves the value unconverted, soconfluence.spacesmay look up the wrong key and fail to resolve the selected space; convert the legacy value during migration or preserve compatible handling.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/workflows/migrations/subblock-migrations.ts">
<violation number="1" location="apps/sim/lib/workflows/migrations/subblock-migrations.ts:146">
P2: When a legacy basic search block stores a numeric `spaceSelector` value, this rename moves it into the key-based selector without converting the value. The `confluence.spaces` detail lookup then treats `12345` as a key instead of resolving it to `ENG`, so the migrated selector cannot hydrate and appears blank; normalize the ID to a key before using the key selector, or make the key-selector detail path resolve legacy numeric IDs.</violation>
</file>
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Fix all with cubic | Re-trigger cubic
| confluence_v2: [ | ||
| { | ||
| from: 'spaceSelector', | ||
| to: 'spaceKeySelector', |
There was a problem hiding this comment.
P2: When a legacy basic search block stores a numeric spaceSelector value, this rename moves it into the key-based selector without converting the value. The confluence.spaces detail lookup then treats 12345 as a key instead of resolving it to ENG, so the migrated selector cannot hydrate and appears blank; normalize the ID to a key before using the key selector, or make the key-selector detail path resolve legacy numeric IDs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/workflows/migrations/subblock-migrations.ts, line 146:
<comment>When a legacy basic search block stores a numeric `spaceSelector` value, this rename moves it into the key-based selector without converting the value. The `confluence.spaces` detail lookup then treats `12345` as a key instead of resolving it to `ENG`, so the migrated selector cannot hydrate and appears blank; normalize the ID to a key before using the key selector, or make the key-selector detail path resolve legacy numeric IDs.</comment>
<file context>
@@ -140,6 +140,14 @@ export const SUBBLOCK_ID_MIGRATIONS: Record<string, readonly SubblockIdMigration
+ confluence_v2: [
+ {
+ from: 'spaceSelector',
+ to: 'spaceKeySelector',
+ whenOperation: ['search_in_space'],
+ },
</file context>
There was a problem hiding this comment.
Addressed in 46fda04. The key-based confluence.spaces detail path now recognizes legacy numeric values, hydrates them through GET /api/v2/spaces/{id}, and preserves the stored numeric option ID while returning the provider label. Added a focused regression test; the Confluence block, selector-provider, and operation suites pass (3 files, 17 tests).
|
@cubic-dev-ai re-review this PR, focusing on legacy numeric search-selector hydration. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 7 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Re-trigger cubic
Live Confluence browser validationValidated against simselector829.atlassian.net using Software Development (key SD, numeric ID 557061).
|











Summary
Fixes Confluence workflow failures caused by mixing human-readable space keys with numeric Confluence Cloud space IDs.
The mismatch pre-existed PR #7185: selectors could save a key such as
ENG, while the Confluence V2 runtime paths and bodies require the numeric space ID. This PR:search_in_spacea key-based selector because V1 CQL searches by space key;Affected operations
Numeric V2 ID semantics:
create_pageget_spaceupdate_spacedelete_spacelist_pages_in_spacecreate_blogpostlist_blogposts_in_spacelist_space_labelslist_space_permissionslist_space_propertiescreate_space_propertydelete_space_propertyKey semantics:
search_in_spaceAtlassian API evidence
spaceIdrequest fields.Type of Change
Testing
Focused behavior-level coverage was added without duplicating every operation:
spaceKey;ENGto12345, uses/spaces/12345/pages, and passes numeric12345through without lookup;ENGbefore constructing key-based V1 CQL.Validation completed:
bun run test -- blocks/blocks/confluence.test.ts lib/internal/confluence/operations.test.ts lib/internal/confluence/execute-tool.test.ts lib/selectors/server/providers/confluence.test.ts connectors/confluence/confluence.test.ts blocks/blocks.test.ts— 6 files, 199 tests passedbun run apps/sim/scripts/check-canvas-sentences.ts --block=confluence_v2— 46/46 passedbun run type-check— passedbun run check:api-validation— passedgit diff --check— passedBrowser validation was attempted, but the stored Confluence OAuth credential returned Atlassian HTTP 401. No live provider result or screenshots are included; the PR was opened after that browser gate was explicitly waived.
Reviewers should focus on selector value semantics, the search-only subblock migration, exact-match legacy normalization, and unchanged connector behavior.
Checklist
Screenshots/Videos
Not included: live browser validation was blocked by the expired Confluence OAuth credential.