OrgMaintenanceScripts.jl

Documentation for OrgMaintenanceScripts.

Package Features

This package provides maintenance scripts for SciML organization repositories, including:

  • Code Formatting: Automated formatting with JuliaFormatter across entire organizations
  • Version Bumping: Automatically bump minor versions in Project.toml files
  • Package Registration: Register packages to Julia registries
  • Minimum Version Fixing: Fix minimum version compatibility bounds to pass downgrade CI tests
  • Compat Bumping: Automatically update package compatibility bounds for dependencies
  • Version Check Finding: Find outdated VERSION checks that can be removed
  • Invalidation Analysis: Use SnoopCompileCore to detect performance bottlenecks
  • Import Timing Analysis: Analyze package loading times with @time_imports
  • Explicit Imports Fixing: Automatically fix implicit imports and remove unused imports
  • Documentation Cleanup: Remove bloated documentation files from gh-pages branches
  • Multiprocess Testing: Run tests in parallel similar to GitHub Actions CI workflows
  • Organization-wide Operations: Process entire organizations at once

Usage Examples

Code Formatting

using OrgMaintenanceScripts

# Format a single repository
success, message,
pr_url = format_repository(
    "https://github.com/SciML/Example.jl.git";
    fork_user = "myusername"
)

# Format all repos with failing CI
successes, failures,
pr_urls = format_org_repositories(
    "SciML";
    fork_user = "myusername",
    only_failing_ci = true
)

Version Bumping and Registration

using OrgMaintenanceScripts

# Bump minor versions and register all packages in a repository
result = bump_and_register_repo("/path/to/repo")

println("Registered packages: ", result.registered)
println("Failed packages: ", result.failed)

# Register monorepo packages without bumping versions
result = register_monorepo_packages("/path/to/monorepo")
println("Successfully registered: ", length(result.registered), " packages")

# Process all repositories in the SciML organization
results = bump_and_register_org("SciML"; auth_token = "your_github_token")

for (repo, result) in results
    println("$repo:")
    println("  Registered: ", result.registered)
    println("  Failed: ", result.failed)
end

Minimum Version Fixing

using OrgMaintenanceScripts

# Fix minimum versions for a single repository
success = fix_repo_min_versions("SciML/OrdinaryDiffEq.jl")

# Fix all repositories in an organization
results = fix_org_min_versions("SciML")

# Process only specific repositories
results = fix_org_min_versions("SciML"; only_repos = ["OrdinaryDiffEq.jl", "DiffEqBase.jl"])

Compat Bumping

using OrgMaintenanceScripts

# Check available compat updates for a repository
updates = get_available_compat_updates("/path/to/MyPackage.jl")
for (pkg, info) in updates
    println("$pkg: $(info.current) → $(info.latest)")
end

# Bump compat bounds and test
success = bump_compat_and_test("/path/to/MyPackage.jl";
    create_pr = true,
    fork_user = "myusername"
)

# Process an entire organization
results = bump_compat_org_repositories("SciML";
    fork_user = "myusername",
    limit = 10
)

Version Check Finding

using OrgMaintenanceScripts

# Find old version checks in a repository
checks = find_version_checks_in_repo("/path/to/MyPackage.jl")

# Find old version checks across an organization
results = find_version_checks_in_org("SciML"; min_version = v"1.10")
print_version_check_summary(results)

# Use custom minimum version
results = find_version_checks_in_org("MyOrg"; min_version = v"1.9", max_repos = 10)

Explicit Imports Fixing

using OrgMaintenanceScripts

# Fix explicit imports in a package
success, iterations, report = fix_explicit_imports("/path/to/MyPackage.jl")

# Fix and create PR for a repository
fix_repo_explicit_imports("MyOrg/MyPackage.jl"; create_pr = true)

# Fix all packages in an organization
results = fix_org_explicit_imports("MyOrg"; create_prs = true)

Multiprocess Testing

using OrgMaintenanceScripts

# Run tests in parallel for a local package
summary = run_multiprocess_tests(".github/workflows/CI.yml", ".", log_dir="test_logs")
print_test_summary(summary)

# Test a remote repository
summary = run_tests_from_repo("https://github.com/SciML/OrdinaryDiffEq.jl")

# Generate detailed report
generate_test_summary_report(summary, "test_report.txt")

# Check which groups failed
failed_groups = [r.group.name for r in summary.results if !r.success]

Documentation Cleanup

using OrgMaintenanceScripts

# Analyze documentation bloat
analysis = analyze_gh_pages_bloat("/path/to/repo")
println("Repository has $(analysis.total_size_mb) MB of bloat")

# Test cleanup safely with dry run
result = cleanup_gh_pages_docs("/path/to/repo", dry_run=true)
println("Would save: $(result.size_saved_mb) MB")

# Perform actual cleanup
result = cleanup_gh_pages_docs("/path/to/repo")
if result.success
    println("Cleaned $(result.files_removed) files")
    println("⚠️  Run: git push --force origin gh-pages")
end

# Clean multiple repositories
repos = ["https://github.com/SciML/Repo1.jl.git", "https://github.com/SciML/Repo2.jl.git"]
results = cleanup_org_gh_pages_docs(repos, dry_run=true)
total_savings = sum(r.size_saved_mb for r in results if r.success)

Contents

API Reference

OrgMaintenanceScripts.analyze_gh_pages_bloatMethod
analyze_gh_pages_bloat(repo_path::String)

Analyze documentation bloat in a repository's gh-pages branch without making changes. Returns detailed information about large files and versions for planning cleanup operations.

Arguments

  • repo_path::String: Path to the Git repository

Returns

  • NamedTuple with analysis results:
    • total_size_mb::Float64: Total size of large files in MB
    • large_files::Vector: List of large files with size and path information
    • versions::Vector{String}: List of version directories found
    • latest_version::Union{String,Nothing}: Latest version detected
    • analysis::String: Human-readable analysis report

Examples

analysis = analyze_gh_pages_bloat("/path/to/repo")
println("Repository has $(analysis.total_size_mb) MB of documentation bloat")
println("Latest version: $(analysis.latest_version)")
println("\n$(analysis.analysis)")
source
OrgMaintenanceScripts.analyze_invalidations_in_processFunction
analyze_invalidations_in_process(repo_path::String, test_script::String="")

Run invalidation analysis in a separate Julia process to avoid contaminating the current session. Returns invalidation data that can be analyzed to find major invalidators.

source
OrgMaintenanceScripts.analyze_major_invalidatorsMethod
analyze_major_invalidators(invalidation_data::AbstractDict)

Analyze invalidation data to identify the major invalidators. Returns a list of the most problematic invalidations.

The invalidation_data argument should be a Dict-like object (typically from JSON3.read) with an "invalidation_details" key containing a vector of invalidation entries.

source
OrgMaintenanceScripts.analyze_org_import_timingMethod
analyze_org_import_timing(org::String; auth_token::String="", work_dir::String=mktempdir(), 
                         output_dir::String="", max_repos::Int=0)

Analyze import timing across all repositories in a GitHub organization.

source
OrgMaintenanceScripts.analyze_org_invalidationsMethod
analyze_org_invalidations(org::String; auth_token::String="", work_dir::String=mktempdir(), 
                         test_script::String="", output_dir::String="", max_repos::Int=0)

Analyze invalidations across all repositories in a GitHub organization.

source
OrgMaintenanceScripts.bump_and_register_orgMethod
bump_and_register_org(org::String; 
                     registry="General",
                     push::Bool=false,
                     auth_token::String="",
                     work_dir::String=mktempdir())

Process all repositories in a GitHub organization: bump versions and register packages.

This function automates the version bumping and registration process across an entire GitHub organization. It clones each repository, processes Julia packages found within, and handles both single-package repos and monorepos.

Arguments

  • org::String: GitHub organization name (e.g., "JuliaLang", "SciML")
  • registry: Name or path to the registry (default: "General")
  • push::Bool: Whether to push registrations to the remote registry (default: false)
  • auth_token::String: GitHub authentication token for API access (optional but recommended for rate limits)
  • work_dir::String: Directory for cloning repositories (default: temporary directory)

Returns

A Dict{String, Any} mapping repository names to their results:

  • Each entry contains registered and failed arrays
  • May include an error field if repository processing failed

Behavior

  1. Fetches all repositories from the GitHub organization using the API
  2. Clones each repository (shallow clone for efficiency)
  3. Skips non-Julia repositories (no Project.toml)
  4. For each Julia repository:
    • Bumps minor versions of all packages
    • Registers packages in dependency order
    • Commits and pushes changes to the repository
  5. Cleans up cloned repositories after processing

Examples

# Process all repos in an organization
results = bump_and_register_org("MyOrg")
for (repo, result) in results
    println(repo, ": registered ", length(result.registered), " packages")
end

# With authentication and custom registry
results = bump_and_register_org("MyOrg"; 
    auth_token=ENV["GITHUB_TOKEN"],
    registry="MyRegistry",
    push=true
)

Notes

  • Requires appropriate permissions to push to repositories
  • GitHub API rate limits apply (higher with authentication token)
  • Repositories are processed sequentially to avoid overwhelming the registry
  • Temporary clones are automatically cleaned up even if errors occur

See Also

source
OrgMaintenanceScripts.bump_and_register_repoMethod
bump_and_register_repo(repo_path::String; registry="General", push::Bool=false)

Bump minor versions and register all packages in a repository (monorepo).

This function handles both single-package repositories and monorepos with multiple packages. It automatically bumps the minor version of all packages found (main package and lib/* subpackages), then registers them in dependency order using a brute-force approach.

Arguments

  • repo_path::String: Path to the repository root directory
  • registry: Name or path to the registry (default: "General")
  • push::Bool: Whether to push the registration to the remote registry (default: false)

Returns

A NamedTuple with:

  • registered::Vector{String}: Names of successfully registered packages
  • failed::Vector{String}: Names of packages that failed to register

Behavior

  1. Bumps minor versions of all Project.toml files found
  2. Collects all package directories (main + lib/*)
  3. Attempts to register packages iteratively until all succeed or no progress
  4. Automatically commits version bumps if any packages were processed
  5. Handles dependency ordering by retrying failed registrations

Examples

# Bump and register all packages in a repository
result = bump_and_register_repo("/path/to/repo")
println("Registered: ", result.registered)
println("Failed: ", result.failed)

# Use custom registry with push
bump_and_register_repo("/path/to/repo"; registry="MyRegistry", push=true)
source
OrgMaintenanceScripts.bump_compat_and_testMethod
bump_compat_and_test(repo_path::String;
                    package_name::Union{String,Nothing} = nothing,
                    bump_all::Bool = false,
                    create_pr::Bool = true,
                    fork_user::String = "")

Bump compat entries for major version updates and run tests. If tests pass, optionally create a PR.

Arguments

  • repo_path: Path to the repository
  • package_name: Specific package to bump (if nothing, check all)
  • bump_all: Whether to bump all available updates or just one
  • create_pr: Whether to create a PR if tests pass
  • fork_user: GitHub username for creating PRs (required if create_pr=true)

Returns

  • (success::Bool, message::String, pr_url::Union{String,Nothing}, bumped_packages::Vector{String})
source
OrgMaintenanceScripts.bump_compat_and_test_allMethod
bump_compat_and_test_all(repo_path::String;
                        package_name::Union{String,Nothing} = nothing,
                        bump_all::Bool = false,
                        create_pr::Bool = true,
                        fork_user::String = "",
                        include_subpackages::Bool = true)

Bump compat entries for major version updates in all Project.toml files in a repository. This function supports repositories with subpackages in the /lib directory.

Arguments

  • repo_path: Path to the repository
  • package_name: Specific package to bump across all Project.toml files
  • bump_all: Whether to bump all available updates or just one per Project.toml
  • create_pr: Whether to create a PR if tests pass
  • fork_user: GitHub username for creating PRs (required if create_pr=true)
  • include_subpackages: Whether to include subpackages in /lib directory

Returns

  • (success::Bool, message::String, pr_url::Union{String,Nothing}, bumped_info::Dict)
source
OrgMaintenanceScripts.bump_compat_org_repositoriesFunction
bump_compat_org_repositories(org::String = "SciML";
                            package_name::Union{String,Nothing} = nothing,
                            bump_all::Bool = false,
                            create_pr::Bool = true,
                            fork_user::String = "",
                            limit::Int = 100,
                            log_file::String = "",
                            include_subpackages::Bool = true)

Bump compat entries for all repositories in a GitHub organization. This function now supports repositories with subpackages in /lib directories.

Arguments

  • org: GitHub organization name (default: "SciML")
  • package_name: Specific package to bump across all repos (if nothing, check all)
  • bump_all: Whether to bump all available updates or just one per repo
  • create_pr: Whether to create PRs if tests pass
  • fork_user: GitHub username for creating PRs (required if create_pr=true)
  • limit: Maximum number of repositories to process
  • log_file: Path to save results log (default: auto-generated)
  • include_subpackages: Whether to include subpackages in /lib directories

Returns

  • (successes::Vector{String}, failures::Vector{String}, pr_urls::Vector{String})
source
OrgMaintenanceScripts.bump_minor_versionMethod
bump_minor_version(version_str::String) -> String

Bump the minor version of a semantic version string and reset patch to 0.

Arguments

  • version_str::String: A semantic version string in "MAJOR.MINOR.PATCH" format

Returns

  • String: The version string with minor incremented and patch reset to 0

Examples

bump_minor_version("1.2.3")  # Returns "1.3.0"
bump_minor_version("0.1.0")  # Returns "0.2.0"
bump_minor_version("2.10.5") # Returns "2.11.0"

Errors

  • Throws ErrorException if version format is invalid (not three parts)
source
OrgMaintenanceScripts.cleanup_gh_pages_docsMethod
cleanup_gh_pages_docs(repo_path::String; 
                      preserve_latest::Bool=true, 
                      dry_run::Bool=false, 
                      size_threshold_mb::Float64=5.0)

Clean up bloated documentation in a repository's gh-pages branch by removing large files from old documentation versions while preserving the latest release.

This function addresses the common issue of repository bloat caused by large HTML files with embedded SVG plots from documentation builds, particularly in tutorial-heavy packages.

Arguments

  • repo_path::String: Path to the Git repository
  • preserve_latest::Bool=true: Whether to preserve the latest version documentation
  • dry_run::Bool=false: If true, only show what would be cleaned without making changes
  • size_threshold_mb::Float64=5.0: Remove files larger than this threshold (in MB)

Returns

  • NamedTuple with cleanup statistics:
    • files_removed::Int: Number of files removed
    • dirs_removed::Int: Number of directories removed
    • size_saved_mb::Float64: Estimated size saved in MB
    • versions_cleaned::Vector{String}: List of version directories cleaned
    • preserved_version::Union{String,Nothing}: Version that was preserved
    • success::Bool: Whether the operation succeeded
    • error_message::Union{String,Nothing}: Error message if operation failed
    • dry_run::Bool: Whether this was a dry run (only present in dry run mode)

Examples

# Analyze what would be cleaned (safe, no changes)
result = cleanup_gh_pages_docs("/path/to/repo", dry_run=true)
println("Would save: $(result.size_saved_mb) MB")

# Clean up preserving latest version
result = cleanup_gh_pages_docs("/path/to/repo", preserve_latest=true)
if result.success
    println("Cleaned $(result.files_removed) files, saved $(result.size_saved_mb) MB")
    println("⚠️  Run: git push --force origin gh-pages")
end

# Aggressive cleanup removing all old docs
result = cleanup_gh_pages_docs("/path/to/repo", preserve_latest=false)

Safety Features

  • Operates only on gh-pages branch (preserves all code branches/tags)
  • Creates backup references before major operations
  • Supports dry-run mode for safe testing
  • Automatic detection of latest version to preserve
  • Comprehensive error handling and validation input validation

Common Use Cases

  • Repository growing too large due to documentation bloat
  • CI builds creating many preview/dev documentation versions
  • Large SVG/HTML files from plot-heavy tutorials (30+ MB files)
  • Slow clone times affecting developer productivity

Warnings

⚠️ Important: This modifies Git history on the gh-pages branch

  • All contributors should be notified before running
  • Force push required after cleanup: git push --force origin gh-pages
  • Backup your repository before running on important data

Technical Details

The function identifies and removes:

  • Old version directories (v1.0.0, v1.1.0, etc.) except the latest
  • Development documentation (dev/, previews/, preview-*/)
  • Large files exceeding the size threshold
  • Performs Git garbage collection to reclaim space

The latest version is automatically detected by parsing semantic version numbers from directory names matching the pattern v\d+\.\d+\.\d+.

source
OrgMaintenanceScripts.cleanup_org_gh_pages_docsMethod
cleanup_org_gh_pages_docs(org_repos::Vector{String}; 
                          preserve_latest::Bool=true,
                          dry_run::Bool=false, 
                          size_threshold_mb::Float64=5.0,
                          working_dir::String=mktempdir())

Clean up documentation bloat across multiple repositories in an organization.

Arguments

  • org_repos::Vector{String}: List of repository URLs to process
  • preserve_latest::Bool=true: Whether to preserve latest version in each repo
  • dry_run::Bool=false: If true, only analyze without making changes
  • size_threshold_mb::Float64=5.0: Size threshold for file removal
  • working_dir::String: Directory to clone repositories into

Returns

  • Vector of cleanup results for each repository

Examples

repos = [
    "https://github.com/SciML/DifferentialEquations.jl.git",
    "https://github.com/SciML/JumpProcesses.jl.git"
]

results = cleanup_org_gh_pages_docs(repos, dry_run=true)
total_savings = sum(r.size_saved_mb for r in results if r.success)
println("Organization could save $(total_savings) MB")
source
OrgMaintenanceScripts.downgrade_to_minimum_versionsMethod
downgrade_to_minimum_versions(project_dir::String; julia_version="1.10", mode="alldeps", work_dir=mktempdir())

Downgrade all dependencies to their minimum compatible versions using Resolver.jl. This uses the same approach as julia-actions/julia-downgrade-compat. Returns (success::Bool, output::String)

source
OrgMaintenanceScripts.find_version_checks_in_orgMethod
find_version_checks_in_org(org::String; 
                          min_version::VersionNumber=JULIA_LTS,
                          auth_token::String="",
                          work_dir::String=mktempdir(),
                          ignore_dirs=["test", "docs", ".git"])

Find all version checks in all repositories of a GitHub organization.

source
OrgMaintenanceScripts.find_version_checks_in_repoMethod
find_version_checks_in_repo(repo_path::String; min_version::VersionNumber=JULIA_LTS, ignore_dirs=["test", "docs", ".git"])

Find all version checks in a repository that compare against versions older than min_version.

source
OrgMaintenanceScripts.fix_explicit_importsMethod
fix_explicit_imports(package_path::String; max_iterations=10, verbose=true)

Iteratively fix explicit import issues in a package until all checks pass. Returns (success::Bool, iterations::Int, final_report::String)

source
OrgMaintenanceScripts.fix_org_explicit_importsMethod
fix_org_explicit_imports(org_name::String;
                        work_dir=mktempdir(),
                        max_iterations=10,
                        create_prs=true,
                        skip_repos=String[],
                        only_repos=nothing,
                        verbose=true)

Fix explicit imports for all Julia packages in a GitHub organization.

source
OrgMaintenanceScripts.fix_org_min_versionsMethod
fix_org_min_versions(org_name::String;
                    work_dir=mktempdir(),
                    max_iterations=10,
                    create_prs=true,
                    skip_repos=String[],
                    only_repos=nothing,
                    julia_version="1.10",
                    include_subpackages=true)

Fix minimum versions for all Julia packages in a GitHub organization. Now supports repositories with subpackages in /lib directories.

source
OrgMaintenanceScripts.fix_org_version_checks_parallelFunction
fix_org_version_checks_parallel(org::String, n_processes::Int=4;
                               min_version::VersionNumber=JULIA_LTS,
                               github_token::String="",
                               base_branch::String="main",
                               work_dir::String=mktempdir())

Find and fix version checks across an entire GitHub organization using parallel processing.

source
OrgMaintenanceScripts.fix_package_min_versionsMethod
fix_package_min_versions(repo_path::String; 
                        max_iterations=10, 
                        work_dir=mktempdir(),
                        julia_version="1.10")

Fix minimum versions for a package repository that's already cloned. Returns (success::Bool, updates::Dict{String,String})

source
OrgMaintenanceScripts.fix_package_min_versions_allMethod
fix_package_min_versions_all(repo_path::String;
                            max_iterations=10,
                            work_dir=mktempdir(),
                            julia_version="1.10",
                            include_subpackages=true)

Fix minimum versions for all Project.toml files in a repository. Supports repositories with subpackages in the /lib directory. Returns (success::Bool, all_updates::Dict{String,Dict{String,String}})

source
OrgMaintenanceScripts.fix_repo_min_versionsMethod
fix_repo_min_versions(repo_name::String;
                     work_dir=mktempdir(),
                     max_iterations=10,
                     create_pr=true,
                     julia_version="1.10",
                     include_subpackages=true)

Clone a repository, fix its minimum versions, and optionally create a PR. Now supports repositories with subpackages in /lib directories.

source
OrgMaintenanceScripts.fix_version_checks_parallelFunction
fix_version_checks_parallel(checks::Vector{VersionCheck}, n_processes::Int=4; 
                           github_token::String="", 
                           base_branch::String="main",
                           pr_title_prefix::String="[Auto] Remove obsolete version checks")

Fix version checks in parallel using N processes. Each process will create a PR to fix the version checks by removing obsolete comparisons.

source
OrgMaintenanceScripts.format_org_repositoriesFunction
format_org_repositories(org::String = "SciML";
                       test::Bool = true,
                       push_to_master::Bool = false,
                       create_pr::Bool = true,
                       fork_user::String = "",
                       limit::Int = 100,
                       only_failing_ci::Bool = true,
                       log_file::String = "")

Format all repositories in a GitHub organization.

Arguments

  • org: GitHub organization name (default: "SciML")
  • test: Whether to run tests after formatting (default: true)
  • push_to_master: Whether to push directly to master/main if tests pass (default: false)
  • create_pr: Whether to create PRs instead of pushing to master (default: true)
  • fork_user: GitHub username for creating PRs (required if create_pr=true)
  • limit: Maximum number of repositories to process (default: 100)
  • only_failing_ci: Only process repos with failing formatter CI (default: true)
  • log_file: Path to save results log (default: auto-generated)

Returns

  • (successes::Vector{String}, failures::Vector{String}, pr_urls::Vector{String})
source
OrgMaintenanceScripts.format_repositoryMethod
format_repository(repo_url::String; 
                 test::Bool = true,
                 push_to_master::Bool = false,
                 create_pr::Bool = true,
                 fork_user::String = "",
                 working_dir::String = mktempdir())

Format a single repository with JuliaFormatter.

Arguments

  • repo_url: URL of the repository to format (e.g., "https://github.com/SciML/Example.jl.git")
  • test: Whether to run tests after formatting (default: true)
  • push_to_master: Whether to push directly to master/main if tests pass (default: false)
  • create_pr: Whether to create a PR instead of pushing to master (default: true)
  • fork_user: GitHub username for creating PRs (required if create_pr=true)
  • working_dir: Directory to clone the repository into (default: temporary directory)

Returns

  • (success::Bool, message::String, pr_url::Union{String,Nothing})
source
OrgMaintenanceScripts.get_org_reposMethod
get_org_repos(org::String; auth_token::String="")

Fetch all repositories for a GitHub organization using the GitHub API.

Arguments

  • org::String: The GitHub organization name (e.g., "JuliaLang", "SciML")
  • auth_token::String: Optional GitHub personal access token for authentication (increases rate limits from 60 to 5000 requests per hour)

Returns

  • Vector{String}: Full repository names in "org/repo" format

Behavior

  1. Uses GitHub API v3 to fetch repository list
  2. Handles pagination automatically (100 repos per page)
  3. Returns all public repositories (private repos require auth token with appropriate permissions)
  4. Continues fetching until all pages are retrieved
  5. Handles API errors gracefully and returns partial results if pagination fails

Examples

# Get all public repos for an organization
repos = get_org_repos("JuliaLang")
println("Found ", length(repos), " repositories")

# With authentication for higher rate limits and private repos
repos = get_org_repos("MyOrg"; auth_token=ENV["GITHUB_TOKEN"])

Notes

  • Rate limits: 60 requests/hour unauthenticated, 5000/hour with token
  • Only returns repositories the token has access to
  • For large organizations, fetching may take several API calls due to pagination
source
OrgMaintenanceScripts.register_monorepo_packagesMethod
register_monorepo_packages(repo_path::String; registry="General", push::Bool=false)

Register all packages in a monorepo without bumping versions.

This function is similar to bump_and_register_repo but only performs registration without modifying package versions. Useful when versions have already been bumped or when you want to register packages at their current versions.

Arguments

  • repo_path::String: Path to the repository root directory
  • registry: Name or path to the registry (default: "General")
  • push::Bool: Whether to push the registration to the remote registry (default: false)

Returns

A NamedTuple with:

  • registered::Vector{String}: Names of successfully registered packages
  • failed::Vector{String}: Names of packages that failed to register

Behavior

  1. Scans for all packages (main Project.toml and lib/*/Project.toml)
  2. Uses brute-force dependency resolution by repeatedly attempting registration
  3. Continues until all packages are registered or no more progress is possible
  4. Handles circular dependencies and complex dependency graphs
  5. Does NOT modify any Project.toml files or create commits

Examples

# Register all packages in a monorepo at current versions
result = register_monorepo_packages("/path/to/repo")
println("Successfully registered: ", length(result.registered), " packages")

# Register with custom registry
register_monorepo_packages("/path/to/repo"; registry="MyRegistry", push=true)

See Also

source
OrgMaintenanceScripts.register_packageMethod
register_package(package_dir::String; registry="General", push::Bool=false)

Register a Julia package to the specified registry using LocalRegistry.

Arguments

  • package_dir::String: Path to the directory containing the package to register
  • registry: Name or path to the registry (default: "General")
  • push::Bool: Whether to push the registration to the remote registry (default: false)

Returns

  • Bool: true if registration succeeded, false otherwise

Examples

# Register a package to the General registry
register_package("/path/to/MyPackage")

# Register to a custom registry with push
register_package("/path/to/MyPackage"; registry="MyRegistry", push=true)
source
OrgMaintenanceScripts.run_explicit_imports_check_allMethod
run_explicit_imports_check_all(repo_path::String; verbose=true, include_subpackages=true)

Run ExplicitImports.jl checks on all packages in a repository. Supports repositories with subpackages in /lib directories. Returns a Dict mapping relative paths to (success, report, issues) tuples.

source
OrgMaintenanceScripts.test_min_versionsMethod
test_min_versions(project_dir::String; julia_version="1.10", mode="alldeps", work_dir=mktempdir())

Test if minimum versions can be resolved using Resolver.jl. Returns (success::Bool, error_output::String)

source
OrgMaintenanceScripts.update_project_versionMethod
update_project_version(project_path::String) -> Union{Tuple{String,String}, Nothing}

Update the version in a Project.toml file by bumping the minor version.

Arguments

  • project_path::String: Path to the Project.toml file to update

Returns

  • Tuple{String, String}: (oldversion, newversion) if successful
  • nothing: If file doesn't exist or has no version field

Behavior

  1. Reads the Project.toml file
  2. Extracts the current version
  3. Bumps the minor version (e.g., "1.2.3" → "1.3.0")
  4. Writes the updated Project.toml back to disk
  5. Logs the version change

Examples

result = update_project_version("path/to/Project.toml")
if !isnothing(result)
    old_ver, new_ver = result
    println("Updated from v", old_ver, " to v", new_ver)
end

Notes

  • Preserves all other fields in Project.toml
  • Issues a warning if file not found or no version field exists
  • Atomic write operation (full file rewrite)
source
OrgMaintenanceScripts.update_project_versions_allMethod
update_project_versions_all(repo_path::String; include_subpackages::Bool=true)

Update the version in all Project.toml files in a repository by bumping the minor version. Supports repositories with subpackages in /lib directories. Returns a Dict mapping relative paths to (oldversion, newversion) tuples.

source