Stabilize registry-assets parseArgs test under CI env #225

Closed
opened 2026-06-02 13:30:58 +00:00 by steve · 0 comments
Owner

Describe the issue.

Problem

scripts/publish-official-plugin-assets.test.mjs assumes parseArgs(...) defaults
commit to an empty string, but the implementation intentionally defaults to
env.GITHUB_SHA when that environment variable is present. CI sets
GITHUB_SHA, so the test fails only there.

Goal

Make the parser test deterministic across local and CI environments while
preserving the current parser behavior.

Scope

  • Update the affected parser unit test to control its environment explicitly.
  • Keep the current parseArgs(...) defaulting behavior intact.

Non-goals

  • Changing how official plugin asset publication chooses its default commit.
  • Changing release or upload workflow behavior.

Acceptance Criteria

  • The comma-separated --plugins parser test passes both locally and in CI.
  • The test no longer depends on ambient process.env.GITHUB_SHA.
  • The parser implementation still defaults commit from env.GITHUB_SHA when
    provided.

Implementation Notes

  • parseArgs(argv, env = process.env) already accepts an injected environment,
    so the test can pass {} instead of relying on the process environment.

Suggested Files or Specs To Inspect

  • scripts/publish-official-plugin-assets.mjs
  • scripts/publish-official-plugin-assets.test.mjs
  • spec/src/80-maintenance/monorepo-scripts.md

Validation Commands

  • pnpm test:scripts -- --test-name-pattern="parseArgs accepts comma-separated plugin selection and dry-run options"
  • pnpm test:scripts

Follow-up Tasks

Implementation Summary

Made the registry-assets parseArgs test deterministic under CI and added explicit coverage for GITHUB_SHA commit defaulting.

Describe the issue. ## Problem `scripts/publish-official-plugin-assets.test.mjs` assumes `parseArgs(...)` defaults `commit` to an empty string, but the implementation intentionally defaults to `env.GITHUB_SHA` when that environment variable is present. CI sets `GITHUB_SHA`, so the test fails only there. ## Goal Make the parser test deterministic across local and CI environments while preserving the current parser behavior. ## Scope - Update the affected parser unit test to control its environment explicitly. - Keep the current `parseArgs(...)` defaulting behavior intact. ## Non-goals - Changing how official plugin asset publication chooses its default commit. - Changing release or upload workflow behavior. ## Acceptance Criteria - The comma-separated `--plugins` parser test passes both locally and in CI. - The test no longer depends on ambient `process.env.GITHUB_SHA`. - The parser implementation still defaults `commit` from `env.GITHUB_SHA` when provided. ## Implementation Notes - `parseArgs(argv, env = process.env)` already accepts an injected environment, so the test can pass `{}` instead of relying on the process environment. ## Suggested Files or Specs To Inspect - `scripts/publish-official-plugin-assets.mjs` - `scripts/publish-official-plugin-assets.test.mjs` - `spec/src/80-maintenance/monorepo-scripts.md` ## Validation Commands - `pnpm test:scripts -- --test-name-pattern="parseArgs accepts comma-separated plugin selection and dry-run options"` - `pnpm test:scripts` ## Related Issues - Follow-up to #188 — [Publish and activate remaining official plugin registry releases](../closed/188-publish-and-activate-remaining-official-plugin-registry-releases.md) ## Follow-up Tasks ## Implementation Summary Made the registry-assets parseArgs test deterministic under CI and added explicit coverage for GITHUB_SHA commit defaulting. <!-- backlog:task_id=TASK-SCRIPTS-REGISTRY-ASSETS-PARSEARGS-CI source_spec=spec/src/80-maintenance/monorepo-scripts.md related_issue=188 -->
steve added this to the Full Registry V1 milestone 2026-06-02 13:30:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#225
No description provided.