Update npm package migration script to have a cutoff date#96
Merged
joshjohanning merged 5 commits intojoshjohanning:mainfrom Jun 17, 2025
Merged
Conversation
Owner
|
Thank you @a-magdy! I love a lot of the changes here. I might default it to migrate everything instead of 1 year (since I think some people might miss this param otherwise?). Do you have a preferred way to do this? Otherwise, great PR, thank you! 🙇 |
…FF_DATE default to be empty, which in turns will migrate all versions (keeping existing behaviour)
Contributor
Author
|
Thanks for taking the time, makes sense. I've updated the script to keep the existing default behavior |
joshjohanning
approved these changes
Jun 17, 2025
Owner
There was a problem hiding this comment.
Looks good to me! Thanks for the great contribution @a-magdy 🙇
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.
This pull request introduces several improvements to the
scripts/migrate-npm-packages-between-github-instances.shscript and updates the.env.examplefile to support environment variables. The changes enhance usability, add new functionality, and improve performance by optimizing API calls.Environment Variable Support:
.env.example: Added a template for required environment variables (SOURCE_HOST,SOURCE_ORG,GH_SOURCE_PAT,TARGET_HOST,TARGET_ORG,GH_TARGET_PAT) and a command to load them into the shell.Script Enhancements:
scripts/migrate-npm-packages-between-github-instances.sh: Updated the script to accept an optional fifth argument,CUTOFF_DATE, with a default value of one year ago, to filter package versions by creation date.scripts/migrate-npm-packages-between-github-instances.sh: Modified the usage check to allow passing fewer than five arguments, improving flexibility.Performance Optimization:
scripts/migrate-npm-packages-between-github-instances.sh: Cached package metadata in a temporary directory to reduce redundant API calls, improving script efficiency.