|
63 | 63 | f'[]({NAVIGATOR_URL})' |
64 | 64 | ) |
65 | 65 | RULES_CONFIG = parse_rules_config() |
| 66 | +# The base package version that we will start to include all versions of historical rules |
| 67 | +BASE_PKG_VERSION = Version(major=8, minor=17, patch=0) |
66 | 68 |
|
67 | 69 |
|
68 | 70 | def get_github_token() -> Optional[str]: |
@@ -124,7 +126,19 @@ def build_release(ctx: click.Context, config_file, update_version_lock: bool, ge |
124 | 126 | registry_data['conditions']['kibana.version'].strip("^")) |
125 | 127 | sde = SecurityDetectionEngine() |
126 | 128 | historical_rules = sde.load_integration_assets(previous_pkg_version) |
127 | | - limited_historical_rules = sde.keep_latest_versions(historical_rules) |
| 129 | + current_pkg_version = Version.parse(registry_data['version']) |
| 130 | + # pre-release versions are not included in the version comparison |
| 131 | + # Version 8.17.0-beta.1 is considered lower than 8.17.0 |
| 132 | + current_pkg_version_no_prerelease = Version(major=current_pkg_version.major, |
| 133 | + minor=current_pkg_version.minor, patch=current_pkg_version.patch) |
| 134 | + if current_pkg_version_no_prerelease >= BASE_PKG_VERSION: |
| 135 | + click.echo(f'[+] Adding all historical rule versions in our release package for version \ |
| 136 | + {current_pkg_version_no_prerelease}') |
| 137 | + limited_historical_rules = historical_rules |
| 138 | + else: |
| 139 | + click.echo(f'[+] Limit historical rule versions in our release package for version \ |
| 140 | + {current_pkg_version_no_prerelease}') |
| 141 | + limited_historical_rules = sde.keep_latest_versions(historical_rules) |
128 | 142 | package.add_historical_rules(limited_historical_rules, registry_data['version']) |
129 | 143 | click.echo(f'[+] Adding historical rules from {previous_pkg_version} package') |
130 | 144 |
|
|
0 commit comments