[PR #152] [MERGED] refactor: SdkMethodCallMetadata easier to extend #265

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

📋 Pull Request Information

Original PR: https://github.com/awslabs/iam-policy-autopilot/pull/152
Author: @mschlaipfer
Created: 2/17/2026
Status: Merged
Merged: 2/17/2026
Merged by: @mschlaipfer

Base: mainHead: refactor-sdk-method-call-metadata


📝 Commits (1)

  • 012255b refactor: SdkMethodCallMetadata easier to extend

📊 Changes

11 files changed (+784 additions, -692 deletions)

View changed files

📝 iam-policy-autopilot-policy-generation/src/enrichment/mod.rs (+17 -21)
📝 iam-policy-autopilot-policy-generation/src/extraction/go/disambiguation.rs (+219 -213)
📝 iam-policy-autopilot-policy-generation/src/extraction/go/extractor.rs (+12 -7)
📝 iam-policy-autopilot-policy-generation/src/extraction/go/features_extractor.rs (+10 -7)
📝 iam-policy-autopilot-policy-generation/src/extraction/javascript/shared.rs (+40 -42)
📝 iam-policy-autopilot-policy-generation/src/extraction/mod.rs (+90 -19)
📝 iam-policy-autopilot-policy-generation/src/extraction/python/disambiguation.rs (+113 -107)
📝 iam-policy-autopilot-policy-generation/src/extraction/python/disambiguation_tests.rs (+212 -202)
📝 iam-policy-autopilot-policy-generation/src/extraction/python/extractor.rs (+12 -7)
📝 iam-policy-autopilot-policy-generation/src/extraction/python/resource_direct_calls_extractor.rs (+48 -53)
📝 iam-policy-autopilot-policy-generation/src/extraction/shared/extraction_utils.rs (+11 -14)

📄 Description

Issue #, if available: related: https://github.com/awslabs/iam-policy-autopilot/issues/61

Description of changes: Refactor SdkMethodCallMetadata to make it easier to extend. Currently adding a new field requires changing ~50 struct initialization sites (mostly in tests). Adding the with_... setters makes it easier to add a new field, which adds functionality, without having to immediately refactor the extractors for all languages.

Prepares for using return type information in Java, if present. Adds, the currently unused result_usage: Option<MethodCallResultUsage>.

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/152 **Author:** [@mschlaipfer](https://github.com/mschlaipfer) **Created:** 2/17/2026 **Status:** ✅ Merged **Merged:** 2/17/2026 **Merged by:** [@mschlaipfer](https://github.com/mschlaipfer) **Base:** `main` ← **Head:** `refactor-sdk-method-call-metadata` --- ### 📝 Commits (1) - [`012255b`](https://github.com/awslabs/iam-policy-autopilot/commit/012255bdc2ee1cb33e14176fedeeb63d14a01faa) refactor: SdkMethodCallMetadata easier to extend ### 📊 Changes **11 files changed** (+784 additions, -692 deletions) <details> <summary>View changed files</summary> 📝 `iam-policy-autopilot-policy-generation/src/enrichment/mod.rs` (+17 -21) 📝 `iam-policy-autopilot-policy-generation/src/extraction/go/disambiguation.rs` (+219 -213) 📝 `iam-policy-autopilot-policy-generation/src/extraction/go/extractor.rs` (+12 -7) 📝 `iam-policy-autopilot-policy-generation/src/extraction/go/features_extractor.rs` (+10 -7) 📝 `iam-policy-autopilot-policy-generation/src/extraction/javascript/shared.rs` (+40 -42) 📝 `iam-policy-autopilot-policy-generation/src/extraction/mod.rs` (+90 -19) 📝 `iam-policy-autopilot-policy-generation/src/extraction/python/disambiguation.rs` (+113 -107) 📝 `iam-policy-autopilot-policy-generation/src/extraction/python/disambiguation_tests.rs` (+212 -202) 📝 `iam-policy-autopilot-policy-generation/src/extraction/python/extractor.rs` (+12 -7) 📝 `iam-policy-autopilot-policy-generation/src/extraction/python/resource_direct_calls_extractor.rs` (+48 -53) 📝 `iam-policy-autopilot-policy-generation/src/extraction/shared/extraction_utils.rs` (+11 -14) </details> ### 📄 Description *Issue #, if available:* related: https://github.com/awslabs/iam-policy-autopilot/issues/61 *Description of changes:* Refactor `SdkMethodCallMetadata` to make it easier to extend. Currently adding a new field requires changing ~50 struct initialization sites (mostly in tests). Adding the `with_...` setters makes it easier to add a new field, which adds functionality, without having to immediately refactor the extractors for all languages. Prepares for using return type information in Java, if present. Adds, the currently unused `result_usage: Option<MethodCallResultUsage>`. 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:56:40 +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#265
No description provided.