Skip to content

Sort permission lists as the last state #247

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

Merged
merged 8 commits into from
May 5, 2025

Conversation

Eyal-Shalev
Copy link
Contributor

Description

What - When refreshing permission lists, use the ordering of values from the previous state for sorting values from the server
Why - To keep the sort that exists in the state instead of forcing an arbitrary sorting from the server.
How - Transform the old lists to a mapping from their string values to their index in the slice. Then use SortedFunc to sort the values according to their positioning.

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)

… previous state for sorting values from the server
Copy link
Member

@erikzaadi erikzaadi left a comment

Choose a reason for hiding this comment

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

image

Copy link

github-actions bot commented May 4, 2025

TestsPassed ✅SkippedFailedTime ⏱
JUnit Test Report166 ran166 ✅0 ⚠️0 ❌16m 40s 239ms

Copy link

github-actions bot commented May 4, 2025

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

Code Coverage Total Percentage: 70.4%

Copy link

github-actions bot commented May 4, 2025

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

Copy link

github-actions bot commented May 4, 2025

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

Code Coverage Total Percentage: 70.4%

Copy link

github-actions bot commented May 4, 2025

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

Copy link

github-actions bot commented May 5, 2025

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

Code Coverage Total Percentage: 74.0%

@Eyal-Shalev Eyal-Shalev merged commit 3befa22 into main May 5, 2025
21 checks passed
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