test: add coverage for export link pages, GHA onboarding, and OAS discovery - #1530
Merged
Conversation
|
| Filename | Overview |
|---|---|
| test/commands/pages/export.test.ts | Adds coverage for link-page exports, cleanup, recursive discovery, malformed metadata, and export-path containment. |
| test/commands/pages/upload.test.ts | Adds upload regression coverage for invalid metadata, ordering, and shared page-processing behavior. |
| test/lib/createGHA.test.ts | Expands coverage for repository eligibility gates, forced onboarding, workflow creation, and repository-root handling. |
| test/commands/openapi/validate.test.ts | Covers missing, ambiguous, and conversion-failing OpenAPI definitions. |
| test/commands/docs/migrate.test.ts | Exercises migration hook failures, transformed output, statistics, validation bypass, and zipped input handling. |
| test/lib/fetch.test.ts | Adds API warning-header and OpenAPI source-URL coverage. |
| test/lib/safePath.test.ts | Extends path-segment safety coverage to embedded traversal markers. |
Reviews (4): Last reviewed commit: "chore: refresh GitHub Actions workflow J..." | Re-trigger Greptile
Second pass after the weekly coverage run. Adds plugin hook tests for docs migrate, export restructure warnings, OpenAPI upload abort/error paths, and remaining shared-utility edges. No production changes. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
…usal Add remaining high-value command tests for inspect Wow!/3.1 URL fallbacks, resolve circular-ref error paths, export directory escape, legacy changelog parent sorting, and GHA/upload edge cases. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
normalizeFilePath still returns a cwd-relative path when revparse fails, so the header is still sent. The previous assertion expected a Hello-World blob URL that only worked while the git mock missed the production singleton.
Keep schemas:check in lint aligned with SchemaStore's github-workflow.json.
erunion
marked this pull request as ready for review
September 9, 2026 19:08
erunion
approved these changes
Sep 9, 2026
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.
🪛 Changes
Adds focused regression tests for export, GitHub Action onboarding, OpenAPI discovery, and shared upload/API paths that still had weak coverage after #1523 and #1524. No production behavior was changed.
Risky behavior now covered
--docs-onlylink exports: emptytype: linkpages are still written and keepcontent.link. This is the documented exception from fix(export): honor --docs-only when skipping empty pages #1523; without it, reference/docs grouping links disappear on export-then-upload..temp_downloadinstead of leaving a partial tree.createGHAgit gates: not-a-repo, no remotes, unreachable remotes, and non-GitHub remotes skip onboarding (the oclif-hook versions of these cases remainit.skip).--githubstill forces onboarding; the workflow directory is created when missing; the process chdirs to the repo root before writing.--keyis replaced withsecrets.README_API_KEY,--githubis omitted, and commands without a key do not ask the user to create that secret.openapi validateerrors when no definition is found, and in CI it refuses to pick among multiple discovered files.x-readme-source-url.positionvalues sort numerically; a legacylinkfield merges onto an existingcontentobject; login that does not persist a key fails closed; commands without--keyskip flag rewriting.isSafePathSegment: rejectsfoo..bar(embedded..without slashes).Test files added/updated
test/commands/pages/export.test.tstest/commands/pages/upload.test.tstest/commands/openapi/validate.test.tstest/lib/createGHA.test.tstest/lib/fetch.test.tstest/lib/frontmatter.test.tstest/lib/hooks.test.tstest/lib/safePath.test.tsWhy these tests materially reduce regression risk
These paths sit on export-then-upload, GHA onboarding, and spec discovery. A silent change can drop link grouping pages, write outside the export tree, prompt for a workflow in GitLab/CI, pick the wrong OpenAPI file in CI, or upload children before parents when
positionis quoted in YAML. The new tests assert those contracts directly instead of relying on skipped hook tests or snapshots. QA & Testing
366 targeted tests passed (15 skipped, 10 todo). No production behavior was changed.