Skip to content

fix(slides): migrate SML namespace from HTTP to HTTPS - #2169

Merged
ethan-zhx merged 2 commits into
mainfrom
fix/slides_sml_namespace
Aug 4, 2026
Merged

fix(slides): migrate SML namespace from HTTP to HTTPS#2169
ethan-zhx merged 2 commits into
mainfrom
fix/slides_sml_namespace

Conversation

@ethan-zhx

@ethan-zhx ethan-zhx commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrate the SML 2.0 namespace from http://www.larkoffice.com/sml/2.0 to https://www.larkoffice.com/sml/2.0 across the entire codebase: protocol schema, production code, Skill docs, and all tests.

Changes

  • Protocol source: XSD targetNamespace and xmlns:sml → HTTPS
  • Production code: buildPresentationXML in slides_create.go now emits HTTPS
  • Validator: SML_NAMESPACE is now HTTPS; old HTTP URI kept as SML_LEGACY_HTTP_NAMESPACE; ACCEPTED_SML_NAMESPACES retains three-format compat (HTTPS, HTTP, /sml/2.0)
  • Lint: SML_NAMESPACE → HTTPS; validate_sml_tag_prefixes now checks against all accepted namespaces (was previously HTTP-only, missing HTTPS-prefixed tags)
  • Demo template: slides_chart_demo.xml changed from /sml/2.0 to HTTPS
  • Docs: 6 Skill reference markdown files updated to HTTPS
  • Tests: 8 Go test files + Python lint tests → HTTPS; new test_lint_xml_accepts_legacy_http_namespace regression test

Design

  • HTTPS is the canonical namespace for all generation and documentation
  • HTTP and /sml/2.0 remain accepted by the lint validator for backward compatibility with existing content

Verification

  • python3 -m unittest xml_text_overlap_lint_test — 185 tests pass

Summary by CodeRabbit

  • Enhancements

    • Slide XML generation and examples now use the secure HTTPS namespace as the canonical format.
    • Validation continues to recognize legacy HTTP and supported readback namespaces for compatibility.
    • Improved lint diagnostics and preservation of supplied file paths during validation.
  • Documentation

    • Updated slide XML guides, schema references, examples, and validation guidance to use HTTPS.
  • Tests

    • Expanded coverage for namespace handling, legacy compatibility, diagnostics, and file-path behavior.

@github-actions github-actions Bot added the size/L Large or sensitive change across domains or core paths label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 07d2ce64-d736-4c95-aeb4-cd2f36c7b43f

📥 Commits

Reviewing files that changed from the base of the PR and between 55b6f58 and d52966d.

📒 Files selected for processing (21)
  • shortcuts/slides/slides_add_slide_test.go
  • shortcuts/slides/slides_create.go
  • shortcuts/slides/slides_create_test.go
  • shortcuts/slides/slides_replace_pages_test.go
  • shortcuts/slides/slides_screenshot_test.go
  • skills/lark-slides/references/lark-slides-add-slide.md
  • skills/lark-slides/references/lark-slides-create.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-slides/references/slides_chart_demo.xml
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • skills/lark-slides/references/validation-checklist.md
  • skills/lark-slides/references/xml-schema-quick-ref.md
  • skills/lark-slides/scripts/sxsd_validator.py
  • skills/lark-slides/scripts/xml_text_overlap_lint.py
  • skills/lark-slides/scripts/xml_text_overlap_lint_test.py
  • tests/cli_e2e/slides/slides_create_workflow_test.go
  • tests/cli_e2e/slides/slides_history_workflow_test.go
  • tests/cli_e2e/slides/slides_screenshot_dryrun_test.go
  • tests/cli_e2e/slides/slides_screenshot_workflow_test.go
  • tests/cli_e2e/slides/slides_slide_add_delete_dryrun_test.go
  • tests/cli_e2e/slides/slides_slide_add_delete_workflow_test.go
🚧 Files skipped from review as they are similar to previous changes (16)
  • tests/cli_e2e/slides/slides_slide_add_delete_workflow_test.go
  • shortcuts/slides/slides_create.go
  • shortcuts/slides/slides_add_slide_test.go
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • tests/cli_e2e/slides/slides_slide_add_delete_dryrun_test.go
  • tests/cli_e2e/slides/slides_create_workflow_test.go
  • tests/cli_e2e/slides/slides_history_workflow_test.go
  • shortcuts/slides/slides_screenshot_test.go
  • skills/lark-slides/references/lark-slides-add-slide.md
  • skills/lark-slides/references/xml-schema-quick-ref.md
  • skills/lark-slides/references/slides_chart_demo.xml
  • skills/lark-slides/references/validation-checklist.md
  • shortcuts/slides/slides_replace_pages_test.go
  • skills/lark-slides/references/lark-slides-create.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • shortcuts/slides/slides_create_test.go

📝 Walkthrough

Walkthrough

The change makes HTTPS the canonical Lark Slides SML namespace across generated XML, validators, fixtures, end-to-end tests, schemas, and documentation. Validators continue to accept legacy namespaces and now preserve declared namespace and input-path details in diagnostics.

Changes

Slides SML namespace

