Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fd2ab3d
Add generate_api_text.py script.
tjprescott May 28, 2026
ebb3870
Add PR creation script.
tjprescott May 29, 2026
2d24fa9
Review feedback.
tjprescott May 29, 2026
e4b2876
Add scripts for syncing api.md
tjprescott Jun 2, 2026
dd1b565
Refactor create_api_review_pr from Python to JS in a module way.
tjprescott Jun 2, 2026
688e16f
Remove update process and just have a consistency check.
tjprescott Jun 2, 2026
323d4f3
Add minor change to azure-template to test pipeline.
tjprescott Jun 2, 2026
93184af
Add API.md to test mismatch.
tjprescott Jun 2, 2026
7680ff6
Apply actual api.md
tjprescott Jun 2, 2026
33c39cf
Update GitHub Actions to latest major versions
Copilot Jun 3, 2026
15534d7
Add shared JS scripts from rest-api-specs repo.
tjprescott Jun 3, 2026
19f65ac
Refactor scripts to use shared code and simplify.
tjprescott Jun 3, 2026
9d0946e
Code review feedback.
tjprescott Jun 3, 2026
ec760b0
Add generated API.md for azure-template
Copilot Jun 3, 2026
d04b5db
Refactor to use `azpysdk apistub --md` command.
tjprescott Jun 3, 2026
825c684
Merge branch 'GenerateAPITextScript' of https://github.com/Azure/azur…
tjprescott Jun 3, 2026
7f8eeb5
Remove Python 3.10 limit on apistub.py.
tjprescott Jun 3, 2026
c75faac
Refactor `azpysdk apistub` command. Extract metadata from API.md.
tjprescott Jun 3, 2026
dfe985c
Add validation for select metadata fields.
tjprescott Jun 3, 2026
9d8137c
CI fixes.
tjprescott Jun 3, 2026
760fc63
Add skill for generating review PR.
tjprescott Jun 3, 2026
1517d58
Update review generation logic.
tjprescott Jun 3, 2026
258a36a
fix(python adapter): add shell:true on Windows for spawnSync
tjprescott Jun 3, 2026
89e6c98
fix(python adapter): pass --dest-dir so API.md lands in package dir
tjprescott Jun 3, 2026
62f81e3
fix(python adapter): skip _generated dirs in readVersion to avoid sta…
tjprescott Jun 3, 2026
92e0c92
Make script idempotent and reuse branches with the same API hash.
tjprescott Jun 4, 2026
bb253fa
Code review feedback.
tjprescott Jun 5, 2026
317bd4c
Updates.
tjprescott Jun 5, 2026
a82a7ee
Make review PR creation only work for updates, not new packages.
tjprescott Jun 5, 2026
8d07492
CI fixes.
tjprescott Jun 5, 2026
da6a96e
Use shared helper method.
tjprescott Jun 8, 2026
8fdfca0
Add metadata to review PRs.
tjprescott Jun 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/shared/package.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need to either add a package-lock.json file, or add the necessary deps to another package.json already in the repo

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "@azure-tools/specs-shared",
"private": true,
"type": "module",
"exports": {
"./array": "./src/array.js",
"./breaking-change": "./src/breaking-change.js",
"./changed-files": "./src/changed-files.js",
"./console": "./src/console.js",
"./eslint-base-config": "./eslint.base.config.js",
"./exec": "./src/exec.js",
"./git": "./src/git.js",
"./github": "./src/github.js",
"./logger": "./src/logger.js",
"./math": "./src/math.js",
"./path": "./src/path.js",
"./readme": "./src/readme.js",
"./sdk-types": "./src/sdk-types.js",
"./set": "./src/set.js",
"./simple-git": "./src/simple-git.js",
"./sleep": "./src/sleep.js",
"./sort": "./src/sort.js",
"./spec-model-error": "./src/spec-model-error.js",
"./spec-model": "./src/spec-model.js",
"./swagger": "./src/swagger.js",
"./tag": "./src/tag.js",
"./time": "./src/time.js",
"./test/examples": "./test/examples.js"
},
"bin": {
"spec-model": "./cmd/spec-model.js"
},
"_comments": {
"dependencies": "Runtime dependencies must be kept to an absolute minimum for performance, ideally with no transitive dependencies",
"dependencies2": "All runtime and dev dependencies in this file, must be a subset of ../package.json"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^15.1.3",
"debug": "^4.4.3",
"js-yaml": "^4.1.0",
"marked": "^18.0.0",
"simple-git": "^3.36.0",
"zod": "^4.3.5"
},
"devDependencies": {
"@eslint/js": "^10.0.0",
"@tsconfig/node20": "^20.1.4",
"@types/debug": "^4.1.12",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.0.0",
"@types/semver": "^7.7.1",
"@vitest/coverage-v8": "^4.1.0",
"cross-env": "^10.1.0",
"eslint": "^10.0.0",
"globals": "^17.0.0",
"prettier": "3.8.3",
"prettier-plugin-organize-imports": "^4.2.0",
"semver": "^7.7.1",
"tinybench": "^6.0.0",
"typescript": "~6.0.2",
"typescript-eslint": "^8.58.0",
"vitest": "^4.1.0"
},
"scripts": {
"check": "npm run test:ci && npm run lint && npm run format:check",
"lint": "npm run lint:eslint && npm run lint:tsc",
"lint:eslint": "cross-env DEBUG=eslint:eslint,eslint:linter eslint",
"lint:tsc": "tsc --build --verbose",
"format": "prettier . --ignore-path ../.prettierignore --write",
"format:check": "prettier . --ignore-path ../.prettierignore --check",
"format:check:ci": "prettier . --ignore-path ../.prettierignore --check --log-level debug",
"perf": "node perf/perf.js",
"test": "vitest",
"test:ci": "vitest run --coverage --reporter=verbose"
}
}
61 changes: 61 additions & 0 deletions .github/shared/src/cache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Caches values in memory with a single key of any type.
*
* @template K, V
*/
export class KeyedCache {
/** @type {Map<K, V>} */
#map = new Map();

/**
* Returns cached value, initializing if necessary
*
* @param {K} key
* @param {() => V} factory
* @returns {V} cached value
*
* @example
* const result = cache.getOrCreate(42, async () => await doWork(42));
*/
getOrCreate(key, factory) {
let value = this.#map.get(key);

if (value === undefined) {
value = factory();
this.#map.set(key, value);
}

return value;
}
}

/**
* Caches values in memory with an ordered pair of keys of any types.
*
* @template K1, K2, V
*/
export class KeyedPairCache {
// Two-layer nested cache
/** @type {KeyedCache<K1, KeyedCache<K2, V>>} */
#cache1 = new KeyedCache();

/**
* Returns cached value, initializing if necessary.
* Keys are ordered, so (key1, key2) != (key2, key1).
*
* @param {K1} key1
* @param {K2} key2
* @param {() => V} factory
* @returns {V} cached value
*
* @example
* const result = cache.getOrCreate(42, 7, async () => await doWork(42, 7));
*/
Comment thread
tjprescott marked this conversation as resolved.
getOrCreate(key1, key2, factory) {
// key1 => cache for the next layer
const cache2 = this.#cache1.getOrCreate(key1, () => new KeyedCache());

// key2 => final value
return cache2.getOrCreate(key2, factory);
}
}
Loading
Loading