Skip to content

Commit

Permalink
Added selectors and strong apiVersion #649 #647 (#675)
Browse files Browse the repository at this point in the history
* Added selectors and strong apiVersion #649 #647

* Update schema and docs
  • Loading branch information
BernieWhite committed Mar 30, 2021
1 parent 59b07de commit 545f0fd
Show file tree
Hide file tree
Showing 63 changed files with 3,794 additions and 551 deletions.
11 changes: 11 additions & 0 deletions .vscode/settings.json
Expand Up @@ -29,6 +29,17 @@
"[markdown]": {
"editor.tabSize": 2
},
"[json]": {
"editor.tabSize": 4,
"editor.tabCompletion": "on",
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace",
"gitlens.codeLens.scopes": [
"document"
]
},
"files.associations": {
"**/.azure-pipelines/*.yaml": "azure-pipelines",
"**/.azure-pipelines/jobs/*.yaml": "azure-pipelines"
Expand Down
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -337,6 +337,23 @@ The following conceptual topics exist in the `PSRule` module:
- [Rule.Exclude](docs/concepts/PSRule/en-US/about_PSRule_Options.md#ruleexclude)
- [Rule.Tag](docs/concepts/PSRule/en-US/about_PSRule_Options.md#ruletag)
- [Suppression](docs/concepts/PSRule/en-US/about_PSRule_Options.md#suppression)
- [Selectors](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md)
- [AllOf](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#allof)
- [AnyOf](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#anyof)
- [Exists](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#exists)
- [Equals](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#equals)
- [Field](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#field)
- [Greater](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#greater)
- [GreaterOrEquals](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#greaterorequals)
- [HasValue](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#hasvalue)
- [In](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#in)
- [Less](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#less)
- [LessOrEquals](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#lessorequals)
- [Match](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#match)
- [Not](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#not)
- [NotEquals](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#notequals)
- [NotIn](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#notin)
- [NotMatch](docs/concepts/PSRule/en-US/about_PSRule_Selectors.md#notmatch)
- [Variables](docs/concepts/PSRule/en-US/about_PSRule_Variables.md)
- [$Assert](docs/concepts/PSRule/en-US/about_PSRule_Variables.md#assert)
- [$Configuration](docs/concepts/PSRule/en-US/about_PSRule_Variables.md#configuration)
Expand Down
11 changes: 11 additions & 0 deletions docs/CHANGELOG-v1.md
Expand Up @@ -4,13 +4,24 @@ See [upgrade notes][upgrade-notes] for helpful information when upgrading from p

[upgrade-notes]: upgrade-notes.md

**Important notes**:

- YAML resources will require an `apiVersion` from PSRule v2. [#648](https://github.com/microsoft/PSRule/issues/648)

## Unreleased

What's changed since pre-release v1.2.0-B2103031:

- Engine features:
- Added support for complex pre-conditions with selectors. [#649](https://github.com/microsoft/PSRule/issues/649)
- General improvements:
- Added support for preferring automatic binding over custom binding configurations. [#670](https://github.com/microsoft/PSRule/issues/670)
- Added the `Binding.PreferTargetInfo` option to prefer target info specified by the object.
- Added strong apiVersion to resource types. [#647](https://github.com/microsoft/PSRule/issues/647)
- Resource schemas now support an `apiVersion` field.
- The `apiVersion` field is optional but recommended.
- Resources without a `apiVersion` field will not be supported from PSRule v2.
- Added warning to flag baseline without `apiVersion` set.

## 1.2.0-B2103031 (pre-release)

Expand Down
8 changes: 8 additions & 0 deletions docs/commands/PSRule/en-US/toc.yml
Expand Up @@ -39,6 +39,10 @@
href: ../../../concepts/PSRule/en-US/about_PSRule_Baseline.md
topicHref: ../../../concepts/PSRule/en-US/about_PSRule_Baseline.md

- name: Conventions
href: ../../../concepts/PSRule/en-US/about_PSRule_Conventions.md
topicHref: ../../../concepts/PSRule/en-US/about_PSRule_Conventions.md

- name: Documentation
href: ../../../concepts/PSRule/en-US/about_PSRule_Docs.md
topicHref: ../../../concepts/PSRule/en-US/about_PSRule_Docs.md
Expand All @@ -51,6 +55,10 @@
href: ../../../concepts/PSRule/en-US/about_PSRule_Options.md
topicHref: ../../../concepts/PSRule/en-US/about_PSRule_Options.md

- name: Selectors
href: ../../../concepts/PSRule/en-US/about_PSRule_Selectors.md
topicHref: ../../../concepts/PSRule/en-US/about_PSRule_Selectors.md

- name: Variables
href: ../../../concepts/PSRule/en-US/about_PSRule_Variables.md
topicHref: ../../../concepts/PSRule/en-US/about_PSRule_Variables.md
2 changes: 1 addition & 1 deletion docs/concepts/PSRule/en-US/about_PSRule_Assert.md
Expand Up @@ -104,7 +104,7 @@ For example:

### Contains

The `Contains` assertion method checks the field value contains with the specified string.
The `Contains` assertion method checks the field value contains the specified string.
Optionally a case-sensitive compare can be used, however case is ignored by default.

The following parameters are accepted:
Expand Down
6 changes: 6 additions & 0 deletions docs/concepts/PSRule/en-US/about_PSRule_Baseline.md
Expand Up @@ -43,6 +43,7 @@ To define a baseline spec use the following structure:
```yaml
---
# Synopsis: <synopsis>
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
name: <name>
Expand All @@ -59,6 +60,7 @@ For example:
```yaml
---
# Synopsis: This is an example baseline
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
name: Baseline1
Expand All @@ -84,6 +86,7 @@ spec:

---
# Synopsis: This is an example baseline
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
name: Baseline2
Expand Down Expand Up @@ -130,6 +133,7 @@ For example:
```yaml
---
# Synopsis: This is an example baseline that is obsolete
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
name: ObsoleteBaseline
Expand All @@ -145,6 +149,7 @@ spec: { }
```yaml
---
# Synopsis: This is an example baseline
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
name: TestBaseline1
Expand All @@ -162,6 +167,7 @@ spec:

---
# Synopsis: This is an example baseline
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
name: TestBaseline2
Expand Down
1 change: 1 addition & 0 deletions docs/concepts/PSRule/en-US/about_PSRule_Conventions.md
Expand Up @@ -119,6 +119,7 @@ For example:
```yaml
# Example Config.Rule.yaml
---
apiVersion: github.com/microsoft/PSRule/v1
kind: ModuleConfig
metadata:
name: ExampleModule
Expand Down
3 changes: 2 additions & 1 deletion docs/concepts/PSRule/en-US/about_PSRule_Docs.md
Expand Up @@ -46,7 +46,8 @@ Get-PSRuleHelp <rule-name> -Online

### Creating documentation

Rule documentation is composed of markdown files, one per rule. When creating rules for more then one culture, a separate markdown file is created per rule per culture.
Rule documentation is composed of markdown files, one per rule.
When creating rules for more then one culture, a separate markdown file is created per rule per culture.

The markdown files for each rule is automatically discovered based on naming convention.

Expand Down

0 comments on commit 545f0fd

Please sign in to comment.