Internals

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
RegistryCI.AutoMerge.get_all_non_jll_package_namesMethod
get_all_non_jll_package_names(registry_dir::AbstractString) -> Vector{String}
get_all_non_jll_package_names(registry::RegistryInstance) -> Vector{String}

Given either:

  • a path to a directory holding an uncompressed registry

or

returns a sorted list of the names of Julia's standard libraries and all the non-JLL packages defined in that registry.

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

Attempts to clone a git repo from url into a temporary directory, runs f(dir) on that directory, then extract the files and folders from a given tree_hash, placing them in destination.

Returns a boolean indicating if the cloning succeeded.

source
RegistryCI.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
RegistryCI.AutoMerge.runMethod
run([env, cicfg::CIService]; kwargs...)

Run the RegistryCI.AutoMerge service.

Arguments

  • env: an AbstractDictionary used to read environmental variables from. Defaults to ENV but a plain Dict can be passed to mimic an alternate environment.
  • ciccfg: Configuration struct describing the continuous integration (CI) environment in which AutoMerge is being run.

Keyword Arguments

  • merge_new_packages: should AutoMerge merge registration PRs for new packages
  • merge_new_versions: should AutoMerge merge registration PRs for new versions of packages
  • new_package_waiting_period: new package waiting period, e.g Day(3).
  • new_jll_package_waiting_period: new JLL package waiting period, e.g Minute(20).
  • new_version_waiting_period: new package version waiting period, e.g Minute(10).
  • new_jll_version_waiting_period: new JLL package version waiting period, e.g Minute(10).
  • registry: the registry name you want to run AutoMerge on.
  • tagbot_enabled: if tagbot is enabled.
  • authorized_authors: list of who can submit registration, e.g String["JuliaRegistrator"].
  • authorized_authors_special_jll_exceptions: a list of users who can submit JLL packages (which have strict rules about allowed dependencies and are subject to new_jll_*_waiting_periods instead of new_*_waiting_periods).
  • additional_statuses: list of additional commit statuses that must pass before AutoMerge will merge a PR
  • additional_check_runs: list of additional check runs that must pass before AutoMerge will merge a PR
  • error_exit_if_automerge_not_applicable: if false, AutoMerge will not error on PRs made by non-AutoMerge-authorized users
  • master_branch: name of master_branch, e.g you may want to specify this to "main" for new GitHub repositories.
  • master_branch_is_default_branch: if master_branch specified above is the default branch.
  • suggest_onepointzero: should the AutoMerge comment include a suggestion to tag a 1.0 release for v0.x.y packages.
  • point_to_slack: should the AutoMerge comment recommend sending a message to the #pkg-registration Julia-Slack channel when auto-merging is not possible.
  • registry_deps: list of registry dependencies, e.g your packages may depend on General.
  • api_url: the registry host API URL, default is "https://api.github.com".
  • check_license: check package has a valid license, default is false.
  • public_registries: If a new package registration has a UUID that matches that of a package already registered in one of these registries supplied here (and has either a different name or different URL) then an error will be thrown. This to prevent AutoMerge from being used for "dependency confusion" attacks on those registries.
  • read_only: run in read only mode, default is false.

Example

Here is an example of how General registry is configured

using RegistryCI
using Dates

RegistryCI.AutoMerge.run(
    merge_new_packages = ENV["MERGE_NEW_PACKAGES"] == "true",
    merge_new_versions = ENV["MERGE_NEW_VERSIONS"] == "true",
    new_package_waiting_period = Day(3),
    new_jll_package_waiting_period = Minute(20),
    new_version_waiting_period = Minute(10),
    new_jll_version_waiting_period = Minute(10),
    registry = "JuliaLang/General",
    tagbot_enabled = true,
    authorized_authors = String["JuliaRegistrator"],
    authorized_authors_special_jll_exceptions = String["jlbuild"],
    suggest_onepointzero = false,
    point_to_slack = false,
    additional_statuses = String[],
    additional_check_runs = String[],
    check_license = true,
    public_registries = String["https://github.com/HolyLab/HolyLabRegistry"],
)
source
RegistryCI.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