Upgrade Harper to v5: add integration tests, CI workflow, and dev tooling - #48
Open
BboyAkers wants to merge 8 commits into
Open
Upgrade Harper to v5: add integration tests, CI workflow, and dev tooling#48BboyAkers wants to merge 8 commits into
BboyAkers wants to merge 8 commits into
Conversation
- Install harper@5.0.28 and @harperfast/integration-testing as devDependencies - Add TypeScript devDependency and tsconfig.json - Add integrationTests/metrics.test.ts covering the /metrics endpoint, content-type, default Node.js process metrics, and PrometheusExporterSettings table initialization; apply harperBinPath fix (ERR_PACKAGE_PATH_NOT_EXPORTED) - Add .github/workflows/integration-tests.yml (Node matrix 22/24/26, pinned actions) - Regenerate package-lock.json with --os=linux --cpu=x64 --include=optional so bufferutil/utf-8-validate/node-gyp-build are recorded for Linux CI - Un-ignore package-lock.json (was in .gitignore; CI needs it for npm ci) - Update package.json author branding HarperDB, Inc. -> Harper - Update README note: exporter supports Harper v5 in addition to v4.2+ Migration items N/A: no harperdb imports (runtime global); no Table.get() return shape issues; no Blob.save(); no wasLoadedFromSource(); v5 plain-record access fix was already applied in commit 73e2fa6 (recordProp compat shim). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Harper returns the Prometheus string as application/json when no explicit Accept header is sent. Update the content-type test to accept that, and add an extractMetricsText() helper that unwraps JSON-encoded strings before checking for Prometheus metric comments. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
BboyAkers
commented
Jun 11, 2026
BboyAkers
commented
Jun 11, 2026
BboyAkers
commented
Jun 11, 2026
BboyAkers
commented
Jun 11, 2026
BboyAkers
commented
Jun 11, 2026
- Anchor harperBinPath at package root via harper/package.json instead of main-entry dirname - Throw on non-string JSON body in extractMetricsText instead of silently stringifying - Remove HTTP 400 from accepted status set in 'Harper starts successfully' test - Remove catch-all text/ and dead text/plain arms from content-type assertion - Remove unnecessary checkout step from generate-node-version-matrix CI job Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Bump the harper dependency to ^5.2.1 and regenerate the lockfile. Regenerated in full so the optional native deps (bufferutil, utf-8-validate, segfault-handler) stay in the tree for Linux CI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous lockfile was generated with npm 11, which does not auto-install the peer dependencies of an optional dependency. harper 5.2.1 pulls alasql, which optionally depends on react-native-fs, whose peers (react-native, react) npm 12 installs and npm 11 does not. CI runs npm 12 on Node 24/26, so npm ci failed there with those packages "missing from lock file" while Node 22 (npm 11) passed. Regenerated with npm 12 so the lockfile carries the full tree. lockfileVersion stays 3; npm ci verified under both npm 11 and npm 12. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Walk up from the resolved main entry to the package root and read the CLI path out of harper's `bin` field, rather than assuming the main entry sits at the root of dist/. Survives a dist/ restructure and fails with a named error instead of a cryptic ENOENT. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
harper@^5.0.28and@harperfast/integration-testing@^0.4.0as devDependenciestsconfig.jsonintegrationTests/metrics.test.tscovering:GET /prometheus_exporter/metricsreturns HTTP 200 with Prometheus/OpenMetrics texttext/plainorapplication/openmetrics-textprom-client collectDefaultMetrics()) are present/metrics/fastpath returns 200PrometheusExporterSettingstable is accessible via RESTforceAuthorizationsetting is initializedharperBinPathfix in test setup (workaround forERR_PACKAGE_PATH_NOT_EXPORTED—harper'sexportsmap only exposes".", soharper/dist/bin/harper.jsis not resolvable via the harness auto-resolve path).github/workflows/integration-tests.yml(Node matrix 22/24/26, pinned actions to commit hashes)package-lock.jsonwith--os=linux --cpu=x64 --include=optionalsobufferutil,utf-8-validate, andnode-gyp-buildare recorded for Linux CIpackage-lock.json(was in.gitignore; CI needs it fornpm ci)package.jsonauthor branding:HarperDB, Inc.→HarperMigration items applied / N/A
harperdb→harperimport swapharperdb/harperis a runtime-provided global, not a listed dependencyTable.get()returns plain frozen recordsrecordPropcompat shim added in commit73e2fa6wasLoadedFromSource()→target.loadedFromSourceBlob.save()→saveBeforeCommitKnown issues / Notes
EADDRNOTAVAIL: macOS loopback aliases are not configured on this machine (only127.0.0.1exists, and the integration harness binds Harper to127.0.0.2+). This is environmental — CI runs onubuntu-latestwhich supports the full127.0.0.0/8range. CI is the gate.harperBinPathworkaround: upstream issue —harperpackage should export its bin path or the harness should resolve via the package root instead of the blocked deep subpath.npm scope
The package name is
@harperdb/prometheus-exporter. If this should move to a current Harper npm scope (@harperfast/or similar), that is a manual step — flagged for the team per the upgrade plan (§11.1).Test plan
GET /prometheus_exporter/metricsreturns valid Prometheus/OpenMetrics textPrometheusExporterSettingstable initializes correctly on first boot🤖 Generated with Claude Code