Skip to content

Allow rules to be versioned #787

@BernieWhite

Description

@BernieWhite

Currently each rule can be created and updated. While rules can be named independently to identify the version of the rule there is no explicit support for versioning a rule and selecting a rule version.

For example:

Rule 'Rule1' -Version 1 {
    # implementation
}
---
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
  name: Rule1
  version: 1
spec: { }

Rule Id would be updated to be .\Rule1@1 or Module\Rule1@1.

Potentially a semver version could be used. but there may be little or no benefits if we assume semver that a minor or patch versions are backward compatible. If this is true, why would a separate rule with a minor or patch version increment be created?

When using rules in baselines, by name or dependency we need to have a consistent behaviour about selecting the rule version, like select the latest unless specified.

Metadata

Metadata

Assignees

Labels

feature: coreIssues that affect the core engineincubateCategorizes an issue that requires further incubation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions