pyrig-codeql 2.1.0__tar.gz → 3.0.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.
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/PKG-INFO +3 -2
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/README.md +2 -1
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/pyproject.toml +1 -1
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/pyproject.toml.orig +1 -1
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/configs/version_control/remote/code_analyzer.py +6 -3
- pyrig_codeql-2.1.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/codeql.py → pyrig_codeql-3.0.4/src/pyrig_codeql/rig/configs/version_control/remote/workflows/code_analysis.py +7 -7
- pyrig_codeql-3.0.4/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py +37 -0
- pyrig_codeql-3.0.4/src/pyrig_codeql/rig/tools/__init__.py +1 -0
- pyrig_codeql-3.0.4/src/pyrig_codeql/rig/tools/security/__init__.py +1 -0
- pyrig_codeql-3.0.4/src/pyrig_codeql/rig/tools/security/code.py +34 -0
- pyrig_codeql-2.1.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py +0 -37
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/LICENSE +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/__init__.py +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/py.typed +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/__init__.py +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/configs/__init__.py +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/configs/version_control/__init__.py +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/configs/version_control/remote/__init__.py +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/configs/version_control/remote/workflows/__init__.py +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/resources/ACTION_CODEQL_ANALYZE +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/resources/ACTION_CODEQL_INIT +0 -0
- {pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/resources/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyrig-codeql
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.4
|
|
4
4
|
Summary: A pyrig plugin that integrates GitHub CodeQL.
|
|
5
5
|
Keywords: pyrig
|
|
6
6
|
Author: Winipedia
|
|
@@ -37,6 +37,7 @@ Description-Content-Type: text/markdown
|
|
|
37
37
|
[](https://github.com/rhysd/actionlint)
|
|
38
38
|
[](https://github.com/zizmorcore/zizmor)
|
|
39
39
|
[](https://prek.j178.dev/reference/built-in-hooks/#check-case-conflict)
|
|
40
|
+
[](https://codeql.github.com/docs/)
|
|
40
41
|
[](https://github.com/jendrikseipp/vulture)
|
|
41
42
|
[](https://github.com/osprey-oss/deptry)
|
|
42
43
|
[](https://prek.j178.dev/reference/built-in-hooks/#end-of-file-fixer)
|
|
@@ -76,6 +77,7 @@ Description-Content-Type: text/markdown
|
|
|
76
77
|
> A pyrig plugin that integrates GitHub CodeQL.
|
|
77
78
|
|
|
78
79
|
---
|
|
80
|
+
|
|
79
81
|
## Overview
|
|
80
82
|
|
|
81
83
|
`pyrig-codeql` is a [pyrig](https://github.com/Winipedia/pyrig) plugin that adds
|
|
@@ -106,4 +108,3 @@ The plugin requires Python 3.12 or newer.
|
|
|
106
108
|
|
|
107
109
|
Full documentation, including the auto-generated API reference, is available on
|
|
108
110
|
the [documentation site](https://Winipedia.github.io/pyrig-codeql).
|
|
109
|
-
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
[](https://github.com/rhysd/actionlint)
|
|
11
11
|
[](https://github.com/zizmorcore/zizmor)
|
|
12
12
|
[](https://prek.j178.dev/reference/built-in-hooks/#check-case-conflict)
|
|
13
|
+
[](https://codeql.github.com/docs/)
|
|
13
14
|
[](https://github.com/jendrikseipp/vulture)
|
|
14
15
|
[](https://github.com/osprey-oss/deptry)
|
|
15
16
|
[](https://prek.j178.dev/reference/built-in-hooks/#end-of-file-fixer)
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
> A pyrig plugin that integrates GitHub CodeQL.
|
|
50
51
|
|
|
51
52
|
---
|
|
53
|
+
|
|
52
54
|
## Overview
|
|
53
55
|
|
|
54
56
|
`pyrig-codeql` is a [pyrig](https://github.com/Winipedia/pyrig) plugin that adds
|
|
@@ -79,4 +81,3 @@ The plugin requires Python 3.12 or newer.
|
|
|
79
81
|
|
|
80
82
|
Full documentation, including the auto-generated API reference, is available on
|
|
81
83
|
the [documentation site](https://Winipedia.github.io/pyrig-codeql).
|
|
82
|
-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""CodeQL configuration
|
|
1
|
+
"""CodeQL-specific configuration for source code analysis."""
|
|
2
2
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import Any, override
|
|
@@ -9,11 +9,14 @@ from pyrig.rig.tools.version_control.remote.controller import (
|
|
|
9
9
|
RemoteVersionController,
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
+
from pyrig_codeql.rig.tools.security.code import CodeAnalyzer
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
class CodeAnalyzerConfigFile(YMLDictConfigFile):
|
|
14
16
|
"""Configuration consumed by the CodeQL `init` action's `config-file` input.
|
|
15
17
|
|
|
16
|
-
Manages `.github/codeql.yml
|
|
18
|
+
Manages the CodeQL-specific `.github/codeql.yml` file, including the query
|
|
19
|
+
suite and ignored paths.
|
|
17
20
|
"""
|
|
18
21
|
|
|
19
22
|
@override
|
|
@@ -24,7 +27,7 @@ class CodeAnalyzerConfigFile(YMLDictConfigFile):
|
|
|
24
27
|
@override
|
|
25
28
|
def stem(self) -> str:
|
|
26
29
|
"""Return `'codeql'`."""
|
|
27
|
-
return
|
|
30
|
+
return CodeAnalyzer.I.name()
|
|
28
31
|
|
|
29
32
|
@override
|
|
30
33
|
def _configs(self) -> dict[str, Any]:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Reusable
|
|
1
|
+
"""Reusable code analysis and code-scanning alert gate."""
|
|
2
2
|
|
|
3
3
|
from collections.abc import Callable
|
|
4
4
|
from typing import Any, override
|
|
@@ -12,19 +12,19 @@ from pyrig_codeql.rig.configs.version_control.remote.code_analyzer import (
|
|
|
12
12
|
)
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class CodeAnalysisWorkflowConfigFile(WorkflowConfigFile):
|
|
16
16
|
"""Analyze Python and GitHub Actions code and fail on open CodeQL alerts."""
|
|
17
17
|
|
|
18
|
-
@override
|
|
19
|
-
def stem(self) -> str:
|
|
20
|
-
"""Return the workflow filename stem."""
|
|
21
|
-
return "codeql"
|
|
22
|
-
|
|
23
18
|
@override
|
|
24
19
|
def jobs(self) -> tuple[Callable[[], dict[str, Any]], ...]:
|
|
25
20
|
"""Return the analysis and alert-gate jobs."""
|
|
26
21
|
return (self.job_analyze, self.job_check_alerts)
|
|
27
22
|
|
|
23
|
+
@override
|
|
24
|
+
def stem(self) -> str:
|
|
25
|
+
"""Return the workflow filename stem."""
|
|
26
|
+
return "code-analysis"
|
|
27
|
+
|
|
28
28
|
@override
|
|
29
29
|
def workflow_triggers(self) -> dict[str, Any]:
|
|
30
30
|
"""Allow invocation only through a reusable-workflow call."""
|
pyrig_codeql-3.0.4/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Health check workflow extended with code analysis and an open-alert gate."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any, override
|
|
5
|
+
|
|
6
|
+
from pyrig.rig.configs.version_control.remote.workflows.health_check import (
|
|
7
|
+
HealthCheckWorkflowConfigFile as BaseHealthCheckWorkflowConfigFile,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from pyrig_codeql.rig.configs.version_control.remote.workflows.code_analysis import (
|
|
11
|
+
CodeAnalysisWorkflowConfigFile,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class HealthCheckWorkflowConfigFile(BaseHealthCheckWorkflowConfigFile):
|
|
16
|
+
"""Include the reusable code-analysis workflow in the health check."""
|
|
17
|
+
|
|
18
|
+
@override
|
|
19
|
+
def jobs_health_check(self) -> tuple[Callable[[], dict[str, Any]], ...]:
|
|
20
|
+
"""Return the base health-check jobs followed by the code-analysis call."""
|
|
21
|
+
return (
|
|
22
|
+
*super().jobs_health_check(),
|
|
23
|
+
self.job_code_analysis,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def job_code_analysis(self) -> dict[str, Any]:
|
|
27
|
+
"""Call the reusable code-analysis workflow."""
|
|
28
|
+
return self.job(
|
|
29
|
+
self.job_code_analysis,
|
|
30
|
+
uses=CodeAnalysisWorkflowConfigFile.I.workflow_call_reference(),
|
|
31
|
+
permissions=self.job_code_analysis_permissions() or None,
|
|
32
|
+
secrets=CodeAnalysisWorkflowConfigFile.I.used_secrets_mapping() or None,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def job_code_analysis_permissions(self) -> dict[str, str]:
|
|
36
|
+
"""Return permissions required by the reusable code-analysis workflow."""
|
|
37
|
+
return CodeAnalysisWorkflowConfigFile.I.used_permissions()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""CodeQL tool integrations."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Tool wrappers for code-security analysis."""
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""CodeQL tool identity and code-analysis badge metadata."""
|
|
2
|
+
|
|
3
|
+
from typing import override
|
|
4
|
+
|
|
5
|
+
from pyrig.rig.tools.base.tool import Group, Tool
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CodeAnalyzer(Tool):
|
|
9
|
+
"""Represent CodeQL, which runs through GitHub Actions."""
|
|
10
|
+
|
|
11
|
+
@override
|
|
12
|
+
def dev_dependencies(self) -> tuple[str, ...]:
|
|
13
|
+
"""Return no dev dependencies because CodeQL runs in GitHub Actions."""
|
|
14
|
+
return ()
|
|
15
|
+
|
|
16
|
+
@override
|
|
17
|
+
def group(self) -> str:
|
|
18
|
+
"""Return `Group.CODE_QUALITY`."""
|
|
19
|
+
return Group.CODE_QUALITY
|
|
20
|
+
|
|
21
|
+
@override
|
|
22
|
+
def image_url(self) -> str:
|
|
23
|
+
"""Return a badge identifying CodeQL as the project's code analyzer."""
|
|
24
|
+
return "https://img.shields.io/badge/code%20analysis-CodeQL-181717?logo=github"
|
|
25
|
+
|
|
26
|
+
@override
|
|
27
|
+
def link_url(self) -> str:
|
|
28
|
+
"""Return the CodeQL documentation URL."""
|
|
29
|
+
return "https://codeql.github.com/docs/"
|
|
30
|
+
|
|
31
|
+
@override
|
|
32
|
+
def name(self) -> str:
|
|
33
|
+
"""Return the CodeQL tool identity."""
|
|
34
|
+
return "codeql"
|
pyrig_codeql-2.1.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"""Health check workflow extended with CodeQL analysis and an open-alert gate."""
|
|
2
|
-
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
from typing import Any, override
|
|
5
|
-
|
|
6
|
-
from pyrig.rig.configs.version_control.remote.workflows.health_check import (
|
|
7
|
-
HealthCheckWorkflowConfigFile as BaseHealthCheckWorkflowConfigFile,
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
from pyrig_codeql.rig.configs.version_control.remote.workflows.codeql import (
|
|
11
|
-
CodeqlWorkflowConfigFile,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class HealthCheckWorkflowConfigFile(BaseHealthCheckWorkflowConfigFile):
|
|
16
|
-
"""Include the reusable CodeQL workflow in the health check."""
|
|
17
|
-
|
|
18
|
-
@override
|
|
19
|
-
def jobs_health_check(self) -> tuple[Callable[[], dict[str, Any]], ...]:
|
|
20
|
-
"""Return the base health-check jobs followed by the CodeQL call."""
|
|
21
|
-
return (
|
|
22
|
-
*super().jobs_health_check(),
|
|
23
|
-
self.job_codeql,
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
def job_codeql(self) -> dict[str, Any]:
|
|
27
|
-
"""Call the reusable CodeQL workflow."""
|
|
28
|
-
return self.job(
|
|
29
|
-
self.job_codeql,
|
|
30
|
-
uses=CodeqlWorkflowConfigFile.I.workflow_call_reference(),
|
|
31
|
-
permissions=self.job_codeql_permissions() or None,
|
|
32
|
-
secrets=CodeqlWorkflowConfigFile.I.used_secrets_mapping() or None,
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
def job_codeql_permissions(self) -> dict[str, str]:
|
|
36
|
-
"""Return the permissions required by the reusable CodeQL workflow."""
|
|
37
|
-
return CodeqlWorkflowConfigFile.I.used_permissions()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/configs/version_control/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyrig_codeql-2.1.0 → pyrig_codeql-3.0.4}/src/pyrig_codeql/rig/resources/ACTION_CODEQL_ANALYZE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|