Internals

RegistryCI

RegistryCI.testFunction
test(path)

Run various checks on the registry located at path. Checks for example that all files are parsable and understandable by Pkg and consistency between Registry.toml and each Package.toml.

If your registry has packages that have dependencies that are registered in other registries elsewhere, then you may provide the github urls for those registries using the registry_deps parameter.

source

AutoMerge

AutoMerge.extract_github_owner_repoMethod
extract_github_owner_repo(repo_url::AbstractString)

Extracts the owner and repository name from a GitHub URL. Returns a tuple (owner, repo) or nothing if the URL is not a valid GitHub URL.

source
AutoMerge.find_previous_semver_versionMethod
find_previous_semver_version(pkg::AbstractString, current_version::VersionNumber, registry_path::AbstractString) -> Union{VersionNumber, Nothing}

Finds the previous semver version for a package. Returns the maximum version that is less than the current version, or nothing if there are no previous versions.

source
AutoMerge.format_github_diff_urlMethod
format_github_diff_url(repo_url::AbstractString, previous_commit_sha::AbstractString, current_commit_sha::AbstractString) -> Union{AbstractString, Nothing}

Generates a GitHub diff URL comparing two commits. Returns the URL AbstractString, or nothing if the repository is not on GitHub.

source
AutoMerge.get_all_pkg_name_uuidsMethod
get_all_pkg_name_uuids(registry_dir::AbstractString)
get_all_pkg_name_uuids(registry::RegistryInstance)

Given either a path to an uncompressed registry directory or a RegistryInstance object (from RegistryInstances.jl), returns a sorted vector of NamedTuples with name and uuid fields for all packages in the registry and Julia's standard libraries.

source
AutoMerge.get_version_diff_infoMethod
get_version_diff_info(data) -> Union{NamedTuple, Nothing}

Gets diff information for a new version registration. Returns a NamedTuple with fields:

  • diff_stats: string summarizing the git diff between package versions
  • diff_url: GitHub diff URL, if available. Otherwise nothing.
  • previous_version: Previous version number
  • current_version: Current version number

Returns nothing if no previous version exists or package is not a NewVersion.

source
AutoMerge.load_files_from_url_and_tree_hashMethod
load_files_from_url_and_tree_hash(f, destination::String, url::String, tree_hash::String, pkg_clone_dir::String) -> Bool

Attempts to clone a git repo from url into pkg_clone_dir (or reuse existing clone if it exists), runs f(dir) on that directory, then extract the files and folders from a given tree_hash, placing them in destination.

The repository is cloned into pkg_clone_dir.

Returns a boolean indicating if the cloning succeeded.

source
AutoMerge.maybe_create_blocked_labelMethod
maybe_create_blocked_label(api, repo)

Add the label AutoMerge: last run blocked by comment to the repo if it doesn't already exist.

Returns whether or not it created the label.

source
AutoMerge.parse_registry_pkg_infoFunction
parse_registry_pkg_info(registry_path, pkg, version=nothing) -> @NamedTuple{uuid::String, repo::String, subdir::String, tree_hash::Union{Nothing, String}}

Searches the registry located at registry_path for a package with name pkg. Upon finding it, it parses the associated Package.toml file and returns the UUID and repository URI, and subdir.

If version is supplied, then the associated tree_hash will be returned. Otherwise, tree_hash will be nothing.

source
AutoMerge.tree_sha_to_commit_shaMethod
tree_sha_to_commit_sha(tree_sha::AbstractString, clone_dir::AbstractString; subdir::AbstractString="") -> Union{AbstractString, Nothing}

Converts a git tree SHA to a commit SHA by finding a commit that has that tree. Returns the commit SHA string, or nothing if no commit is found.

source
AutoMerge.try_remove_labelMethod
try_remove_label(api, repo, issue, label)

Uses GitHub.remove_label to remove the label, if it exists. Differs from the upstream functionality by not erroring if we receive a 404 response indicating the label did not exist.

Returns whether or not the label was removed.

source
AutoMerge.uuid_passes_sanity_checkMethod
uuid_passes_sanity_check(uuid::UUID) -> Bool

Checks if a UUID conforms to RFC 4122 / RFC 9562 standards or is a historically buggy Julia version 1 UUID.

Standards-compliant UUIDs must have:

  • Version field (bits 48-51): 1-8
  • Variant field (bits 64-65): 10 binary (making the hex character at position 19 one of 8, 9, a, or b)

Julia's uuid1() implementation historically had a bug where it set the variant bits to 00 instead of 10. We allow these for backward compatibility.

Returns true if the UUID passes the sanity check, false otherwise.

source