Skip to content

[FR] Limit historical rules to the latest 2#3842

Merged
Mikaayenson merged 9 commits intomainfrom
limit_historical_rules
Jun 28, 2024
Merged

[FR] Limit historical rules to the latest 2#3842
Mikaayenson merged 9 commits intomainfrom
limit_historical_rules

Conversation

@Mikaayenson
Copy link
Copy Markdown
Contributor

Issues

N/A

Summary

Currently we publish historical rules for each release. At times rules may include multiple updates / versions in the release package, which inflates the number of files in the release package. Today the package has > 5000 artifacts, which impacts memory resources upstream. We have been asked by D&R to update this process to release only the latest 2 versions instead of all to de-risk memory concerns.

I've added a new method keep_latest_versions which filters down to the latest two versions.

Testing

Debug the python -m detection_rules dev build-release

Debugging

Screenshot 2024-06-27 at 1 30 50 PM

Screenshot 2024-06-27 at 1 34 21 PM

Additional Information

@Mikaayenson Mikaayenson added enhancement New feature or request ci/cd fleet-release Issue tracking rule updates released to (OOB) Fleet integration package labels Jun 27, 2024
@Mikaayenson Mikaayenson self-assigned this Jun 27, 2024
@botelastic botelastic bot added the python Internal python for the repository label Jun 27, 2024
@eric-forte-elastic
Copy link
Copy Markdown
Contributor

eric-forte-elastic commented Jun 27, 2024

🟢 Testing looks good to me, I have the same debugging results as @Mikaayenson

Debugging

Historical Rules before Limiting
Screenshot from 2024-06-27 14-59-50

Historical Rules post limiting

Screenshot from 2024-06-27 15-00-15

@Mikaayenson
Copy link
Copy Markdown
Contributor Author

Mikaayenson commented Jun 27, 2024

I double confirmed the package is built with the two latest versions and we should be g2g.

Screenshot 2024-06-27 at 5 14 20 PM

Copy link
Copy Markdown

@banderror banderror left a comment

Choose a reason for hiding this comment

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

LGTM

@Mikaayenson Mikaayenson merged commit 357204e into main Jun 28, 2024
@Mikaayenson Mikaayenson deleted the limit_historical_rules branch June 28, 2024 11:42
protectionsmachine pushed a commit that referenced this pull request Jun 28, 2024
protectionsmachine pushed a commit that referenced this pull request Jun 28, 2024
protectionsmachine pushed a commit that referenced this pull request Jun 28, 2024
protectionsmachine pushed a commit that referenced this pull request Jun 28, 2024
protectionsmachine pushed a commit that referenced this pull request Jun 28, 2024
protectionsmachine pushed a commit that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport: auto ci/cd enhancement New feature or request 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.

5 participants