[PR #97] [MERGED] refactor: consolidate waiter and paginator structs #231

Closed
opened 2026-03-15 11:54:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/awslabs/iam-policy-autopilot/pull/97
Author: @adpaco-aws
Created: 1/12/2026
Status: Merged
Merged: 1/20/2026
Merged by: @adpaco-aws

Base: mainHead: refactor-extraction-structs


📝 Commits (8)

  • 7bd5ecf refactor: consolidate waiter and paginator structs
  • 1ad520a Merge branch 'main' into refactor-extraction-structs
  • 1ff9fc6 Merge branch 'main' into refactor-extraction-structs
  • d32540b resolve outstanding merge issues
  • 9924560 few more fixes (fmt, etc.)
  • 509f837 clippy fixes + leftover struct
  • 46041ec change viz to pub(crate) on structs
  • 4f7142a make pub(crate) use too

📊 Changes

7 files changed (+201 additions, -264 deletions)

View changed files

📝 iam-policy-autopilot-policy-generation/src/extraction/go/paginator_extractor.rs (+27 -49)
📝 iam-policy-autopilot-policy-generation/src/extraction/go/waiter_extractor.rs (+25 -67)
📝 iam-policy-autopilot-policy-generation/src/extraction/mod.rs (+1 -0)
📝 iam-policy-autopilot-policy-generation/src/extraction/python/paginator_extractor.rs (+30 -73)
📝 iam-policy-autopilot-policy-generation/src/extraction/python/waiters_extractor.rs (+24 -75)
iam-policy-autopilot-policy-generation/src/extraction/shared/extraction_utils.rs (+91 -0)
iam-policy-autopilot-policy-generation/src/extraction/shared/mod.rs (+3 -0)

📄 Description

Issue #, if available: N/A

Description of changes: Consolidated waiter and paginator extraction structs from Python and Go extractors into a unified shared module. This eliminates code duplication and creates a consistent API across languages.

As part of this refactoring, we have replaced line-related fields with start_position and end_position tuple fields for better precision. I noticed that we could go even further and have WaiterCreationInfo and PaginatorCreationInfo become a single struct UtilityCreationInfo but I decided against it to have the code be clearer about what it's doing.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/awslabs/iam-policy-autopilot/pull/97 **Author:** [@adpaco-aws](https://github.com/adpaco-aws) **Created:** 1/12/2026 **Status:** ✅ Merged **Merged:** 1/20/2026 **Merged by:** [@adpaco-aws](https://github.com/adpaco-aws) **Base:** `main` ← **Head:** `refactor-extraction-structs` --- ### 📝 Commits (8) - [`7bd5ecf`](https://github.com/awslabs/iam-policy-autopilot/commit/7bd5ecf23b5d46c4811cbd85542b8fa3dd065cad) refactor: consolidate waiter and paginator structs - [`1ad520a`](https://github.com/awslabs/iam-policy-autopilot/commit/1ad520a16f3ec4e0ed1932e973734713048ff327) Merge branch 'main' into refactor-extraction-structs - [`1ff9fc6`](https://github.com/awslabs/iam-policy-autopilot/commit/1ff9fc6e68eb96f74714f95d8231fad073380945) Merge branch 'main' into refactor-extraction-structs - [`d32540b`](https://github.com/awslabs/iam-policy-autopilot/commit/d32540ba94f4f2b50bc0e6eb460d63cf0a7ca697) resolve outstanding merge issues - [`9924560`](https://github.com/awslabs/iam-policy-autopilot/commit/99245606786bad999e00e6eb31817f3c5c94ee16) few more fixes (fmt, etc.) - [`509f837`](https://github.com/awslabs/iam-policy-autopilot/commit/509f8376c56a4cd25f8c92f87be71bc4f1916020) clippy fixes + leftover struct - [`46041ec`](https://github.com/awslabs/iam-policy-autopilot/commit/46041ec6783f500521da14a444cb2e16a5d942b7) change viz to `pub(crate)` on structs - [`4f7142a`](https://github.com/awslabs/iam-policy-autopilot/commit/4f7142a267c19bda62907f4b727a2226da54802d) make `pub(crate) use` too ### 📊 Changes **7 files changed** (+201 additions, -264 deletions) <details> <summary>View changed files</summary> 📝 `iam-policy-autopilot-policy-generation/src/extraction/go/paginator_extractor.rs` (+27 -49) 📝 `iam-policy-autopilot-policy-generation/src/extraction/go/waiter_extractor.rs` (+25 -67) 📝 `iam-policy-autopilot-policy-generation/src/extraction/mod.rs` (+1 -0) 📝 `iam-policy-autopilot-policy-generation/src/extraction/python/paginator_extractor.rs` (+30 -73) 📝 `iam-policy-autopilot-policy-generation/src/extraction/python/waiters_extractor.rs` (+24 -75) ➕ `iam-policy-autopilot-policy-generation/src/extraction/shared/extraction_utils.rs` (+91 -0) ➕ `iam-policy-autopilot-policy-generation/src/extraction/shared/mod.rs` (+3 -0) </details> ### 📄 Description *Issue #, if available:* N/A *Description of changes:* Consolidated waiter and paginator extraction structs from Python and Go extractors into a unified shared module. This eliminates code duplication and creates a consistent API across languages. As part of this refactoring, we have replaced line-related fields with `start_position` and `end_position` tuple fields for better precision. I noticed that we could go even further and have `WaiterCreationInfo` and `PaginatorCreationInfo` become a single struct `UtilityCreationInfo` but I decided against it to have the code be clearer about what it's doing. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:54:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/iam-policy-autopilot#231
No description provided.