Skip to content

Add path filter tf support #268

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Add path filter tf support #268

wants to merge 11 commits into from

Conversation

razsamuel
Copy link

@razsamuel razsamuel commented Jul 15, 2025

Description

What -Add pathFilter support to aggregation property
Why - Improve performance and accuracy
How - Add an option to filter on specific path

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

razsamuel added 4 commits June 8, 2025 14:29
…roperties

- Introduced PathFilter in AggregationProperty and related models.
- Updated Terraform schema to include path_filter attribute.
- Implemented conversion logic for PathFilter in readStateToPortBody and refreshAggregationPropertiesState functions.
- Enhanced main.tf example to demonstrate PathFilter usage.
Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16295563378/artifacts/3536864100

Code Coverage Total Percentage: 75.9%

Copy link

github-actions bot commented Jul 15, 2025

TestsPassed ✅SkippedFailedTime ⏱
JUnit Test Report180 ran180 ✅0 ⚠️0 ❌23m 6s 149ms
TestRetriesTime ⏱
JUnit Test Report
com/port-labs/terraform-provider-port-labs/v2/port/entity.TestAccPortEntityWithManyRelation18s 29ms

Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16295953983/artifacts/3537027798

Code Coverage Total Percentage: 70.8%

Copy link

🚨 The new code coverage percentage is lower than the current one. Current coverage: 71.4
While the new one is: 70.8

…on properties

- Clarified the description of the `path` attribute in the documentation to specify its purpose.
- Refactored conversion logic in `readStateToPortBody` and `refreshAggregationPropertiesState` to improve clarity and maintainability.
Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16343899386/artifacts/3554204258

Code Coverage Total Percentage: 86.0%

Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16343909458/artifacts/3554214045

Code Coverage Total Percentage: 75.9%

…in aggregation properties

- Implemented tests for creating aggregation properties with and without path filters.
- Added support for multiple path filters in aggregation properties.
- Enhanced existing tests to validate the behavior of path filters in various scenarios.
Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16345023731/artifacts/3554607886

Code Coverage Total Percentage: 74.2%

Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16345098681/artifacts/3554671561

Code Coverage Total Percentage: 68.1%

Copy link

🚨 The new code coverage percentage is lower than the current one. Current coverage: 71.4
While the new one is: 68.1

@@ -61,6 +62,26 @@ func aggregationPropertiesToBody(state *AggregationPropertiesModel) (*map[string
newAggregationProperty.Query = *query
}

if len(aggregationProperty.PathFilter) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to check that it is not null as well?

@@ -28,6 +30,27 @@ func (r *AggregationPropertiesResource) refreshAggregationPropertiesState(state
}
state.Properties[aggregationPropertyIdentifier].Query = query

if len(aggregationProperty.PathFilter) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to check that it is not null as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets test also the fromBlueprint is one of this cases

…fety in readStateToPortBody and refreshAggregationPropertiesState functions
Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16449838421/artifacts/3589493203

Code Coverage Total Percentage: 76.3%

…ecks in readStateToPortBody and refreshAggregationPropertiesState functions
Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16452112872/artifacts/3590364593

Code Coverage Total Percentage: 64.8%

Copy link

🚨 The new code coverage percentage is lower than the current one. Current coverage: 71.4
While the new one is: 64.8

Copy link

Code Coverage Artifact 📈: https://github.com/port-labs/terraform-provider-port-labs/actions/runs/16452419008/artifacts/3590521579

Code Coverage Total Percentage: 73.0%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants