Skip to content

CODAP-1666: generate plugin API Tester templates from the reference - #2746

Draft
bfinzer wants to merge 1 commit into
mainfrom
CODAP-1666-api-tester-templates
Draft

bfinzer wants to merge 1 commit into
mainfrom
CODAP-1666-api-tester-templates

Conversation

@bfinzer

@bfinzer bfinzer commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes CODAP-1666

The plugin API Tester (DataInteractiveAPITester in codap-data-interactives) hasn't changed
since 2021 and covers only part of the API. This PR adds a generator that turns the request
examples in v3/doc/plugin-api/resources/ into tester templates. The tester changes are in
concord-consortium/codap-data-interactives#165.

Generator

  • scripts/plugin-api/generate-tester-templates.mjs keeps every json block whose action the
    inventory lists for its resource type. That test is what drops notifications CODAP sends
    (logMessageNotice, documentChangeNotice, global notify).
  • Each template is named from the prose that introduces its example, carries a link to its
    section of the reference, and is kept once when it appears on several pages.
  • npm run plugin-api:tester writes the file into a sibling clone of codap-data-interactives;
    npm run plugin-api:tester:check reports whether that copy is stale. CI can't run the check,
    because the file is in the other repo, so the plugin-api-docs skill now says when to run it.
  • The fenced-code and heading-anchor rules move into a shared markdown.mjs, which the lint
    now uses as well.

Reference
Request examples added so every documented resource and action has one: adornment update,
attribute delete, component delete, dataContext get (with a response captured from the handler)
and delete, and document update.

Testing

  • npm run plugin-api:check passes.
  • plugin.spec.ts (9/9) and map.spec.ts (13 passing, 4 already skipped) pass against the
    updated tester served locally.

🤖 Generated with Claude Code

- add scripts/plugin-api/generate-tester-templates.mjs and the plugin-api:tester and
  plugin-api:tester:check scripts
- add request examples for adornment update, attribute delete, component delete,
  dataContext get and delete, and document update, so every documented action has one
- move the fenced-code and heading-anchor rules into a shared markdown.mjs helper
- document the tester scripts in the plugin-api-docs skill

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bfinzer bfinzer added the v3 CODAP v3 label Oct 28, 2026
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.10%. Comparing base (a27e9aa) to head (f136d5f).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2746      +/-   ##
==========================================
- Coverage   88.11%   88.10%   -0.02%     
==========================================
  Files         825      825              
  Lines       47799    47799              
  Branches    12198    12185      -13     
==========================================
- Hits        42117    42111       -6     
- Misses       5666     5672       +6     
  Partials       16       16              
Flag Coverage Δ
cypress 69.90% <ø> (-0.02%) ⬇️
jest 64.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@cypress

cypress Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

codap-v3    Run #12586

Run Properties:  status check passed Passed #12586  •  git commit f136d5fff8: null
Project codap-v3
Branch Review CODAP-1666-api-tester-templates
Run status status check passed Passed #12586
Run duration 07m 29s
Commit git commit f136d5fff8: null
Committer null
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 82
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 387
View all changes introduced in this branch ↗︎

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the plugin API tester-template tooling changes.

No open issues 🎉

What changed in this PR

Adds tooling to generate plugin API Tester templates from CODAP v3’s API reference, supporting the companion tester update in codap-data-interactives.

Changes:

  • Generates deduplicated request templates with descriptive names and reference links, excluding CODAP notifications.
  • Adds missing request examples and shares Markdown parsing between the generator and documentation lint.
  • Adds generation and stale-check commands, with guidance for maintaining the output in the sibling repository.
File Description
v3/​scripts/​plugin-api/​markdown.mjs Adds shared fenced-code masking and heading-anchor helpers.
v3/​scripts/​plugin-api/​lint-plugin-api-docs.mjs Uses the shared heading-anchor helper.
v3/​scripts/​plugin-api/​generate-tester-templates.mjs Generates tester templates and checks for stale output.
v3/​package.json Adds tester generation and check commands.
v3/​doc/​plugin-api/​resources/​document.md Adds a document replacement request example.
v3/​doc/​plugin-api/​resources/​data-context.md Adds get/delete requests and a sample get response.
v3/​doc/​plugin-api/​resources/​component.md Adds a component deletion example.
v3/​doc/​plugin-api/​resources/​attribute.md Adds an attribute deletion example.
v3/​doc/​plugin-api/​resources/​adornment.md Adds an update example restoring adornment visibility.
.claude/​skills/​plugin-api-docs/​SKILL.md Documents template regeneration and cross-repository checks.

Review effort: Balanced

This branch was previously deployed

1 inactive deployment
development — f136d5ff Deployed Oct 28, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants