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

[Bug] Update Prebuilt Detection Rules Release Process #3403

Merged
merged 15 commits into from
Feb 6, 2024

Conversation

terrancedejesus
Copy link
Contributor

@terrancedejesus terrancedejesus commented Jan 23, 2024

Issues

Summary

This pull request fixes the Detection Rules release workflow and related CLI commands used. Below is a list of issues that were addressed and have more detailed information in the related issue.

  • Automatic Locked Version Workflow Commit Hash Identification
  • Incorrect use of branch version for determining previous release packages from EPR
  • Add historical rules not default since the dropped support for 8.7 and previous
  • Integrations PR labeling and description updates

Tasks

Preview Give feedback

Testing

Testing will be a big part of these updates. The importance of testing it to ensure these important steps work as intended:

  • Locked Versions workflow commit is properly obtained and used after checking out protected branches
  • When bump-pkg-versions CLI command is used, packages.yml reflects the accurate results; only distinguishable when integrations PR is created as it will reflect in the manifest

Example run: https://github.com/elastic/detection-rules/actions/runs/7791122549

Release Workflow Test:

  1. Detection Rules repo > Actions
  2. Select release-fleet > Run workflow
  3. Change "User workflow from" from main to bug-release-process-updates
  4. Leave default options
  5. Select "run workflow"
  6. Monitor workflow progress
  7. Under Build package and create PR to integrations job > Build package and create PR to integrations; ensure that it checks out a version lock commit hash as shown below
Screenshot 2024-02-05 at 4 35 15 PM
  1. Note that the Build release package step is expected to fail. This is because we are checking out a commit hash that is PRIOR to this PR. As a result, when the package builds, it will incorrectly add release to the manifest which is fixed here.

@terrancedejesus terrancedejesus added bug Something isn't working python Internal python for the repository fleet-release Issue tracking rule updates released to (OOB) Fleet integration package labels Jan 23, 2024
@terrancedejesus terrancedejesus self-assigned this Jan 23, 2024
@terrancedejesus terrancedejesus marked this pull request as draft January 23, 2024 23:48
@terrancedejesus terrancedejesus linked an issue Jan 25, 2024 that may be closed by this pull request
Copy link
Contributor

@eric-forte-elastic eric-forte-elastic left a comment

Choose a reason for hiding this comment

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

NIt:

Since we are now defining registry_data = config['registry_data']

I think we can reuse it in places like the following to make;

docs = IntegrationSecurityDocsMDX(config['registry_data']['version'], Path(f'releases/{config["name"]}-docs'),
                                          True, historical_rules, package, note=update_message
 
 docs = IntegrationSecurityDocsMDX(registry_data['version'], Path(f'releases/{config["name"]}-docs'),
                                          True, historical_rules, package, note=update_message)
 

@terrancedejesus
Copy link
Contributor Author

Since we are now defining registry_data = config['registry_data']. I think we can reuse it in places like the following to make;

Good point, updated.

@terrancedejesus terrancedejesus marked this pull request as draft February 5, 2024 19:54
@terrancedejesus terrancedejesus marked this pull request as ready for review February 5, 2024 20:00
Copy link
Contributor

@eric-forte-elastic eric-forte-elastic left a comment

Choose a reason for hiding this comment

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

Great peer review and demo/testing meeting. LGTM 👍

@terrancedejesus terrancedejesus merged commit 7df7ab5 into main Feb 6, 2024
13 checks passed
@terrancedejesus terrancedejesus deleted the bug-release-process-updates branch February 6, 2024 13:59
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
protectionsmachine pushed a commit that referenced this pull request Feb 6, 2024
* release fleet workflow updates; build package integration reference changes

* updated commit hash extraction to output to env

* adjusted bump-pkg-versions to only include release if necessary

* fixed flake errors

* add historical argument for build-release set to yes by default

* Update detection_rules/devtools.py

* fixed fleet workflow; updated registry data references

* updated job names

* removed extract commit hash job and consolidated into fleet pr job

* added echo statement for current branch before checkout

* removed id from extract commit hash

(cherry picked from commit 7df7ab5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: auto bug Something isn't working fleet-release Issue tracking rule updates released to (OOB) Fleet integration package python Internal python for the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Meta] Update Prebuilt Detection Rules Release Process
4 participants