Azure / Azure/azure-sdk-tools

Move shared JS workflow helpers to azure-sdk-tools for unified code management

Open
#16,104 0 comments 1 reaction 1 assignee Claimed by @samvaity View on GitHub
needs-triage
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

## Summary

Coordinate with Mike Harder to consolidate common JavaScript workflow helpers from `azure-rest-api-specs` into `azure-sdk-tools` for unified shared code management.

## Context

Both `azure-rest-api-specs` and `azure-sdk` now have shared JS helpers for GitHub Actions workflows:

**azure-rest-api-specs** (`.github/workflows/src/` and `.github/shared/src/`):
- `comment.js` — `commentOrUpdate()` (find/update bot comments by HTML marker)
- `context.js` — `extractInputs()` (get owner/repo/issue_number from workflow_run events)
- `labels.js` — `LabelAction` enum
- `github.js` — rate limit hooks, `PER_PAGE_MAX`
- `shared/src/changed-files.js` — `getChangedFiles()` via simple-git
- `shared/src/exec.js` — `execFile()`, `execNpmExec()`

**azure-sdk** (`.github/workflows/src/`):
- `comment.js` — `commentOrUpdate()` (same pattern, independently implemented)
- `labels.js` — `addLabels()`, `removeLabel()`, `ensureLabel()`, `ensureLabelRemoved()`

These helpers duplicate logic across repos. Moving them to a shared package in `azure-sdk-tools` would:
- Eliminate duplication
- Provide a single place to fix bugs and add features
- Allow other repos (`azure-sdk-for-*`) to consume the same helpers

## Proposed approach

1. Create a shared JS package under `tools/` or `packages/` in this repo
2. Publish as an internal npm package or use git-based import
3. Migrate `azure-rest-api-specs` and `azure-sdk` to consume from the shared location
4. Coordinate with @mikeharder on the `shared/src/` and `spec-model` consolidation

## Origin

From discussions with Mike to move common JS code from the rest API specs repo to the tools repo for unified shared code management.

/cc @samvaity @mikeharder @tjprescott

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.