Group Repositories
A group repository serves several hosted and proxy repositories from one URL. A client configures the group address instead of a list of separate repositories. A group has no artifacts of its own: it reads its members and serves the result under its own name.
Groups exist for npm, PyPI, NuGet, and Maven. Other formats do not have them.
Membership
A group has from 1 to 16 members. A member is an enabled hosted or proxy repository of the same format and the same project. Another group cannot be a member. A repository can be added when the user is allowed to download from it. Permission to read the group itself is checked separately. Including a repository in a group is governed by the repository-level repo.group permission — the Group column in the permission table of a role or a robot account (see Access Levels).
A member has a place in the traversal, order: the numbers are unique and zero or greater, and a smaller one is read first. A proxy may stand before a hosted member.
writable marks the single hosted member that stores a publication made through the group URL. The field is optional. Without it the group is read-only: publication and deletion answer 405. The files then live in the writable member, and that member's own URL writes to the same place. Deletion through the group URL deletes only in that member.
Creating a Group
cache_ttl is how many seconds to keep serving an already merged group index, from 30 to 3600. When the field is omitted, the value is 300. A publication to a hosted member is visible in the group at once. A new upstream version appears after that member's cache period and the group's.
settings.resolution_strategy may be omitted: the default is ordered. Choosing a strategy is available only through the API: the web interface creates groups with the default strategy.
Traversal Order
The strategy decides which member serves the same version. A version that only a later member has stays in the index. File links point at the group.
- ordered — a smaller
orderis read first. - priority — a higher
priorityis read first, and an equal rank is broken byorder. Equal ranks are allowed. The field is required and zero or greater. - local_first — every hosted member by
order, then every proxy byorder.
priority may be sent under any strategy: the value is stored and starts affecting traversal when the strategy becomes priority. Changing the strategy without a new members list does not require ranks: stored zeros leave the order as the tie-break.
Connecting a Client
A client connects to the group URL the same way it connects to an ordinary repository of that format:
For npm that is the group registry, for PyPI its simple index, for NuGet its service index, and for Maven its root. The ready configuration snippets on the repository page are built from this address.
What the Answer Contains
The index is merged from the members in strategy order. The same version comes from the earlier member. For npm, the latest tag is the highest of the members' latest tags, and a tag that names a version outside the merge is dropped. For PyPI, the package description comes from the member with the highest version. For Maven, latest is the highest version and release is the highest non-SNAPSHOT.
A file comes from the first member that has it: the stored copy first, then, for a proxy, the file map and upstream. When a proxy's upstream is unavailable, the group index still lists the versions that member has already stored, and a cached file can be downloaded. A refused upstream login and an OSA block are not answered from that list: a block stops the request, and the next member does not replace it. A failed hosted member is not replaced by a public proxy: an internal package is not served from an external registry.
The tree on the repository page is built from the members' already stored paths. The same path keeps the earlier member. A file that exists only on upstream and has not been downloaded yet does not appear in the tree.
A proxy's exclude_patterns and allow_patterns apply through the group as well, including a copy that is already stored. A name closed on a public proxy does not arrive from it, neither in an index nor as a file.
Limits
A disabled member that stands, in strategy order, before every enabled one makes the group answer 503 until it is enabled or removed from the group. A disabled member after an enabled one is skipped.
A member cannot be deleted while it belongs to a group: deletion answers 409. Deleting a project deletes its groups as well.
Cleanup policies are not assigned to a group: it has no files of its own, and its members are cleaned up. In the repository list a group's artifact_count is 0. The artifact counts are shown on the members.
