pull-request-fixer 0.1.3__tar.gz → 0.1.4__tar.gz

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.
Files changed (23) hide show
  1. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/PKG-INFO +15 -15
  2. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/README.md +11 -11
  3. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/pyproject.toml +10 -6
  4. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/_version.py +2 -2
  5. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/cli.py +16 -13
  6. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/pr_file_fixer.py +2 -2
  7. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/pr_scanner.py +6 -2
  8. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/.gitignore +0 -0
  9. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/.pre-commit-hooks.yaml +0 -0
  10. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/LICENSE +0 -0
  11. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/LICENSES/Apache-2.0.txt +0 -0
  12. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/scripts/README.md +0 -0
  13. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/__init__.py +0 -0
  14. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/blocked_pr_scanner.py +0 -0
  15. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/exceptions.py +0 -0
  16. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/file_fixer.py +0 -0
  17. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/git_config.py +0 -0
  18. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/github_client.py +0 -0
  19. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/graphql_queries.py +0 -0
  20. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/models.py +0 -0
  21. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/pr_fixer.py +0 -0
  22. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/progress_tracker.py +0 -0
  23. {pull_request_fixer-0.1.3 → pull_request_fixer-0.1.4}/src/pull_request_fixer/py.typed +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pull-request-fixer
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Pull request formatter and fixer with GitHub integration
5
- Project-URL: Homepage, https://github.com/lfit/pull-request-fixer
6
- Project-URL: Repository, https://github.com/lfit/pull-request-fixer.git
7
- Project-URL: Bug Tracker, https://github.com/lfit/pull-request-fixer/issues
5
+ Project-URL: Homepage, https://github.com/lfreleng-actions/pull-request-fixer
6
+ Project-URL: Repository, https://github.com/lfreleng-actions/pull-request-fixer.git
7
+ Project-URL: Bug Tracker, https://github.com/lfreleng-actions/pull-request-fixer/issues
8
8
  Author-email: The Linux Foundation <releng@linuxfoundation.org>
9
9
  License: Apache-2.0
10
10
  License-File: LICENSE
@@ -347,7 +347,7 @@ Automatically fixed pull request metadata:
347
347
  - **Pull request body** updated to match commit message
348
348
 
349
349
  ---
