Skip to content

🐛 Apply ECS and ECR filters in general and not only during discovery.#6333

Merged
tas50 merged 1 commit intomainfrom
vasil/move-ecs-ecr-filtering
Dec 31, 2025
Merged

🐛 Apply ECS and ECR filters in general and not only during discovery.#6333
tas50 merged 1 commit intomainfrom
vasil/move-ecs-ecr-filtering

Conversation

@VasilSirakov
Copy link
Copy Markdown
Contributor

@VasilSirakov VasilSirakov commented Dec 22, 2025

These ECR/ECS filters were only being applied during discovery. This moves the filter evaluation at the API call level which makes sure it works in general without the --discover flag. This also allows us to remove some more legacy functions.

Output from a test run:

cnquery> aws.ecr.privateRepositories { images { * } }
DBG skipping ecr private image due to tag filters repository=vasil/testrepo tags=["latest"]
DBG finished query execution qrid=pMXEAtU4uJI=
DBG VMlGZugtMv/xdwgWLhX3vB+R4ISz9WJWSaUexK0uzPagiwaJlAbh0Of8J4lyxMmU5Ipd6OI7FrnApcoNVZQUag== finished
DBG graph has received all datapoints
aws.ecr.privateRepositories: [
  0: {
    images: []
  }
]

Base automatically changed from vasil/ecr-pagination to main December 22, 2025 13:03
@VasilSirakov VasilSirakov force-pushed the vasil/move-ecs-ecr-filtering branch from 9462de2 to f6425d0 Compare December 22, 2025 13:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 22, 2025

Test Results

4 713 tests  +10   4 709 ✅ +10   2m 34s ⏱️ +25s
  415 suites ± 0       4 💤 ± 0 
   31 files   ± 0       0 ❌ ± 0 

Results for commit 4a7a94c. ± Comparison against base commit af93da8.

This pull request removes 2 and adds 12 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestMatchesExcludeTags/no_exclude_tags_matches
go.mondoo.com/cnquery/v12/providers/aws/resources ‑ TestFilters
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesExcludeTags
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesExcludeTags/exclude_tags_do_not_match
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesExcludeTags/exclude_tags_match
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesExcludeTags/no_exclude_tags_does_not_match
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesIncludeTags
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesIncludeTags/include_tags_do_not_match
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesIncludeTags/include_tags_match
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcrMatchesIncludeTags/no_include_tags_matches
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcsMatchesOnlyRunningContainers
go.mondoo.com/cnquery/v12/providers/aws/connection ‑ TestEcsMatchesOnlyRunningContainers/OnlyRunningContainers_is_false,_any_container_state_matches
…

♻️ This comment has been updated with latest results.

@VasilSirakov VasilSirakov changed the title 🧹 Move ECS and ECR filtering to a more appropriate place. 🐛 Apply ECS and ECR filters in general and not only during discovery. Dec 22, 2025
@VasilSirakov VasilSirakov marked this pull request as ready for review December 22, 2025 14:22
Signed-off-by: Vasil Sirakov <sirakov97@gmail.com>
@VasilSirakov VasilSirakov force-pushed the vasil/move-ecs-ecr-filtering branch from f6efdb2 to 4a7a94c Compare December 22, 2025 14:35
Copy link
Copy Markdown
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @VasilSirakov

@tas50 tas50 merged commit 1c3f958 into main Dec 31, 2025
20 checks passed
@tas50 tas50 deleted the vasil/move-ecs-ecr-filtering branch December 31, 2025 17:14
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants