quality-graph-cli 0.1.8__tar.gz → 0.1.9__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.
@@ -1,4 +1,5 @@
1
1
  .venv/
2
+ .env
2
3
  __pycache__/
3
4
  *.py[cod]
4
5
  .pytest_cache/
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quality-graph-cli
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Provider-driven Quality Graph command-line application
5
- Project-URL: Homepage, https://alchemmist.github.io/quality-graph/
6
- Project-URL: Documentation, https://alchemmist.github.io/quality-graph/
5
+ Project-URL: Homepage, https://quality-graph.xyz/
6
+ Project-URL: Documentation, https://quality-graph.xyz/
7
7
  License-Expression: MIT
8
8
  Requires-Python: >=3.12
9
- Requires-Dist: quality-graph-core==0.1.8
9
+ Requires-Dist: quality-graph-core==0.1.9
10
10
  Description-Content-Type: text/markdown
11
11
 
12
12
  # qg
@@ -15,7 +15,7 @@ Provider-driven command-line application for Quality Graph projects.
15
15
 
16
16
  The CLI discovers providers through the `qg.providers` entry-point group. Install it together
17
17
  with the GitHub provider using
18
- `uv tool install quality-graph-cli==0.1.2 --with quality-graph-github==0.1.2`.
18
+ `uv tool install quality-graph-cli==0.1.8 --with quality-graph-github==0.1.8`.
19
19
 
20
20
  Initialize a repository with its default branch, generate the provider-owned files, and list
21
21
  those paths for repository tooling:
@@ -4,7 +4,7 @@ Provider-driven command-line application for Quality Graph projects.
4
4
 
5
5
  The CLI discovers providers through the `qg.providers` entry-point group. Install it together
6
6
  with the GitHub provider using
7
- `uv tool install quality-graph-cli==0.1.2 --with quality-graph-github==0.1.2`.
7
+ `uv tool install quality-graph-cli==0.1.8 --with quality-graph-github==0.1.8`.
8
8
 
9
9
  Initialize a repository with its default branch, generate the provider-owned files, and list
10
10
  those paths for repository tooling:
@@ -4,16 +4,16 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "quality-graph-cli"
7
- version = "0.1.8"
7
+ version = "0.1.9"
8
8
  description = "Provider-driven Quality Graph command-line application"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
11
11
  license = "MIT"
12
- dependencies = ["quality-graph-core==0.1.8"]
12
+ dependencies = ["quality-graph-core==0.1.9"]
13
13
 
14
14
  [project.urls]
15
- Homepage = "https://alchemmist.github.io/quality-graph/"
16
- Documentation = "https://alchemmist.github.io/quality-graph/"
15
+ Homepage = "https://quality-graph.xyz/"
16
+ Documentation = "https://quality-graph.xyz/"
17
17
 
18
18
  [project.scripts]
19
19
  qg = "qg_cli.cli:main"
@@ -63,6 +63,8 @@ def parser() -> argparse.ArgumentParser:
63
63
  emit.add_argument("--metric", action="append", default=[])
64
64
  emit.add_argument("--repository", required=True)
65
65
  emit.add_argument("--pull-request", type=int)
66
+ emit.add_argument("--flow-id")
67
+ emit.add_argument("--operation-id")
66
68
  emit.add_argument("--head-sha", required=True)
67
69
  emit.add_argument("--workflow-run-id", type=int, required=True)
68
70
  emit.add_argument("--run-attempt", type=int, required=True)
@@ -160,6 +162,8 @@ def _emitted_result(args: argparse.Namespace) -> Result:
160
162
  args.run_attempt,
161
163
  args.graph_digest,
162
164
  args.pull_request,
165
+ args.flow_id,
166
+ args.operation_id,
163
167
  ),
164
168
  failure,
165
169
  args.summary,
@@ -58,6 +58,19 @@ class Project:
58
58
  """Write every deterministic generated file."""
59
59
  generated = self.render()
60
60
  prettier_ignore = self._prettier_ignore(generated)
61
+ retired = self._retired_paths(generated)
62
+ for path in retired:
63
+ if (path.exists() or path.is_symlink()) and (
64
+ path.is_symlink()
65
+ or not path.read_text().startswith(
66
+ "# Generated by Quality Graph. DO NOT EDIT MANUALLY."
67
+ )
68
+ ):
69
+ message = f"Refusing to remove an unmanaged retired workflow: {path}"
70
+ raise ValueError(message)
71
+ for path in retired:
72
+ if path.exists():
73
+ path.unlink()
61
74
  for item in generated.files:
62
75
  path = self.root / item.path
63
76
  path.parent.mkdir(parents=True, exist_ok=True)
@@ -67,6 +80,15 @@ class Project:
67
80
  ignore_path.write_text(prettier_ignore)
68
81
  return generated
69
82
 
83
+ def _retired_paths(self, generated: GeneratedProject) -> tuple[Path, ...]:
84
+ root = self.root.resolve()
85
+ paths = tuple(self.root / path for path in generated.retired_files)
86
+ for path in paths:
87
+ if root not in path.resolve().parents:
88
+ message = f"Retired workflow is outside the project root: {path}"
89
+ raise ValueError(message)
90
+ return paths
91
+
70
92
  def generated_files(self) -> tuple[PurePosixPath, ...]:
71
93
  """Return stable repository-relative compiler-owned paths."""
72
94
  return tuple(item.path for item in self.render().files)
@@ -74,7 +96,13 @@ class Project:
74
96
  def validate(self) -> ValidationReport:
75
97
  """Compare generated output without mutating files."""
76
98
  problems: list[str] = []
77
- for item in self.render().files:
99
+ generated = self.render()
100
+ problems.extend(
101
+ f"retired generated file: {path.relative_to(self.root)}"
102
+ for path in self._retired_paths(generated)
103
+ if path.exists() or path.is_symlink()
104
+ )
105
+ for item in generated.files:
78
106
  path = self.root / item.path
79
107
  if not path.is_file():
80
108
  problems.append(f"missing generated file: {item.path}")