Skip to content

Reproducible generation script#136

Open
josedahlquist wants to merge 4 commits into
masterfrom
reproducible-generation-script
Open

Reproducible generation script#136
josedahlquist wants to merge 4 commits into
masterfrom
reproducible-generation-script

Conversation

@josedahlquist

Copy link
Copy Markdown
Collaborator

These changes are proposing a script to automatically create reproducible builds for rskj and/or powpeg-node using existing tags. This is done through a set of js scripts that allow to create the repro and allows others to validate them as well.

The script interacts with Github and Docker.

This commits proposes a script to automatically create reproducible builds for rskj and/or powpeg-node using existing tags.
This is done through a single js script that allows to create the repro and allows others to validate them as well.

The script interacts with Github and Docker.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a zero-dependency (Node-only) toolchain under scripts/ to (1) scaffold and build new reproducible-build folders from existing templates and (2) validate reproducible-build PRs by re-building and comparing declared vs reproduced artifact hashes.

Changes:

  • Added scripts/generate-build.js: a CLI to generate reproducible-build folders from the newest existing template, compute hashes via Docker, commit/push a branch, and open a PR; also includes a validate mode to rebuild a PR and comment hash verification results.
  • Added scripts/lib.js: pure logic for tag parsing, component conventions, version substitution, sha-block parsing/injection, and PR URL/build-folder detection.
  • Added scripts/lib.test.js and scripts/README.md: unit tests for the pure logic plus documentation for usage and safety behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
scripts/README.md Documents the new generator/validator workflow, requirements, and usage.
scripts/lib.test.js Adds Node test-runner unit tests covering the pure helper logic.
scripts/lib.js Implements deterministic parsing/substitution/hash-block utilities used by the CLI.
scripts/generate-build.js Implements the main generation + validation flows (git/Docker/GitHub interactions).

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

Comment thread scripts/generate-build.js
Comment thread scripts/generate-build.js Outdated
Comment thread scripts/generate-build.js Outdated
Comment thread scripts/README.md Outdated
Comment thread scripts/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 18:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread scripts/generate-build.js
Comment thread scripts/lib.js
Comment thread scripts/lib.js
Comment thread scripts/lib.js
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread scripts/generate-build.js
Comment on lines +85 to +90
const die = (msg, code = 2) => {
console.error(c.red('error: ') + msg);
process.exit(code);
};
const step = (msg) => console.log(c.cyan('• ') + c.bold(msg));

Comment thread scripts/generate-build.js
Comment on lines +396 to +399
// Create the branch BEFORE writing any files into the repo, so a clean tree
// is checked out and there are no untracked files to collide with.
step(`Creating branch ${branch} off ${remote}/${base}`);
git(['checkout', '-B', branch, `${remote}/${base}`], repoDir);
Comment thread scripts/README.md
Comment on lines +27 to +30
2. **Verifies the git tag exists** in the source repo (fail fast before the long build). The
tag — not a GitHub release — is the reference, because the release is published *after* the
reproducible build is accepted. Source integrity is then enforced inside the build itself
(the Dockerfile GPG-verifies `SHA256SUMS` for the checked-out source).
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