autopkg-wrapper 2025.6.1__py3-none-any.whl → 2025.8.1__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.
- autopkg_wrapper/autopkg_wrapper.py +11 -3
- autopkg_wrapper/utils/args.py +5 -0
- autopkg_wrapper/utils/git_functions.py +49 -0
- {autopkg_wrapper-2025.6.1.dist-info → autopkg_wrapper-2025.8.1.dist-info}/METADATA +9 -9
- autopkg_wrapper-2025.8.1.dist-info/RECORD +13 -0
- autopkg_wrapper-2025.6.1.dist-info/RECORD +0 -13
- {autopkg_wrapper-2025.6.1.dist-info → autopkg_wrapper-2025.8.1.dist-info}/WHEEL +0 -0
- {autopkg_wrapper-2025.6.1.dist-info → autopkg_wrapper-2025.8.1.dist-info}/entry_points.txt +0 -0
- {autopkg_wrapper-2025.6.1.dist-info → autopkg_wrapper-2025.8.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -356,6 +356,8 @@ def main():
|
|
|
356
356
|
args=args,
|
|
357
357
|
)
|
|
358
358
|
|
|
359
|
+
failed_recipes = []
|
|
360
|
+
|
|
359
361
|
for recipe in recipe_list:
|
|
360
362
|
logging.info(f"Processing Recipe: {recipe.name}")
|
|
361
363
|
process_recipe(
|
|
@@ -373,12 +375,18 @@ def main():
|
|
|
373
375
|
recipe=recipe, token=args.slack_token
|
|
374
376
|
) if args.slack_token else None
|
|
375
377
|
|
|
378
|
+
if recipe.error or recipe.results.get("failed"):
|
|
379
|
+
failed_recipes.append(recipe)
|
|
380
|
+
|
|
376
381
|
recipe.pr_url = (
|
|
377
382
|
git.create_pull_request(git_info=override_repo_info, recipe=recipe)
|
|
378
383
|
if args.create_pr
|
|
379
384
|
else None
|
|
380
385
|
)
|
|
381
386
|
|
|
382
|
-
|
|
383
|
-
if
|
|
384
|
-
|
|
387
|
+
# Create GitHub issue for failed recipes
|
|
388
|
+
if args.create_issues and failed_recipes and args.github_token:
|
|
389
|
+
issue_url = git.create_issue_for_failed_recipes(
|
|
390
|
+
git_info=override_repo_info, failed_recipes=failed_recipes
|
|
391
|
+
)
|
|
392
|
+
logging.info(f"Created GitHub issue for failed recipes: {issue_url}")
|
autopkg_wrapper/utils/args.py
CHANGED
|
@@ -113,6 +113,11 @@ def setup_args():
|
|
|
113
113
|
action="store_true",
|
|
114
114
|
help="If enabled, autopkg_wrapper will open a PR for updated trust information",
|
|
115
115
|
)
|
|
116
|
+
parser.add_argument(
|
|
117
|
+
"--create-issues",
|
|
118
|
+
action="store_true",
|
|
119
|
+
help="Create a GitHub issue for recipes that fail during processing",
|
|
120
|
+
)
|
|
116
121
|
parser.add_argument(
|
|
117
122
|
"--overrides-repo-path",
|
|
118
123
|
default=os.getenv("AW_OVERRIDES_REPO_PATH", None),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import subprocess
|
|
3
|
+
from datetime import datetime
|
|
3
4
|
|
|
4
5
|
from github import Github
|
|
5
6
|
|
|
@@ -109,3 +110,51 @@ Please review and merge the updated trust information for this override.
|
|
|
109
110
|
|
|
110
111
|
logging.debug(f"PR URL: {pr_url}")
|
|
111
112
|
return pr_url
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def create_issue_for_failed_recipes(git_info, failed_recipes):
|
|
116
|
+
"""
|
|
117
|
+
Creates a GitHub issue listing all recipes that failed during the run.
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
git_info (dict): Dictionary containing Git repository information
|
|
121
|
+
failed_recipes (list): List of Recipe objects that failed during processing
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
str: URL of the created GitHub issue, or None if no issue was created
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
if not failed_recipes:
|
|
128
|
+
logging.debug("No failed recipes to report")
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
g = Github(git_info["github_token"])
|
|
132
|
+
repo = g.get_repo(git_info["override_repo_remote_ref"])
|
|
133
|
+
|
|
134
|
+
# Create issue title and body
|
|
135
|
+
current_date = datetime.now().strftime("%Y-%m-%d")
|
|
136
|
+
title = f"AutoPkg Recipe Failures - {current_date}"
|
|
137
|
+
|
|
138
|
+
body = "## Recipe Failure Details:\n\n"
|
|
139
|
+
for recipe in failed_recipes:
|
|
140
|
+
body += f"#### {recipe.name}\n"
|
|
141
|
+
|
|
142
|
+
if recipe.results.get("failed"):
|
|
143
|
+
for failure in recipe.results.get("failed", []):
|
|
144
|
+
body += f"- {failure.get('message', 'Unknown error')}\n"
|
|
145
|
+
|
|
146
|
+
body += "\n"
|
|
147
|
+
|
|
148
|
+
body += "\nThis issue was automatically generated by autopkg-wrapper."
|
|
149
|
+
|
|
150
|
+
# Create the issue
|
|
151
|
+
issue = repo.create_issue(
|
|
152
|
+
title=title,
|
|
153
|
+
body=body,
|
|
154
|
+
labels=["autopkg-failure"],
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
issue_url = f"{git_info['override_repo_url']}/issues/{issue.number}"
|
|
158
|
+
logging.debug(f"Issue URL: {issue_url}")
|
|
159
|
+
|
|
160
|
+
return issue_url
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autopkg-wrapper
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.8.1
|
|
4
4
|
Summary: A package used to execute some autopkg functions, primarily within the context of a GitHub Actions runner.
|
|
5
5
|
Project-URL: Repository, https://github.com/smithjw/autopkg-wrapper
|
|
6
6
|
Author-email: James Smith <james@smithjw.me>
|
|
7
7
|
License-Expression: BSD-3-Clause
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Python: ~=3.12
|
|
10
|
-
Requires-Dist: chardet
|
|
11
|
-
Requires-Dist: idna
|
|
12
|
-
Requires-Dist: pygithub
|
|
13
|
-
Requires-Dist: requests
|
|
14
|
-
Requires-Dist: ruamel-yaml
|
|
15
|
-
Requires-Dist: toml
|
|
16
|
-
Requires-Dist: urllib3
|
|
9
|
+
Requires-Python: ~=3.12.0
|
|
10
|
+
Requires-Dist: chardet
|
|
11
|
+
Requires-Dist: idna
|
|
12
|
+
Requires-Dist: pygithub
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Requires-Dist: ruamel-yaml
|
|
15
|
+
Requires-Dist: toml
|
|
16
|
+
Requires-Dist: urllib3
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
19
19
|
# autopkg-wrapper
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
autopkg_wrapper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
autopkg_wrapper/autopkg_wrapper.py,sha256=dF8BGhk1IpP4w6lRtJqgpY-VK9vkoOiD0jidIUaSn9M,13457
|
|
3
|
+
autopkg_wrapper/notifier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
autopkg_wrapper/notifier/slack.py,sha256=aPxQDGd5zPxSsu3mEqalNOF0ly0QnYog0ieHokd5-OY,1979
|
|
5
|
+
autopkg_wrapper/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
autopkg_wrapper/utils/args.py,sha256=6sghB9DWZmv7VLUR9uJA5WkhxsZ08Ri1qoUY5rxydjY,4883
|
|
7
|
+
autopkg_wrapper/utils/git_functions.py,sha256=Ojsq-wQsw7Gezq9pYDTtXF9SxrK9b9Cfap3mbJyVgdw,4456
|
|
8
|
+
autopkg_wrapper/utils/logging.py,sha256=3knpMViO_zAU8WM5bSImQaz5M01vMFk_raB4lt1cbvo,324
|
|
9
|
+
autopkg_wrapper-2025.8.1.dist-info/METADATA,sha256=v97bxd_6_vj97C7Av4hl7vCXgUBWu-SHIKmn-QGDLMc,2527
|
|
10
|
+
autopkg_wrapper-2025.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
autopkg_wrapper-2025.8.1.dist-info/entry_points.txt,sha256=TVIcOt7OozzX1c00pwMGbBysaHg_v_N3mO3juoFqPpo,73
|
|
12
|
+
autopkg_wrapper-2025.8.1.dist-info/licenses/LICENSE,sha256=PpNOQjZGcsKFuA0wU16YU7PueVxqPX4OnyZ7TlLQlq4,1602
|
|
13
|
+
autopkg_wrapper-2025.8.1.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
autopkg_wrapper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
autopkg_wrapper/autopkg_wrapper.py,sha256=FGZW6o9V-YHlh521BesRstWo-wKg94L5uhylV6KoGAM,13042
|
|
3
|
-
autopkg_wrapper/notifier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
autopkg_wrapper/notifier/slack.py,sha256=aPxQDGd5zPxSsu3mEqalNOF0ly0QnYog0ieHokd5-OY,1979
|
|
5
|
-
autopkg_wrapper/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
autopkg_wrapper/utils/args.py,sha256=sWZgTL4c4MSC8k33tH7RIp_TQxQFcaIUmQo5MMoA_sY,4718
|
|
7
|
-
autopkg_wrapper/utils/git_functions.py,sha256=LIQ3SEnPOn1srGrhQuR1pVeurupJXDVaAsmO3pjcRwc,2989
|
|
8
|
-
autopkg_wrapper/utils/logging.py,sha256=3knpMViO_zAU8WM5bSImQaz5M01vMFk_raB4lt1cbvo,324
|
|
9
|
-
autopkg_wrapper-2025.6.1.dist-info/METADATA,sha256=WsZ3Vc2D_UU2XknijbgVpBYatMWgvBunJnoeQq0Sn78,2552
|
|
10
|
-
autopkg_wrapper-2025.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
-
autopkg_wrapper-2025.6.1.dist-info/entry_points.txt,sha256=TVIcOt7OozzX1c00pwMGbBysaHg_v_N3mO3juoFqPpo,73
|
|
12
|
-
autopkg_wrapper-2025.6.1.dist-info/licenses/LICENSE,sha256=PpNOQjZGcsKFuA0wU16YU7PueVxqPX4OnyZ7TlLQlq4,1602
|
|
13
|
-
autopkg_wrapper-2025.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|