diagram-to-iac 1.8.0__py3-none-any.whl → 1.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diagram_to_iac/config.yaml +8 -1
- diagram_to_iac/tools/git/git.py +74 -30
- {diagram_to_iac-1.8.0.dist-info → diagram_to_iac-1.9.0.dist-info}/METADATA +1 -1
- {diagram_to_iac-1.8.0.dist-info → diagram_to_iac-1.9.0.dist-info}/RECORD +7 -7
- {diagram_to_iac-1.8.0.dist-info → diagram_to_iac-1.9.0.dist-info}/WHEEL +0 -0
- {diagram_to_iac-1.8.0.dist-info → diagram_to_iac-1.9.0.dist-info}/entry_points.txt +0 -0
- {diagram_to_iac-1.8.0.dist-info → diagram_to_iac-1.9.0.dist-info}/top_level.txt +0 -0
diagram_to_iac/config.yaml
CHANGED
@@ -197,8 +197,15 @@ agents:
|
|
197
197
|
# GitHub settings
|
198
198
|
github:
|
199
199
|
default_assignees: ["team-infra"]
|
200
|
-
copilot_assignee: "
|
200
|
+
copilot_assignee: "Copilot" # GitHub Copilot username for issue assignment
|
201
|
+
fallback_assignee_strategy: "owner" # Options: "owner", "none", "default_assignees"
|
201
202
|
|
203
|
+
# Issue assignment configuration
|
204
|
+
issue_assignment:
|
205
|
+
prefer_copilot: true # Always try to assign to Copilot first
|
206
|
+
auto_assign_when_empty: true # Auto-assign when no assignees provided
|
207
|
+
smart_prioritization: true # Use smart assignee prioritization logic
|
208
|
+
|
202
209
|
# GitHub credentials and repository settings (for tests and development)
|
203
210
|
username: "amartyamandal" # GitHub username used in tests and development
|
204
211
|
default_repo: "amartyamandal/diagram-to-iac" # Default repository for development
|
diagram_to_iac/tools/git/git.py
CHANGED
@@ -767,42 +767,86 @@ class GitExecutor:
|
|
767
767
|
labels_str = ",".join(gh_input.labels)
|
768
768
|
gh_command += f" --label \"{labels_str}\""
|
769
769
|
|
770
|
+
# Load GitHub assignee configuration from config
|
771
|
+
github_config = self.config.get('github', {})
|
772
|
+
issue_assignment_config = github_config.get('issue_assignment', {})
|
773
|
+
copilot_assignee = github_config.get('copilot_assignee', 'Copilot')
|
774
|
+
prefer_copilot = issue_assignment_config.get('prefer_copilot', True)
|
775
|
+
auto_assign_when_empty = issue_assignment_config.get('auto_assign_when_empty', True)
|
776
|
+
smart_prioritization = issue_assignment_config.get('smart_prioritization', True)
|
777
|
+
fallback_strategy = github_config.get('fallback_assignee_strategy', 'owner')
|
778
|
+
|
770
779
|
# Smart assignee prioritization logic
|
771
780
|
assignees_to_use = gh_input.assignees or []
|
772
781
|
|
773
782
|
if assignees_to_use:
|
774
|
-
# If assignees are provided, apply smart prioritization
|
775
|
-
if
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
783
|
+
# If assignees are provided, apply smart prioritization (if enabled)
|
784
|
+
if smart_prioritization:
|
785
|
+
if copilot_assignee in assignees_to_use:
|
786
|
+
# Multiple assignees with Copilot -> assign to Copilot only
|
787
|
+
assignees_to_use = [copilot_assignee]
|
788
|
+
self.logger.info(f"Multiple assignees detected with @{copilot_assignee} - assigning to @{copilot_assignee} only")
|
789
|
+
elif len(assignees_to_use) == 1 and assignees_to_use[0] == owner:
|
790
|
+
# Only owner as assignee -> keep as owner
|
791
|
+
self.logger.info(f"Single assignee is repository owner - assigning to @{owner}")
|
792
|
+
elif len(assignees_to_use) > 1 and copilot_assignee not in assignees_to_use:
|
793
|
+
# Multiple assignees without Copilot -> assign to owner only
|
794
|
+
assignees_to_use = [owner]
|
795
|
+
self.logger.info(f"Multiple assignees without @{copilot_assignee} - assigning to repository owner @{owner} only")
|
796
|
+
# Single non-owner assignee -> keep as provided
|
797
|
+
else:
|
798
|
+
self.logger.info("Smart prioritization disabled - using assignees as provided")
|
787
799
|
else:
|
788
|
-
# No assignees provided - auto-assign
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
+
# No assignees provided - auto-assign based on configuration
|
801
|
+
if auto_assign_when_empty and prefer_copilot:
|
802
|
+
try:
|
803
|
+
# Check if configured Copilot user exists
|
804
|
+
check_copilot_cmd = f"gh api /users/{copilot_assignee}"
|
805
|
+
check_shell_input = ShellExecInput(command=check_copilot_cmd, timeout=10)
|
806
|
+
check_result = self.shell_executor.shell_exec(check_shell_input)
|
807
|
+
|
808
|
+
if check_result.exit_code == 0:
|
809
|
+
assignees_to_use = [copilot_assignee]
|
810
|
+
self.logger.info(f"No assignees provided - auto-assigning to @{copilot_assignee}")
|
811
|
+
else:
|
812
|
+
# Fallback based on strategy
|
813
|
+
if fallback_strategy == "owner":
|
814
|
+
assignees_to_use = [owner]
|
815
|
+
self.logger.info(f"No assignees provided, @{copilot_assignee} not available - auto-assigning to repository owner @{owner}")
|
816
|
+
elif fallback_strategy == "default_assignees":
|
817
|
+
default_assignees = github_config.get('default_assignees', [])
|
818
|
+
assignees_to_use = default_assignees if default_assignees else [owner]
|
819
|
+
self.logger.info(f"No assignees provided, @{copilot_assignee} not available - using default assignees: {assignees_to_use}")
|
820
|
+
else: # fallback_strategy == "none"
|
821
|
+
assignees_to_use = []
|
822
|
+
self.logger.info(f"No assignees provided, @{copilot_assignee} not available - no assignee set")
|
823
|
+
except Exception as e:
|
824
|
+
# Fallback to configured strategy if check fails
|
825
|
+
if fallback_strategy == "owner":
|
826
|
+
assignees_to_use = [owner]
|
827
|
+
self.logger.info(f"Failed to check @{copilot_assignee}, assigning to repository owner @{owner}. Error: {e}")
|
828
|
+
elif fallback_strategy == "default_assignees":
|
829
|
+
default_assignees = github_config.get('default_assignees', [])
|
830
|
+
assignees_to_use = default_assignees if default_assignees else [owner]
|
831
|
+
self.logger.info(f"Failed to check @{copilot_assignee}, using default assignees: {assignees_to_use}. Error: {e}")
|
832
|
+
else: # fallback_strategy == "none"
|
833
|
+
assignees_to_use = []
|
834
|
+
self.logger.info(f"Failed to check @{copilot_assignee}, no assignee set. Error: {e}")
|
835
|
+
elif auto_assign_when_empty:
|
836
|
+
# Auto-assign but don't prefer Copilot
|
837
|
+
if fallback_strategy == "owner":
|
800
838
|
assignees_to_use = [owner]
|
801
|
-
self.logger.info(f"No assignees provided
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
839
|
+
self.logger.info(f"No assignees provided - auto-assigning to repository owner @{owner}")
|
840
|
+
elif fallback_strategy == "default_assignees":
|
841
|
+
default_assignees = github_config.get('default_assignees', [])
|
842
|
+
assignees_to_use = default_assignees if default_assignees else [owner]
|
843
|
+
self.logger.info(f"No assignees provided - using default assignees: {assignees_to_use}")
|
844
|
+
else: # fallback_strategy == "none"
|
845
|
+
assignees_to_use = []
|
846
|
+
self.logger.info("No assignees provided - no auto-assignment configured")
|
847
|
+
else:
|
848
|
+
assignees_to_use = []
|
849
|
+
self.logger.info("No assignees provided - auto-assignment disabled")
|
806
850
|
|
807
851
|
if assignees_to_use:
|
808
852
|
assignees_str = ",".join(assignees_to_use)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
diagram_to_iac/__init__.py,sha256=gQanRC5O_7AMB-NQFEEd-MU0GICa-dBsgvcJgquKBfs,1427
|
2
2
|
diagram_to_iac/cli.py,sha256=uumG1frF42eCkdLIZxyxQB1x6lDwtG-qKL4vcHnLLXY,400
|
3
|
-
diagram_to_iac/config.yaml,sha256=
|
3
|
+
diagram_to_iac/config.yaml,sha256=w_XxgZgl-Esjp25bXJDD_LSYXBL-95t2reO4hzjheRI,7936
|
4
4
|
diagram_to_iac/r2d.py,sha256=I7XSuUtu8TdvAhK4tCMLc3U_3ZtP7DJGfq168aeI3Mk,13208
|
5
5
|
diagram_to_iac/actions/__init__.py,sha256=P1CjjY4FYUA0Tcx8FQNLYYSI9fhv8yKd_TmRGtmhW50,229
|
6
6
|
diagram_to_iac/actions/git_entry.py,sha256=mhY6gYquUPVvyvnTC2S90z_uXEe1asqWLoi1989aB_Q,5403
|
@@ -57,7 +57,7 @@ diagram_to_iac/tools/api_utils.py,sha256=c3nOK3eZdUuik5IVvMyGIEG-3oILnyOVd-RubtP
|
|
57
57
|
diagram_to_iac/tools/sec_utils.py,sha256=Zzb-I3_qZblv0nIEm4TO0xQCga3Phq44SOGx1ga_wOc,12463
|
58
58
|
diagram_to_iac/tools/text_utils.py,sha256=cnwOXWndd1QAlZC4zOO9jtF3_j4xozDLUTfzfJE9wWQ,9959
|
59
59
|
diagram_to_iac/tools/git/__init__.py,sha256=1V3_Kg_KzQ6er60N-1hqQeigkV8c4AvYq-R60_xmQ4o,1316
|
60
|
-
diagram_to_iac/tools/git/git.py,sha256=
|
60
|
+
diagram_to_iac/tools/git/git.py,sha256=0kENjsjTT_DlHltSESW1NnBxZ5zTy2JWPOvw9DzSMRc,51317
|
61
61
|
diagram_to_iac/tools/git/git_config.yaml,sha256=ekww9EEZigEfZBv-HNSEYP__SDT61yOdBQ0u-Lhquv0,4272
|
62
62
|
diagram_to_iac/tools/hello/__init__.py,sha256=f6GpkiQxvuGaRMm34yQilGACxUI4c5edJQTDjZtskjQ,891
|
63
63
|
diagram_to_iac/tools/hello/cal_utils.py,sha256=B-0iOJHNL1IgYPlWUdrAwEf1r9LUKBAnGyx1xQz05ZE,1507
|
@@ -74,8 +74,8 @@ diagram_to_iac/tools/shell/shell.py,sha256=ZOJ7Vo3l_R2Gm6Ml2FL0RX__-C_JOsUrLJVvB
|
|
74
74
|
diagram_to_iac/tools/shell/shell_config.yaml,sha256=9mV1mpOD9mwOx50TXF-ACafeJmBSZaqPo4v-TQxB5U4,1722
|
75
75
|
diagram_to_iac/tools/tf/terraform.py,sha256=j1boWRo6JKpNGf1OwnWoWboO0gMYTizCOHDSxozoFZw,37343
|
76
76
|
diagram_to_iac/tools/tf/terraform_config.yaml,sha256=Mj5rp5hwLLZ3VmKIqwnjoKvPlaA20OX5plH40DfGG7k,610
|
77
|
-
diagram_to_iac-1.
|
78
|
-
diagram_to_iac-1.
|
79
|
-
diagram_to_iac-1.
|
80
|
-
diagram_to_iac-1.
|
81
|
-
diagram_to_iac-1.
|
77
|
+
diagram_to_iac-1.9.0.dist-info/METADATA,sha256=dnmZu8V4EyjxG51CF1yHOXLJ2B7jgj32hynd_wJS0TQ,10689
|
78
|
+
diagram_to_iac-1.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
79
|
+
diagram_to_iac-1.9.0.dist-info/entry_points.txt,sha256=DfGCnmgWWGHtQpqU8VqcUWs5k_be-bfO67z1vOuTitA,277
|
80
|
+
diagram_to_iac-1.9.0.dist-info/top_level.txt,sha256=k1cV0YODiCUU46qlmbQaquMcbMXhNm05NZLxsinDUBA,15
|
81
|
+
diagram_to_iac-1.9.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|