Skip to content

Commit 1f8886c

Browse files
author
Senior Dev Rotation
committed
chore(deploydiff): add gitignore, docs, misc, CI workflow, dev tooling, tests
Automated batch commit. Files changed: UU .gitignore M README.md M package.json ?? .github/workflows/release-audit.yml ?? eslint.config.mjs ?? tests/smoke.test.js
1 parent 3e1c42e commit 1f8886c

6 files changed

Lines changed: 182 additions & 44 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: release-audit
2+
3+
on:
4+
pull_request:
5+
branches: [main, master]
6+
push:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 (pinned)
15+
with:
16+
path: target
17+
18+
- name: Check out the shared release-audit harness
19+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 (pinned)
20+
with:
21+
repository: Coding-Dev-Tools/release-audit
22+
path: harness
23+
# Pin to a tag once a stable release is published; main is fine
24+
# for now since the harness is small and self-contained.
25+
ref: main
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 (pinned)
29+
with:
30+
python-version: "3.11"
31+
32+
- name: Run the 8-angle release audit
33+
working-directory: harness
34+
env:
35+
GITHUB_WORKSPACE: ${{ github.workspace }}
36+
run: |
37+
python audit.py "$GITHUB_WORKSPACE/target" --out-dir scorecard
38+
python3 - <<'PY'
39+
import json, os, pathlib
40+
repo = pathlib.Path(os.environ["GITHUB_WORKSPACE"], "target").name
41+
data = json.loads(pathlib.Path("scorecard", f"{repo}.json").read_text())
42+
print("## Release Audit (8 angles)")
43+
print()
44+
print(f"**Overall grade: {data['overall_grade']}** ({data['angles_passing']}/{data['angles_total']} angles passing)")
45+
print()
46+
print("| Angle | Grade |")
47+
print("|-------|-------|")
48+
for a in data["angles"]:
49+
print(f"| {a['angle']} | {a['grade']} |")
50+
PY
51+
52+
- name: Fail on blockers
53+
working-directory: harness
54+
env:
55+
GITHUB_WORKSPACE: ${{ github.workspace }}
56+
run: |
57+
python3 - <<'PY'
58+
import json, os, pathlib, sys
59+
repo = pathlib.Path(os.environ["GITHUB_WORKSPACE"], "target").name
60+
data = json.loads(pathlib.Path("scorecard", f"{repo}.json").read_text())
61+
if data["blockers"] > 0:
62+
print(f"::error::{data['blockers']} release-blocker angle(s) — see audit output above")
63+
sys.exit(1)
64+
PY

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Thumbs.db
7171
research/
7272
fixtures/generated/
7373
.ruff_cache/
74+
<<<<<<< Updated upstream
7475
.secrets.baseline
7576

7677
# Merge artifacts and cache (added by workspace stabilization)
@@ -84,3 +85,8 @@ fixtures/generated/
8485
*.REMOTE.*
8586
local.db
8687
*.sqlite3
88+
=======
89+
90+
# Added by release-prep
91+
node_modules
92+
>>>>>>> Stashed changes

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,15 @@ DeployDiff is one of 11 tools in the Revenue Holdings suite. One license covers
148148
## License
149149

150150
MIT
151+
152+
## Install
153+
154+
```bash
155+
npm install
156+
```
157+
158+
## Test
159+
160+
```bash
161+
npm test # runs: node --test tests/
162+
```

eslint.config.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
4+
export default [
5+
js.configs.recommended,
6+
{
7+
languageOptions: {
8+
ecmaVersion: 2023,
9+
sourceType: "commonjs",
10+
globals: { ...globals.node },
11+
},
12+
rules: {
13+
"no-unused-vars": "error",
14+
"no-undef": "error",
15+
"no-console": "warn",
16+
"eqeqeq": "error",
17+
"no-eval": "error",
18+
"no-implied-eval": "error",
19+
},
20+
},
21+
];

