Skip to content

Commit

Permalink
ENH If a wildcard is used it must be the only entry
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed May 20, 2024
1 parent e8f909b commit 05e0537
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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.');
}
}
}

0 comments on commit 05e0537

Please sign in to comment.