Skip to content

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

Open
ethan-zhx wants to merge 2 commits into
mainfrom
fix/slides_sml_namespace
Open

fix(slides): migrate SML namespace from HTTP to HTTPS#2169
ethan-zhx wants to merge 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

  • Bug Fixes

    • Updated generated Slide XML to use the secure HTTPS namespace.
    • Preserved compatibility with existing documents using the legacy HTTP namespace.
    • Improved lint output when validating files accessed through symbolic links.
  • Documentation

    • Updated Slide XML examples, schemas, validation guidance, and reference materials to consistently use HTTPS.
  • Tests

    • Updated slide creation, editing, replacement, screenshot, and end-to-end scenarios to reflect the current namespace behavior.

- 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
@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

📝 Walkthrough

Walkthrough

The Slides XML namespace now uses HTTPS as the canonical URI. Validators accept HTTPS, legacy HTTP, and readback namespaces. Test fixtures, end-to-end tests, schemas, examples, and validation guidance reflect the updated namespace.

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
Generated presentation XML uses HTTPS. Validators accept canonical, legacy, and readback namespaces. CLI linting preserves the requested input path.
Fixture and workflow validation
shortcuts/slides/*_test.go, skills/lark-slides/scripts/xml_text_overlap_lint_test.py, tests/cli_e2e/slides/*
Slide fixtures use HTTPS. Tests cover legacy HTTP namespace acceptance and symlink path preservation.
Examples and schema documentation
skills/lark-slides/references/*
Examples, schema references, sample XML, and validation guidance use the HTTPS namespace.

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

Possibly related PRs

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.38% 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 main change: migrating the Slides SML namespace from HTTP to HTTPS.
Description check ✅ Passed The description covers the migration scope, compatibility design, affected areas, and test results, but it does not explicitly document manual CLI verification.
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@55b6f58a914dd674a52c32eb90d53bdecc462a89

🧩 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.69%. Comparing base (2a16134) to head (55b6f58).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2169      +/-   ##
==========================================
+ Coverage   75.65%   75.69%   +0.03%     
==========================================
  Files         940      942       +2     
  Lines       99876   100079     +203     
==========================================
+ Hits        75564    75750     +186     
- Misses      18530    18537       +7     
- Partials     5782     5792      +10     

☔ 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.

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.

1 participant