350
- *This fix was automatically applied by [pull-request-fixer](https://github.com/lfit/pull-request-fixer)*
350
+ *This fix was automatically applied by [pull-request-fixer](https://github.com/lfreleng-actions/pull-request-fixer)*
351
351
  ```
352
352
 
353
353
  The comment includes the items that changed. For
@@ -617,7 +617,7 @@ If updates fail:
617
617
  ### Setup
618
618
 
619
619
  ```bash
620
- git clone https://github.com/lfit/pull-request-fixer.git
620
+ git clone https://github.com/lfreleng-actions/pull-request-fixer.git
621
621
  cd pull-request-fixer
622
622
  uv venv
623
623
  source .venv/bin/activate
@@ -663,24 +663,24 @@ Apache-2.0
663
663
  ## Support
664
664
 
665
665
  - **Issues**:
666
- <https://github.com/lfit/pull-request-fixer/issues>
666
+ <https://github.com/lfreleng-actions/pull-request-fixer/issues>
667
667
  - **Documentation**:
668
- <https://github.com/lfit/pull-request-fixer/blob/main/IMPLEMENTATION.md>
668
+ <https://github.com/lfreleng-actions/pull-request-fixer/blob/main/IMPLEMENTATION.md>
669
669
  - **Changelog**:
670
- <https://github.com/lfit/pull-request-fixer/blob/main/CHANGELOG.md>
670
+ <https://github.com/lfreleng-actions/pull-request-fixer/blob/main/CHANGELOG.md>
671
671
 
672
672
  ## Related Projects
673
673
 
674
674
  - [dependamerge](https://github.com/lfit/dependamerge) - Automatically merge
675
675
  automation PRs
676
- - [markdown-table-fixer](https://github.com/lfit/markdown-table-fixer) - Fix
677
- markdown table formatting
676
+ - [markdown-table-fixer][mtf-repo] - Fix markdown table formatting
678
677
 
679
678
  ## Acknowledgments
680
679
 
681
680
  This project uses patterns from:
682
681
 
683
- - [dependamerge](https://github.com/lfit/dependamerge) for efficient GitHub
684
- organization scanning
685
- - [markdown-table-fixer](https://github.com/lfit/markdown-table-fixer) for
686
- the initial codebase structure
682
+ - [dependamerge](https://github.com/lfit/dependamerge) for efficient
683
+ GitHub organization scanning
684
+ - [markdown-table-fixer][mtf-repo] for the initial codebase structure
685
+
686
+ [mtf-repo]: https://github.com/lfreleng-actions/markdown-table-fixer
@@ -305,7 +305,7 @@ Automatically fixed pull request metadata:
305
305
  - **Pull request body** updated to match commit message
306
306
 
307
307
  ---
308
- *This fix was automatically applied by [pull-request-fixer](https://github.com/lfit/pull-request-fixer)*
308
+ *This fix was automatically applied by [pull-request-fixer](https://github.com/lfreleng-actions/pull-request-fixer)*
309
309
  ```
310
310
 
311
311
  The comment includes the items that changed. For
@@ -575,7 +575,7 @@ If updates fail:
575
575
  ### Setup
576
576
 
577
577
  ```bash
578
- git clone https://github.com/lfit/pull-request-fixer.git
578
+ git clone https://github.com/lfreleng-actions/pull-request-fixer.git
579
579
  cd pull-request-fixer
580
580
  uv venv
581
581
  source .venv/bin/activate
@@ -621,24 +621,24 @@ Apache-2.0
621
621
  ## Support
622
622
 
623
623
  - **Issues**:
624
- <https://github.com/lfit/pull-request-fixer/issues>
624
+ <https://github.com/lfreleng-actions/pull-request-fixer/issues>
625
625
  - **Documentation**:
626
- <https://github.com/lfit/pull-request-fixer/blob/main/IMPLEMENTATION.md>
626
+ <https://github.com/lfreleng-actions/pull-request-fixer/blob/main/IMPLEMENTATION.md>
627
627
  - **Changelog**:
628
- <https://github.com/lfit/pull-request-fixer/blob/main/CHANGELOG.md>
628
+ <https://github.com/lfreleng-actions/pull-request-fixer/blob/main/CHANGELOG.md>
629
629
 
630
630
  ## Related Projects
631
631
 
632
632
  - [dependamerge](https://github.com/lfit/dependamerge) - Automatically merge
633
633
  automation PRs
634
- - [markdown-table-fixer](https://github.com/lfit/markdown-table-fixer) - Fix
635
- markdown table formatting
634
+ - [markdown-table-fixer][mtf-repo] - Fix markdown table formatting
636
635
 
637
636
  ## Acknowledgments
638
637
 
639
638
  This project uses patterns from:
640
639
 
641
- - [dependamerge](https://github.com/lfit/dependamerge) for efficient GitHub
642
- organization scanning
643
- - [markdown-table-fixer](https://github.com/lfit/markdown-table-fixer) for
644
- the initial codebase structure
640
+ - [dependamerge](https://github.com/lfit/dependamerge) for efficient
641
+ GitHub organization scanning
642
+ - [markdown-table-fixer][mtf-repo] for the initial codebase structure
643
+
644
+ [mtf-repo]: https://github.com/lfreleng-actions/markdown-table-fixer
@@ -53,9 +53,9 @@ dev = [
53
53
  ]
54
54
 
55
55
  [project.urls]
56
- Homepage = "https://github.com/lfit/pull-request-fixer"
57
- Repository = "https://github.com/lfit/pull-request-fixer.git"
58
- "Bug Tracker" = "https://github.com/lfit/pull-request-fixer/issues"
56
+ Homepage = "https://github.com/lfreleng-actions/pull-request-fixer"
57
+ Repository = "https://github.com/lfreleng-actions/pull-request-fixer.git"
58
+ "Bug Tracker" = "https://github.com/lfreleng-actions/pull-request-fixer/issues"
59
59
 
60
60
  [project.scripts]
61
61
  pull-request-fixer = "pull_request_fixer.cli:cli"
@@ -233,13 +233,11 @@ markers = [
233
233
  ]
234
234
 
235
235
  [tool.coverage.run]
236
- source = ["src/pull_request_fixer"]
236
+ source = ["pull_request_fixer"]
237
237
  omit = [
238
238
  "*/tests/*",
239
239
  "*/test_*",
240
240
  "*/__pycache__/*",
241
- "*/venv/*",
242
- "*/.venv/*",
243
241
  ]
244
242
 
245
243
  [tool.coverage.report]
@@ -255,3 +253,9 @@ exclude_lines = [
255
253
  "class .*\\bProtocol\\):",
256
254
  "@(abc\\.)?abstractmethod",
257
255
  ]
256
+
257
+ [tool.uv]
258
+ # Supply-chain cooldown: do not resolve anything published in the last
259
+ # 7 days (rolling window; uv records it as a relative span in uv.lock).
260
+ # Requires uv >= 0.9.17 for the relative-duration ("7 days") form.
261
+ exclude-newer = "7 days"
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.1.3'
22
- __version_tuple__ = version_tuple = (0, 1, 3)
21
+ __version__ = version = '0.1.4'
22
+ __version_tuple__ = version_tuple = (0, 1, 4)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -11,6 +11,7 @@ import logging
11
11
  import re
12
12
  import sys
13
13
  from typing import Any
14
+ from urllib.parse import urlparse
14
15
 
15
16
  from dependamerge import get_default_workers
16
17
  from rich.console import Console
@@ -91,15 +92,19 @@ def parse_target(target: str) -> tuple[str, str]:
91
92
  # It's a specific PR URL
92
93
  return ("pr", target)
93
94
 
94
- # Check if it's a GitHub URL
95
- if "github.com" in target:
96
- # Extract org from URL: https://github.com/ORG or https://github.com/ORG/...
97
- parts = target.split("github.com/")
98
- if len(parts) > 1:
99
- # Get the part after github.com/
100
- path = parts[1]
101
- # Split by / and take first part (the org)
102
- org = path.split("/")[0]
95
+ # Check if it's a GitHub URL by parsing it and validating the host.
96
+ # A substring check such as ``"github.com" in target`` is unsafe because
97
+ # a host like ``github.com.evil.example`` would also match, so parse the
98
+ # URL and compare the hostname against an explicit allowlist of the
99
+ # GitHub web hosts. URLs without a scheme (e.g. ``github.com/org``) are
100
+ # treated as network-path references for parsing.
101
+ parse_input = target if "://" in target else f"//{target}"
102
+ parsed = urlparse(parse_input)
103
+ hostname = (parsed.hostname or "").lower()
104
+ if hostname in ("github.com", "www.github.com"):
105
+ # Extract org from the URL path: /ORG or /ORG/...
106
+ org = parsed.path.lstrip("/").split("/")[0]
107
+ if org:
103
108
  return ("org", org)
104
109
 
105
110
  # Not a URL, return as organization
@@ -1715,8 +1720,7 @@ async def create_pr_comment(
1715
1720
  [
1716
1721
  "",
1717
1722
  "---",
1718
- "*This fix was automatically applied by "
1719
- "[pull-request-fixer](https://github.com/lfit/pull-request-fixer)*",
1723
+ "*This fix was automatically applied by [pull-request-fixer](https://github.com/lfreleng-actions/pull-request-fixer)*",
1720
1724
  ]
1721
1725
  )
1722
1726
 
@@ -1828,8 +1832,7 @@ async def create_file_fix_comment(
1828
1832
  lines.extend(
1829
1833
  [
1830
1834
  "---",
1831
- "*This fix was automatically applied by "
1832
- "[pull-request-fixer](https://github.com/lfit/pull-request-fixer)*",
1835
+ "*This fix was automatically applied by [pull-request-fixer](https://github.com/lfreleng-actions/pull-request-fixer)*",
1833
1836
  ]
1834
1837
  )
1835
1838
 
@@ -504,7 +504,7 @@ class PRFileFixer:
504
504
  f"The commit has been amended with the fixes.\n\n"
505
505
  f"---\n"
506
506
  f"*Automatically fixed by [pull-request-fixer]"
507
- f"(https://github.com/lfit/pull-request-fixer)*"
507
+ f"(https://github.com/lfreleng-actions/pull-request-fixer)*"
508
508
  )
509
509
 
510
510
  with suppress(Exception):
@@ -857,7 +857,7 @@ class PRFileFixer:
857
857
  f"Changes applied via GitHub API.\n\n"
858
858
  f"---\n"
859
859
  f"*Automatically fixed by [pull-request-fixer]"
860
- f"(https://github.com/lfit/pull-request-fixer)*"
860
+ f"(https://github.com/lfreleng-actions/pull-request-fixer)*"
861
861
  )
862
862
 
863
863
  try:
@@ -284,8 +284,12 @@ class PRScanner:
284
284
  break
285
285
  yield item
286
286
  finally:
287
- # Ensure producer completes
288
- await producer_task
287
+ # Ensure the producer task completes and surface any exception it
288
+ # raised. ``gather`` wraps the single task so the cleanup is an
289
+ # explicit call expression: a bare ``await producer_task`` is
290
+ # functionally equivalent but CodeQL reports it as a statement
291
+ # with no effect.
292
+ await asyncio.gather(producer_task)
289
293
 
290
294
  async def _iter_org_repositories_with_open_prs(
291
295
  self, organization: str