Layer / File(s) Summary
Namespace contract and validation
shortcuts/slides/slides_create.go, skills/lark-slides/scripts/*, skills/lark-slides/references/slides_xml_schema_definition.xml, shortcuts/slides/slides_create_test.go
Generated XML and validator constants use HTTPS. Legacy namespaces remain accepted. Namespace diagnostics report the declared value, and CLI results preserve the requested path.
Slide command XML fixtures
shortcuts/slides/*_test.go
Creation, addition, replacement, and screenshot fixtures use HTTPS across normal, failure, dry-run, and image scenarios.
End-to-end workflow fixtures
tests/cli_e2e/slides/*
Slide creation, history, add/delete, and screenshot workflow inputs use HTTPS.
Examples and schema documentation
skills/lark-slides/references/*
Examples, schema definitions, validation guidance, and sample presentations declare HTTPS.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • larksuite/cli#2120: Related Slides XML namespace handling in shared slide creation and test files.

Suggested reviewers: bd-zero

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the migration of the SML namespace from HTTP to HTTPS.
Description check ✅ Passed The description includes the summary, changes, design, and verification details, but omits the manual verification item and Related Issues section.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/slides_sml_namespace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
skills/lark-slides/scripts/xml_text_overlap_lint_test.py (1)

289-305: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Extend the regression test to cover prefixed legacy namespaces.

These lines cover only an unprefixed HTTP root. The production change in skills/lark-slides/scripts/xml_text_overlap_lint.py Line 686 also changes prefixed-tag validation to use ACCEPTED_SML_NAMESPACES. Add cases for prefixed elements bound to the legacy HTTP URI and /sml/2.0, and assert sml_prefixed_tag. Otherwise, reverting the production change would still leave this test green.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-slides/scripts/xml_text_overlap_lint_test.py` around lines 289 -
305, Extend test_lint_xml_accepts_legacy_http_namespace with prefixed XML cases
bound to both legacy HTTP namespace URIs, including /sml/2.0, and assert the
resulting sml_prefixed_tag behavior. Ensure the test would fail if prefixed-tag
validation no longer uses ACCEPTED_SML_NAMESPACES, while preserving the existing
unprefixed acceptance assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@skills/lark-slides/scripts/xml_text_overlap_lint_test.py`:
- Around line 289-305: Extend test_lint_xml_accepts_legacy_http_namespace with
prefixed XML cases bound to both legacy HTTP namespace URIs, including /sml/2.0,
and assert the resulting sml_prefixed_tag behavior. Ensure the test would fail
if prefixed-tag validation no longer uses ACCEPTED_SML_NAMESPACES, while
preserving the existing unprefixed acceptance assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ee5e0cd-d976-4b7c-83a8-599df1f17afa

📥 Commits

Reviewing files that changed from the base of the PR and between 0f29e03 and 55b6f58.

📒 Files selected for processing (20)
  • shortcuts/slides/slides_add_slide_test.go
  • shortcuts/slides/slides_create.go
  • shortcuts/slides/slides_create_test.go
  • shortcuts/slides/slides_replace_pages_test.go
  • shortcuts/slides/slides_screenshot_test.go
  • skills/lark-slides/references/lark-slides-add-slide.md
  • skills/lark-slides/references/lark-slides-create.md
  • skills/lark-slides/references/lark-slides-replace-pages.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-slides/references/slides_chart_demo.xml
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • skills/lark-slides/references/validation-checklist.md
  • skills/lark-slides/references/xml-schema-quick-ref.md
  • skills/lark-slides/scripts/sxsd_validator.py
  • skills/lark-slides/scripts/xml_text_overlap_lint.py
  • skills/lark-slides/scripts/xml_text_overlap_lint_test.py
  • tests/cli_e2e/slides/slides_create_workflow_test.go
  • tests/cli_e2e/slides/slides_history_workflow_test.go
  • tests/cli_e2e/slides/slides_slide_add_delete_dryrun_test.go
  • tests/cli_e2e/slides/slides_slide_add_delete_workflow_test.go

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@d52966de399c73c018b9f0881681f441d8690dad

🧩 Skill update

npx skills add larksuite/cli#fix/slides_sml_namespace -y -g

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.70%. Comparing base (b299794) to head (d52966d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2169   +/-   ##
=======================================
  Coverage   75.70%   75.70%           
=======================================
  Files         944      944           
  Lines      100288   100288           
=======================================
  Hits        75926    75926           
  Misses      18565    18565           
  Partials     5797     5797           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

R0bynZhu
R0bynZhu previously approved these changes Aug 4, 2026
Comment thread shortcuts/slides/slides_create.go
Comment thread skills/lark-slides/scripts/xml_text_overlap_lint.py Outdated
Comment thread shortcuts/slides/slides_create_test.go
- Change canonical namespace to https://www.larkoffice.com/sml/2.0
  in protocol schema, production code, docs, and tests
- Keep HTTP and /sml/2.0 as legacy readback compat in validator
- Fix sml_prefixed_tag check to cover all accepted SML namespaces
- Add regression test for legacy HTTP namespace acceptance
@ethan-zhx
ethan-zhx merged commit 3b66d47 into main Aug 4, 2026
32 of 44 checks passed
@ethan-zhx
ethan-zhx deleted the fix/slides_sml_namespace branch August 4, 2026 06:24
@liangshuo-1 liangshuo-1 mentioned this pull request Aug 4, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants