Skip to content

[Dependency Mgmt] deps-catalog-check workflow should run formatters before opening PR #852

Open

Description

@SnowboardTechie

Summary

The deps-catalog-check workflow bumps pinned versions in pnpm-workspace.yaml and opens a chore(deps): update catalog dependencies PR, but doesn't run the project's formatters against the workspace before pushing. When a bumped tool ships a new formatter rule, the resulting PR fails the format check step in CI and requires a manual follow-up commit to land.

#839 hit this: @typespec/compiler ^1.11.0 → ^1.12.0 introduced a rule that breaks long union return types across multiple lines, which re-formatted two .tsp files in lib/core/lib/core/routes/ (applications.tsp, competitions.tsp). CI caught it via tsp format --check in validate-workspace; the fix was a one-shot tsp format + commit on the branch.

The catalog workflow bumps a stack of related packages at once, which is where formatter-rule changes most often sneak in — Dependabot's one-package-at-a-time PRs rarely cross that boundary.

Proposed change

In .github/workflows/deps-catalog-check.yml, add a step after Run catalog update script and before Create pull request that runs the project's formatters across the workspace (Prettier, tsp format, plus any others). Any resulting changes get committed into the same PR by peter-evans/create-pull-request.

Worth noting in the PR body template: a formatter-rule change will now show up silently as extra files in the diff rather than as a red CI check, so reviewers should skim the non-lockfile part of the diff. For a chore(deps): PR this is almost always net-positive since the formatter output is mechanical.

Acceptance criteria

  • Workflow runs formatters on the working tree after the catalog bump and before opening the PR
  • PR opened by the workflow passes validate-workspace (including tsp format --check) on its first CI run, even when a bumped dep ships a new formatter rule
  • PR body or commit message notes that mechanical formatter output may be included in the diff

Activity

  1. SnowboardTechie commented on May 21, 2026

    @SnowboardTechie
    CollaboratorAuthor

    Two PR-body fixes worth bundling into this scope while you're editing the template:

    1. pnpm run typespec doesn't work from the root. The If TypeSpec packages updated: verify pnpm run typespec output is sensible checkbox errors with ERR_PNPM_NO_SCRIPT — typespec is defined per-package in lib/core, lib/cli, lib/ts-sdk, website, and the two templates, not at the workspace root. Replacing it with pnpm -r run typespec runs it across every workspace that defines it.

    2. The changeset checkbox is narrower than the actual rule. It currently says "Add changeset if peerDep ranges changed for @common-grants/core", but @common-grants/cli has @typespec/compiler as a runtime dependency, so any TypeSpec bump should add a changeset entry for cli too — which is what chore(deps): update catalog dependencies #822 did and what we just added to chore(deps): update catalog dependencies #839. Could broaden to: "Add changeset for @common-grants/core and @common-grants/cli if @typespec/* ranges changed".

  2. SnowboardTechie commented on May 21, 2026

    @SnowboardTechie
    CollaboratorAuthor

    And a third item, more in the spirit of the original proposed change than the PR-body tweaks above:

    Workflow should regenerate committed build artifacts, not just run formatters. Same root cause as the formatter issue — the catalog workflow only edits pnpm-workspace.yaml, so any emitter-level changes silently drift the committed snapshots until someone happens to run tsp compile locally. #839 just hit this: @typespec/openapi3 1.12 shipped a discriminator-mapping fix (microsoft/typespec#10268) that changed output for six committed OpenAPI YAMLs under lib/cli/lib/openapi/ and website/public/openapi/. CI didn't catch it because no check diffs committed snapshots against fresh tsp compile output. Surfaced manually during review; fix landed in 8646416 on the PR. A pnpm -r run typespec step alongside the formatter pass would close this gap by the same mechanism.

  3. changed the title [-]deps-catalog-check workflow should run formatters before opening PR[/-] [+][Dependency Mgmt] deps-catalog-check workflow should run formatters before opening PR[/+] on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

dependenciesPull requests that update a dependency fileenhancementNew feature or request

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions