Skip to content

feat: Modernize and open-source - #18

Merged
afshin merged 8 commits into
mainfrom
open-source
Apr 10, 2026
Merged

feat: Modernize and open-source#18
afshin merged 8 commits into
mainfrom
open-source

Conversation

@afshin

@afshin afshin commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

This PR gets notebook-metrics much closer to first open-source release shape.
It renames the package surfaces from notebook_link_metrics to
notebook_metrics / notebook-metrics, cleans up release and onboarding
material, and hardens the implementation and tests around the core metrics
flows.

Highlights

  • Rename Python package, config, and test surfaces to notebook_metrics /
    notebook-metrics and align install metadata, schemas, and server config.
  • Add release-facing project polish: BSD licensing cleanup, new onboarding and
    release documentation, dependency modernization, and CI updates for build and
    integration coverage.
  • Replace the JupyterError backend from rendermime interception to notebook
    execution failures while preserving the existing schema URL and payload shape.
  • Harden dispatcher behavior by catching collector failures and continuing to
    dispatch subsequent events.
  • Expand unit and integration coverage, including backend event-capture support
    and Playwright coverage for command, notebook-execution, and runtime-error
    emissions.
  • Record the validated frontend runtime expectations with Node >=24 and move
    TypeScript off the deprecated moduleResolution: "node" setting.

Copilot AI 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.

Pull request overview

This PR prepares notebook-metrics for an initial open-source release by renaming package surfaces (Python + npm), modernizing dependencies/CI, and tightening the core metrics emission/dispatch flows with expanded unit + UI test coverage.

Changes:

  • Rename package identifiers from notebook_link_metrics / @notebook-link/metrics to notebook_metrics / notebook-metrics across code, config, docs, and CI.
  • Rework the JupyterError metric to be emitted from notebook execution failures (via NotebookActions.executed) and harden dispatching by catching collector failures.
  • Add/expand Jest + Playwright integration coverage, including a test-only server extension to capture backend events.

Reviewed changes

Copilot reviewed 32 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Updates frontend dependency lockfile to newer JupyterLab/related packages.
ui-tests/tests/notebook_metrics.spec.ts Adds Playwright coverage for backend-captured command, execution error, and runtime error emissions.
ui-tests/tests/notebook_link_metrics.spec.ts Removes legacy placeholder UI test for the old package name.
ui-tests/README.md Updates UI test instructions and recommends disabling auto-open of HTML report.
ui-tests/playwright.config.js Improves webServer shutdown handling and adjusts stdout/stderr capture.
ui-tests/package.json Renames UI tests package, bumps Galata/Playwright, and sets Node engine to >=24.
ui-tests/metrics-override.yml Adds a test override to enable/allow the built-in schemas during UI tests.
ui-tests/jupyter_server_test_config.py Configures Jupyter server for UI tests, enabling notebook_metrics + capture extension and setting override env var.
ui-tests/event_capture_extension.py Adds a test-only server extension to capture emitted metrics via a REST API.
tsconfig.json Switches TS moduleResolution to bundler and enables skipLibCheck.
src/plugins.ts Updates plugin IDs/name usage, removes rendermime dependency, merges excluded config sources, and catches collector failures.
src/metrics.ts Renames exported plugin ID constants to notebook-metrics:* and updates imports to type-only where appropriate.
src/emissions/jupyter-error.ts Changes JupyterError emission source from rendermime interception to notebook execution failures.
src/tests/notebook_metrics.spec.ts Adds substantial Jest coverage for emissions + dispatcher filtering/override behavior and collector failure handling.
src/tests/notebook_link_metrics.spec.ts Removes legacy placeholder Jest test for the old package name.
schema/dispatcher.json Updates settings schema title/description to the new project naming.
RELEASE.md Rewrites release documentation for the new package names and Jupyter Releaser-driven flow.
README.md Updates public docs for new naming, install/uninstall, requirements, and test workflows.
pyproject.toml Renames PyPI project to notebook-metrics and updates build artifact paths to notebook_metrics.
package.json Renames npm package, updates license to BSD-3-Clause, bumps JupyterLab deps, and sets Node engine to >=24.
ONBOARDING.md Adds detailed onboarding guide covering mental model, configuration precedence, and integration paths.
notebook_metrics/tests/test_pass.py Adds Python tests for schema registration and backend listener collection behavior.
notebook_metrics/tests/init.py Adds test package marker/docstring for notebook_metrics tests.
notebook_metrics/emissions/runtime-error.yml Adds runtime-error event schema YAML under new package layout.
notebook_metrics/emissions/jupyter-error.yml Updates schema title/description to reflect notebook execution error semantics.
notebook_metrics/emissions/current-changed.yml Adds current-changed event schema YAML under new package layout.
notebook_metrics/emissions/command-executed.yml Adds command-executed event schema YAML under new package layout.
notebook_metrics/init.py Updates declared JS/Python package names and keeps schema registration + override injection.
notebook_link_metrics/tests/test_pass.py Removes obsolete test file under old Python package name.
notebook_link_metrics/tests/init.py Removes obsolete test package marker under old Python package name.
LICENSE Replaces “UNLICENSED” with BSD-3-Clause license text.
jupyter-config/server-config/notebook_metrics.json Updates server extension enablement name to notebook_metrics.
jest.config.js Updates Jest ESM transform allowlist and ignores generated labextension output under notebook_metrics.
install.json Updates installation metadata to new PyPI project name notebook-metrics.
conftest.py Updates pytest Jupyter server extension enablement name to notebook_metrics.
.prettierignore Updates ignore path from notebook_link_metrics to notebook_metrics.
.gitignore Updates ignored labextension/version paths to notebook_metrics and adds junit.xml + .vscode.
.github/workflows/build.yml Updates CI for renamed artifacts/packages and Playwright artifact naming.
.copier-answers.yml Updates copier metadata to new labextension/python package names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@afshin
afshin merged commit 04eb324 into main Apr 10, 2026
4 checks passed
@afshin
afshin deleted the open-source branch April 10, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants