Compat Bumping
OrgMaintenanceScripts.jl provides functionality to automatically check for major version updates of dependencies, test them locally, and create pull requests if tests pass.
Overview
The compat bumping functionality helps maintain Julia packages by:
- Detecting when dependencies have new major versions available
- Automatically updating compat entries to allow the new versions
- Running tests locally to ensure compatibility
- Creating pull requests if tests pass
Functions
get_available_compat_updates
Check for available major version updates in a package's dependencies.
updates = get_available_compat_updates("Project.toml")
Returns a vector of CompatUpdate
structs, each containing:
package_name
: Name of the dependencycurrent_compat
: Current compat specificationlatest_version
: Latest available versionis_major_update
: Whether this is a major version bump
bump_compat_and_test
Bump compat entries for major version updates and run tests locally.
success, message, pr_url, bumped_packages = bump_compat_and_test("path/to/repo";
package_name = "SpecificPackage", # Optional: bump only this package
bump_all = false, # Bump all available updates
create_pr = true, # Create PR if tests pass
fork_user = "yourusername" # Required for PR creation
)
Arguments:
repo_path
: Path to the repositorypackage_name
: Specific package to bump (optional)bump_all
: Whether to bump all available updates or just onecreate_pr
: Whether to create a PR if tests passfork_user
: GitHub username for creating PRs
Returns:
success
: Whether the operation succeededmessage
: Status messagepr_url
: URL of created PR (if any)bumped_packages
: List of packages that were bumped
bump_compat_org_repositories
Process all repositories in a GitHub organization.
successes, failures, pr_urls = bump_compat_org_repositories("SciML";
package_name = nothing, # Bump all packages
bump_all = false, # One update per repo
create_pr = true,
fork_user = "yourusername",
limit = 100,
log_file = "compat_bump.log"
)
Examples
Check for Updates
using OrgMaintenanceScripts
# Check what updates are available
updates = get_available_compat_updates("Project.toml")
for update in updates
println("$(update.package_name): $(update.current_compat) → $(update.latest_version)")
end
Bump Single Package
# Bump compat for DataFrames only
success, msg, pr_url, bumped = bump_compat_and_test(".";
package_name = "DataFrames",
create_pr = true,
fork_user = "myusername"
)
Bump All Updates
# Bump all available major version updates
success, msg, pr_url, bumped = bump_compat_and_test(".";
bump_all = true,
create_pr = true,
fork_user = "myusername"
)
Process Organization
# Process all SciML repositories
successes, failures, pr_urls = bump_compat_org_repositories("SciML";
bump_all = false, # One update per repo
create_pr = true,
fork_user = "myusername",
limit = 50
)
println("Successfully updated: $(length(successes)) repos")
println("Failed: $(length(failures)) repos")
println("Created $(length(pr_urls)) pull requests")
Workflow
- Detection: The tool scans
Project.toml
to find dependencies with new major versions - Update: Compat entries are updated to allow the new major version
- Test: The package's tests are run locally with the updated dependencies
- PR Creation: If tests pass, a pull request is automatically created
Requirements
- Julia 1.6 or later
- GitHub CLI (
gh
) installed and authenticated for PR creation - Write access to a fork of the repositories you want to update
Notes
- The tool only creates PRs for updates where tests pass
- Tests have a default timeout of 30 minutes (configurable)
- Rate limiting is applied when processing multiple repositories
- Logs are saved for organization-wide operations