Skip to content

feat(github): add check for dismissing stale PR approvals on default branch (CIS 1.1.4)#10569

Merged
danibarranqueroo merged 7 commits into
prowler-cloud:masterfrom
Mathisdjango:verification-feature
Apr 22, 2026
Merged

feat(github): add check for dismissing stale PR approvals on default branch (CIS 1.1.4)#10569
danibarranqueroo merged 7 commits into
prowler-cloud:masterfrom
Mathisdjango:verification-feature

Conversation

@Mathisdjango
Copy link
Copy Markdown
Contributor

Description

Implements CIS Control 1.1.4 for the GitHub provider.

This check verifies that repositories are configured to automatically
dismiss stale pull request approvals when new commits are pushed,
ensuring that every code change undergoes a fresh review before merging.

Changes

  • Added dismiss_stale_reviews field to the Branch model in repository_service.py
  • Implemented check repository_default_branch_dismisses_stale_reviews
  • Added metadata JSON file
  • Added 3 unit tests (all passing)

Testing

  • All existing tests pass
  • 3 new unit tests added and passing

Closes #8660

@Mathisdjango Mathisdjango requested a review from a team April 3, 2026 10:56
@Mathisdjango Mathisdjango requested a review from a team as a code owner April 3, 2026 10:56
@github-actions github-actions Bot added provider/github Issues/PRs related with the Github provider metadata-review labels Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions github-actions Bot added the community Opened by the Community label Apr 3, 2026
@danibarranqueroo
Copy link
Copy Markdown
Member

Hello @Mathisdjango!

I've done a quick review, could you please remove French comments (or translate into English), add the changelog and remove the init from the tests folder? After that we'll do a deep review of the check itself.

Also, if you have tested it, it would be very helpful for us if you share some screenshots of a FAIL and a PASS cases.

Thanks for this and for helping improve Prowler! 🚀

@andoniaf andoniaf added the status/awaiting-reponse Waiting response from owner label Apr 9, 2026
@Mathisdjango Mathisdjango force-pushed the verification-feature branch from 0b89355 to 99f3df8 Compare April 20, 2026 10:33
@Mathisdjango
Copy link
Copy Markdown
Contributor Author

Hello! I've addressed all the requested changes : removed the comments, added the changelog entry, and removed the test init.py. I'll add the PASS/FAIL screenshots shortly. Thanks for the feedback!

@danibarranqueroo danibarranqueroo requested a review from a team as a code owner April 22, 2026 11:20
@github-actions github-actions Bot added the compliance Issues/PRs related with the Compliance Frameworks label Apr 22, 2026
@danibarranqueroo
Copy link
Copy Markdown
Member

Hello @Mathisdjango!

Thanks for your changes and for contributing! Quick comment:I’ve updated the check to evaluate and return ruleset data correctly, and I also added the corresponding compliance mapping.

Also, I've tested the check and now it seems to be working as expected. 🚀

@danibarranqueroo danibarranqueroo changed the title add check for dismissing stale PR approvals on default branch (CIS 1.1.4) feat(github): add check for dismissing stale PR approvals on default branch (CIS 1.1.4) Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 80.90909% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.65%. Comparing base (1093f6c) to head (907a94e).
⚠️ Report is 3 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (1093f6c) and HEAD (907a94e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1093f6c) HEAD (907a94e)
api 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10569       +/-   ##
===========================================
- Coverage   93.51%   79.65%   -13.87%     
===========================================
  Files         228       33      -195     
  Lines       32266     1268    -30998     
===========================================
- Hits        30174     1010    -29164     
+ Misses       2092      258     -1834     
Flag Coverage Δ
api ?
prowler-py3.10-github 79.65% <80.90%> (?)
prowler-py3.11-github 79.65% <80.90%> (?)
prowler-py3.12-github 79.65% <80.90%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler 79.65% <80.90%> (∅)
api ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@pedrooot pedrooot left a comment

Choose a reason for hiding this comment

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

Thanks!! 🔝

@danibarranqueroo danibarranqueroo merged commit 927be17 into prowler-cloud:master Apr 22, 2026
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Opened by the Community compliance Issues/PRs related with the Compliance Frameworks metadata-review provider/github Issues/PRs related with the Github provider status/awaiting-reponse Waiting response from owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Github check to ensure Previous Approvals Are Dismissed When Updates Are Introduced to a Code Change Proposal

4 participants