package.json

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,54 @@
11
{
2-
"name": "deploydiff",
3-
"version": "0.1.0",
4-
"description": "Compare deployment configurations across environments. Detect drift between staging and production configs.",
5-
"author": "Revenue Holdings <engineering@revenueholdings.dev>",
6-
"license": "MIT",
7-
"repository": {
8-
"type": "git",
9-
"url": "https://github.com/Coding-Dev-Tools/deploydiff.git"
10-
},
11-
"homepage": "https://github.com/Coding-Dev-Tools/deploydiff#readme",
12-
"bugs": {
13-
"url": "https://github.com/Coding-Dev-Tools/deploydiff/issues"
14-
},
15-
"bin": {
16-
"deploydiff": "cli.js"
17-
},
18-
"keywords": [
19-
"deployment",
20-
"diff",
21-
"infrastructure",
22-
"devops",
23-
"cost-estimation",
24-
"terraform",
25-
"cloudformation",
26-
"kubernetes",
27-
"change-preview",
28-
"risk-analysis",
29-
"cli",
30-
"developer-tools",
31-
"gitops",
32-
"deployment-safety",
33-
"iac"
34-
],
35-
"files": [
36-
"cli.js"
37-
],
38-
"engines": {
39-
"node": ">=16.0.0"
40-
},
41-
"preferGlobal": true,
42-
"publishConfig": {
43-
"access": "public"
44-
}
45-
}
2+
"name": "deploydiff",
3+
"version": "0.1.0",
4+
"description": "Compare deployment configurations across environments. Detect drift between staging and production configs.",
5+
"author": "Revenue Holdings \u003cengineering@revenueholdings.dev\u003e",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/Coding-Dev-Tools/deploydiff.git"
10+
},
11+
"homepage": "https://github.com/Coding-Dev-Tools/deploydiff#readme",
12+
"bugs": {
13+
"url": "https://github.com/Coding-Dev-Tools/deploydiff/issues"
14+
},
15+
"bin": {
16+
"deploydiff": "cli.js"
17+
},
18+
"keywords": [
19+
"deployment",
20+
"diff",
21+
"infrastructure",
22+
"devops",
23+
"cost-estimation",
24+
"terraform",
25+
"cloudformation",
26+
"kubernetes",
27+
"change-preview",
28+
"risk-analysis",
29+
"cli",
30+
"developer-tools",
31+
"gitops",
32+
"deployment-safety",
33+
"iac"
34+
],
35+
"files": [
36+
"cli.js"
37+
],
38+
"engines": {
39+
"node": "\u003e=16.0.0"
40+
},
41+
"preferGlobal": true,
42+
"publishConfig": {
43+
"access": "public"
44+
},
45+
"scripts": {
46+
"test": "node --test tests/*.test.js",
47+
"lint": "eslint .",
48+
"test:py": "pytest"
49+
},
50+
"devDependencies": {
51+
"@eslint/js": "^9.0.0",
52+
"eslint": "^9.0.0"
53+
}
54+
}

tests/smoke.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const test = require("node:test");
2+
const assert = require("node:assert");
3+
const { execFileSync } = require("node:child_process");
4+
const fs = require("node:fs");
5+
const path = require("node:path");
6+
7+
test("smoke: package main entry exists and parses", () => {
8+
const pkg = require(path.join(__dirname, "..", "package.json"));
9+
assert.ok(pkg.name, "package.json has a name");
10+
const main = pkg.main || "index.js";
11+
const cli = pkg.bin ? Object.values(pkg.bin)[0] : null;
12+
const entry = cli || main;
13+
if (fs.existsSync(path.join(__dirname, "..", entry))) {
14+
assert.doesNotThrow(
15+
() => execFileSync("node", ["--check", entry], { stdio: "ignore" }),
16+
`${entry} must be valid JavaScript`
17+
);
18+
}
19+
});
20+
21+
test("smoke: required repo files present", () => {
22+
const root = path.join(__dirname, "..");
23+
for (const f of ["package.json", "README.md", "LICENSE"]) {
24+
assert.ok(fs.existsSync(path.join(root, f)), `${f} must exist`);
25+
}
26+
});

0 commit comments

Comments
 (0)