Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Update the release versioning process and workflow #4257

Merged
merged 5 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/version-code-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
fi
fi

release_drafter:
tag_and_draft_release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
Expand All @@ -73,6 +73,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set github config
run: |
git config --global user.email "[email protected]"
git config --global user.name "protectionsmachine"

- name: Extract version from pyproject.toml and create tag
id: extract_version
run: |
version=$(grep '^version = ' pyproject.toml | cut -d '"' -f2)
echo "Detected version: $version"
git tag -a "dev-v$version" -m "Release version $version"
git push origin "v$version"

- name: Run Release Drafter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@traut was going to gate this behind only major/minor tags, but since its only generating a draft, I now dont think we need to.

uses: release-drafter/release-drafter@v6
with:
Expand Down
8 changes: 5 additions & 3 deletions docs/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Increment the patch version when making bug fixes, performance improvements, or
- Small performance tweaks for the hunting rule management.
- **Docs Folder**:
- Updates to documentation.
- **JSON Schemas**:
- Recurring update to schema definitions that don't break compatibility (not .py schema updates).

</p>
</details>
Expand Down Expand Up @@ -140,7 +142,7 @@ Increment the major version when introducing backward-incompatible changes that

## Tagging Process

Each release will be tagged using the following format:
Each pyproject.toml update will be tagged using the following format:
- **Tag Format**: `dev-vX.Y.Z` (e.g., `dev-v1.2.0`).
- **Single Tag for Combined Releases**: If there are changes to the core detection-rules code or libraries (`kql`, `kibana`), they will be tagged together as a single release with the core detection-rules versioning.
- **Hunting Folder**: Changes to the hunting logic will be included in the combined release.
Expand All @@ -151,11 +153,11 @@ Each release will be tagged using the following format:

## When to Trigger a GitHub Release

A draft release will be triggered in the following cases:
A draft release will be triggered on all version updates. For example, in the following cases:
- **New Feature or Bug Fix**: Once a feature or bug fix is merged into `main`, a version bump is made according to the semantic versioning rules.
- **Version Bump**: After the version bump, a GitHub release will be created using **release-drafter** CI workflow to automate draft release generation.

As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish quarterly.

> [!IMPORTANT]
> Proper PR labels need to be added for this to properly be labeled and added to the draft.
> Releases are published on minor and major version bumps at a minimum. Prior to publishing, the release notes should be reviewed and updated with any additional information, or remove any unnecessary details not related to code changes (which may occur due to release-drafter pulling in all commits).
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "detection_rules"
version = "0.1.1"
version = "0.1.2"
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
readme = "README.md"
requires-python = ">=3.12"
Expand Down
Loading