npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@flxbl-io/sfops-migrator

v1.2.1

Published

Upgrade to revised issueops

Downloads

21

Readme

SFOPS Migrator

The SFOPS Migrator is a Node.js script that automates the migration of GitHub repository variables from an old format to a new format. It fetches issue details, creates new variables based on the old variables, and updates the repository with the migrated variables.

Prerequisites

  • Node.js (version 12 or above)
  • GitHub access token with appropriate permissions to read issues and manage repository variables
  • Repository owner and name

Installation

You can install the SFOPS Migrator script globally using npm:

npm install -g sfops-migrator

Usage

To run the SFOPS Migrator script, use the following command:

sfops-migrator OWNER REPO YOUR_GITHUB_ACCESS_TOKEN

Replace the following placeholders:

  • YOUR_GITHUB_ACCESS_TOKEN: Your GitHub access token with appropriate permissions.
  • OWNER: The owner of the repository.
  • REPO: The name of the repository.

Example:

sfops-migrator my-organization my-repo abc123def456

How It Works

The SFOPS Migrator script performs the following steps:

  1. Reads the GitHub access token, repository owner, and repository name from the command-line arguments.
  2. Fetches the existing repository variables using the GitHub API.
  3. For each variable ending with "_DEVSBX":
    • Parses the old variable value from JSON.
    • Fetches the issue details associated with the old variable using the issue number.
    • Extracts the source sandbox, days to keep, and user email from the issue body using regular expressions.
    • Creates a new variable object based on the old variable and the extracted details.
    • Checks if a variable with the upgraded name already exists in the repository.
    • If the upgraded variable doesn't exist, creates a new variable with the upgraded name and value.
    • If the upgraded variable already exists, skips the creation and logs a message.
  4. Logs the progress and status of the migration process using console logs with emojis.

Console Output

The script provides informative console logs to track the progress and status of the migration process. The console logs include:

  • 🚀 Starting SFOPS Migration for the specified owner and repo
  • ⚙️ Upgrading variable: [variable name]
  • 📝 Issue #[issue number]: [issue title]
  • ✅ Fetched issue details for issue #[issue number]
  • ⏭️ Variable [variable name] already exists. Skipping...
  • ✨ Created new variable: [variable name]
  • 🎉 SFOPS Migration completed successfully!

Error Handling

The script includes basic error handling:

  • If the GitHub access token, repository owner, or repository name is not provided as command-line arguments, an error message is logged, and the script exits with a non-zero status code.
  • If an error occurs during the API requests or variable creation, the error is thrown and logged.