Skip to content

fix(scripts): improve vendoring process and reorganize dependencies #6388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

OttoAllmendinger
Copy link
Contributor

This PR includes several improvements to our vendoring process and the
organization of dependencies:

  1. Reorganizes the vendor-github-repo script to improve modularity:

    • Adds separate config types
    • Implements post-extraction hooks
    • Adds specific cleanup for babylonlabs-io/btc-staking-ts to remove
      dev and test files
  2. Moves BitGo-specific exports in babylonlabs-io-btc-staking-ts to a
    separate section for better maintainability

  3. Updates documentation:

    • Updates reference to upstream repository version from v0.4.0-rc.2 to
      v1.0.3 in README and patch files

BTC-2143

OttoAllmendinger and others added 3 commits July 3, 2025 13:33
Restructures vendor-github-repo script into a modular layout with separate
config types and post-extraction hooks. Adds specific cleanup for
babylonlabs-io/btc-staking-ts to remove dev and test files.

Issue: BTC-2143

Co-authored-by: llm-git <[email protected]>
Updates the reference to the upstream repository version from v0.4.0-rc.2
to v1.0.3 in both the README and patch files.

Issue: BTC-2143

Co-authored-by: llm-git <[email protected]>
import * as tmp from 'tmp';
import * as yargs from 'yargs';
import { GithubSource, VendorConfig } from './VendorConfig';
import { createPatchForCommit, getCommitsFromRange, getCommitsFromSpec } from './git';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import getCommitsFromRange.

Copilot Autofix

AI 1 day ago

To fix the issue, we should remove the unused getCommitsFromRange import from the import statement on line 6. This will clean up the code and eliminate the unnecessary import. No other changes are required since this import is not used anywhere in the provided code.


Suggested changeset 1
scripts/vendor-github-repo/main.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/vendor-github-repo/main.ts b/scripts/vendor-github-repo/main.ts
--- a/scripts/vendor-github-repo/main.ts
+++ b/scripts/vendor-github-repo/main.ts
@@ -5,3 +5,3 @@
 import { GithubSource, VendorConfig } from './VendorConfig';
-import { createPatchForCommit, getCommitsFromRange, getCommitsFromSpec } from './git';
+import { createPatchForCommit, getCommitsFromSpec } from './git';
 
EOF
@@ -5,3 +5,3 @@
import { GithubSource, VendorConfig } from './VendorConfig';
import { createPatchForCommit, getCommitsFromRange, getCommitsFromSpec } from './git';
import { createPatchForCommit, getCommitsFromSpec } from './git';

Copilot is powered by AI and may make mistakes. Always verify output.
if (!result.ok) {
throw new Error(`Failed to fetch ${url}: ${result.status} ${result.statusText}`);
}
await fs.writeFile(outfile, Buffer.from(await result.arrayBuffer()));

Check warning

Code scanning / CodeQL

Network data written to file Medium

Write to file system depends on
Untrusted data
.
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.

1 participant