Skip to content

Commit 8f92ed9

Browse files
committed
more feedback
1 parent e54709a commit 8f92ed9

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

.github/instructions/rendered-specs.instructions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: ALWAYS refer to this when working with rendered spec files (`*.spec
77

88
## What are rendered specs?
99

10-
Rendered specs are generated by the `azldev component render` command based on the component definitions and overlays. They are output to the `specs/` directory and should not be edited directly.
10+
Rendered specs are generated by the `azldev comp render` command based on the component definitions and overlays. They are output to the `specs/` directory and should not be edited directly.
1111

1212
They are meant to be consumed by downstream processes (e.g., build pipelines) and are the source of truth for all subsequent steps. Any changes to the spec should be made via the component definition and overlays, not by editing the rendered spec.
1313

@@ -17,16 +17,16 @@ To change a rendered spec, modify the component's `.comp.toml` and/or its overla
1717

1818
```bash
1919
# VERY SLOW - Re-render all specs, removes any stale specs that are no longer defined in the components
20-
azldev component render -a --clean-stale -O json
20+
azldev comp render -a --clean-stale -O json
2121
```
2222

2323
```bash
2424
# Small set, will NOT remove stale specs, faster for iterative development
25-
azldev component render <component-1> <component-2> -O json
25+
azldev comp render <component-1> <component-2> -O json
2626
```
2727

2828
```bash
2929
# Custom output directory, useful for debugging. When not using the automatically configured spec directory, --force is
3030
# required to delete and re-create the output folders if they already exist.
31-
azldev component render <component> -O json -o ./base/build/work/scratch/rendered-specs --force
31+
azldev comp render <component> -O json -o ./base/build/work/scratch/rendered-specs --force
3232
```

.github/workflows/scripts/check_rendered_specs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ def main() -> int:
354354
+ _unique_components(report.get("missing_files", []))
355355
)
356356
)
357-
if extra:
358-
print("Remediation: azldev component render -a")
357+
if extra or missing:
358+
print(f"Remediation: {_render_command([], use_all=True)}")
359359
elif all_comps:
360360
print(f"Remediation: {_render_command(all_comps)}")
361361

.github/workflows/scripts/post_render_comment.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import os
3030
import subprocess
3131
import sys
32+
import tempfile
3233
from pathlib import Path
3334

3435
# ---------------------------------------------------------------------------
@@ -231,9 +232,10 @@ def find_existing_comment(repo: str, pr: str) -> str | None:
231232

232233
def post_or_update_comment(repo: str, pr: str, body: str) -> None:
233234
existing_id = find_existing_comment(repo, pr)
234-
body_path = Path("render-check-comment.md")
235-
body_path.write_text(body, encoding="utf-8")
235+
fd, body_path = tempfile.mkstemp(prefix="render-check-comment-", suffix=".md")
236236
try:
237+
with os.fdopen(fd, "w") as f:
238+
f.write(body)
237239
if existing_id:
238240
print(f"Updating existing comment {existing_id}")
239241
_gh(
@@ -246,9 +248,9 @@ def post_or_update_comment(repo: str, pr: str, body: str) -> None:
246248
)
247249
else:
248250
print("Creating new comment")
249-
_gh("pr", "comment", pr, "--repo", repo, "--body-file", str(body_path))
251+
_gh("pr", "comment", pr, "--repo", repo, "--body-file", body_path)
250252
finally:
251-
body_path.unlink(missing_ok=True)
253+
Path(body_path).unlink(missing_ok=True)
252254

253255

254256
def delete_comment_if_exists(repo: str, pr: str) -> None:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ go install github.com/microsoft/azure-linux-dev-tools/cmd/azldev@main
2222

2323
The `specs/` directory contains "rendered" spec files created by `azldev`. They are a read-only snapshot of the final spec files after all overlays and modifications have been applied. They are the canonical source for what will be built and packaged.
2424

25-
They can be updated at any time by running `azldev comp render -a`, or a single component can be rendered with `azldev comp render <name>`.
25+
They can be updated at any time by running `azldev component render -a`, or a single component can be rendered with `azldev component render <name>`.
2626

2727
## AI-Assisted Development (VSCode + GitHub Copilot CLI)
2828

0 commit comments

Comments
 (0)