[Bug] Add new-package argument to bump-pkg-versions CLI (#2703)
* initial changes to release fleet workflow and CLI * changed the default value of package version for 8.8 * changed how true/false is passed into CLI command * reverted changes to packages.yml
This commit is contained in:
@@ -11,11 +11,26 @@ on:
|
||||
required: true
|
||||
default: 'main'
|
||||
draft:
|
||||
description: 'Create a PR as draft (y/n)'
|
||||
type: choice
|
||||
description: 'Create a PR as draft'
|
||||
required: false
|
||||
options:
|
||||
- "y"
|
||||
- "n"
|
||||
package_maturity:
|
||||
description: 'Package Maturity (ga/beta)'
|
||||
type: choice
|
||||
description: 'Package Maturity'
|
||||
required: true
|
||||
options:
|
||||
- "ga"
|
||||
- "beta"
|
||||
new_package:
|
||||
type: choice
|
||||
description: 'New Package'
|
||||
required: true
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
commit_hash:
|
||||
description: 'Commit hash'
|
||||
required: true
|
||||
@@ -95,10 +110,12 @@ jobs:
|
||||
- name: Bump prebuilt rules package version
|
||||
env:
|
||||
PACKAGE_MATURITY: "${{github.event.inputs.package_maturity}}"
|
||||
NEW_PACKAGE: "${{github.event.inputs.new_package}}"
|
||||
run: |
|
||||
cd detection-rules
|
||||
python -m detection_rules dev bump-pkg-versions \
|
||||
--patch-release \
|
||||
--new-package $NEW_PACKAGE \
|
||||
--maturity $PACKAGE_MATURITY
|
||||
|
||||
- name: Store release tag
|
||||
|
||||
@@ -161,9 +161,10 @@ def build_integration_docs(ctx: click.Context, registry_version: str, pre: str,
|
||||
@click.option("--major-release", is_flag=True, help="bump the major version")
|
||||
@click.option("--minor-release", is_flag=True, help="bump the minor version")
|
||||
@click.option("--patch-release", is_flag=True, help="bump the patch version")
|
||||
@click.option("--new-package", type=click.Choice(['true', 'false']), help="indicates new package")
|
||||
@click.option("--maturity", type=click.Choice(['beta', 'ga'], case_sensitive=False),
|
||||
required=True, help="beta or production versions")
|
||||
def bump_versions(major_release: bool, minor_release: bool, patch_release: bool, maturity: str):
|
||||
def bump_versions(major_release: bool, minor_release: bool, patch_release: bool, new_package: str, maturity: str):
|
||||
"""Bump the versions"""
|
||||
|
||||
pkg_data = load_etc_dump('packages.yml')['package']
|
||||
@@ -197,6 +198,9 @@ def bump_versions(major_release: bool, minor_release: bool, patch_release: bool,
|
||||
pkg_data["registry_data"]["version"] = str(latest_patch_release_ver.bump_patch())
|
||||
pkg_data["registry_data"]["release"] = maturity
|
||||
else:
|
||||
# passing in true or false from GH actions; not using eval() for security purposes
|
||||
if new_package == "true":
|
||||
latest_patch_release_ver = latest_patch_release_ver.bump_patch()
|
||||
pkg_data["registry_data"]["version"] = str(latest_patch_release_ver.bump_prerelease("beta"))
|
||||
pkg_data["registry_data"]["release"] = maturity
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ package:
|
||||
release: ga
|
||||
title: Prebuilt Security Detection Rules
|
||||
type: integration
|
||||
version: 8.8.0-beta.1
|
||||
version: 8.8.0-beta.0
|
||||
release: true
|
||||
|
||||
Reference in New Issue
Block a user