Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH If a wildcard is used it must be the only entry #33

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Each of the above sections holds an array of JSON objects with the following dat
|`isCore`|_Boolean_|Is this considered a direct dependency of `silverstripe/installer`, `silverstripe/recipe-cms` or `silverstripe/recipe-core`? (Only relevant for supported modules)|
|`lockstepped`|_Boolean_|Whether this is _always_ given a new minor release in "lock step" with Silverstripe CMS as a whole. (Only relevant for supported modules)|
|`type`|_String_|One of "module", "recipe", "theme", or "other". (Only relevant for supported modules)|
|`majorVersionMapping`|_Object_|A map of major versions, with the Silverstripe CMS major release lines as object keys and an array of all matching major release lines for the repository as values.<br>• The repository versions are branch names, but in most cases these will map to a major release line (e.g. "5" branch which represents the "5.x" release line)<br>• If a `"*"` key is present, it should be used for any CMS major release lines which do not have their own keys.<br>• If a CMS major release line is missing, and there is no `"*"` key, the repository should be ignored for that CMS major release line.<br>• If the value is an empty array, the default branch should be used.|
|`majorVersionMapping`|_Object_|A map of major versions, with the Silverstripe CMS major release lines as object keys and an array of all matching major release lines for the repository as values.<br>• The repository versions are branch names, but in most cases these will map to a major release line (e.g. "5" branch which represents the "5.x" release line)<br>• If a `"*"` key is present it will be used for all CMS major release lines, and no other keys can be used<br>• If a CMS major release line is missing, and the `"*"` key is not used, the repository should be ignored for that CMS major release line.<br>• If the value is an empty array, the default branch should be used.|

## Adding a repo

Expand Down
3 changes: 3 additions & 0 deletions tests/MetaDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,8 @@ private function validateVersionMap(array $versionMap): void
$this->assertNotEmpty($branches);
}
}
if (array_key_exists('*', $versionMap)) {
$this->assertCount(1, array_keys($versionMap), 'If a wildcard is defined, it must be the only key.');
}
}
}
Loading