Fix npm tarball path and guard recovery of original v1.0.0 artifact - #18
Merged
Merged
Conversation
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.
Current situation
The v1.0.0 publish job passed
distribution/homebridge-node-icmp-ping-1.0.0.tgzto npm. npm interpreted it as GitHub owner/repository shorthand and attempted an SSH Git lookup. Rerunning that job would execute the broken tagged publisher again.Proposed solution
Use
path.resolve(directory, filename)so npm receives an absolute local path. Preserve all existing integrity, registry preflight/read-back, provenance, access, dist-tag and recovery checks. The regression exercises relative-directory preflight and the actual default npm writer, intercepting external execution; it fails when the old path.join line is restored.Add a separate, narrowly pinned manual recovery job inside publish.yml, preserving Trusted Publisher workflow identity, npm-production, the npm-production-publication concurrency lock, OIDC/provenance and Node/npm versions. All original normal-release jobs are byte-for-byte unchanged. Dispatch requires current main and exact confirmation recover-v1.0.0. It cannot enter build, loader-repair, assembly or packing jobs.
Recovery pins:
The script verifies the archive digest as a hard failure before extracting only its original tarball and integrity.json. It validates original version files, live release identity/channel, unmoved tag, main ancestry and unchanged package/version/loader inputs. It rechecks release/tag identity before registry preflight. No input can override identities or select substitute bytes; missing/expired artifacts, changed evidence and checksum failures stop without a rebuild fallback.
An existing npm version is verified without republishing only when identity, original SHA-512 and intended dist-tag match. Inconsistent state or lookup failure aborts without automatic repair. Every publication attempt retains fresh registry read-back.
Release notes
Fix local tarball publication and document recovery using the original tested artifact. No package version, native code or runtime API changes.
Additional information
Reviewed recovery procedure
After review and merge, and only when separately authorized to publish:
This exception avoids introducing a general historic-run publisher without a broader reviewed trust policy. Provenance identifies the recovery workflow/main commit; pinned artifact/run checks connect the published bytes to the original tested release.
Testing
Live OIDC publication is intentionally unexecuted. No npm publication, recovery dispatch, failed-run rerun, release/tag mutation or merge was performed.
Reviewer nudging
Start with scripts/recover-v1.js and the separate recover-v1 job in publish.yml, then the recovery/argument regression tests and docs/releasing.md.