Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 17 additions & 3 deletions .github/workflows/src/arm-auto-signoff/pr-changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export class PullRequestChanges {
/** @type {boolean} */
rmExamples = false;

/** @type {boolean} */
rmTypeSpec = false;

/** @type {boolean} */
rmFunctional = false;

Expand All @@ -21,6 +24,7 @@ export class PullRequestChanges {
* A PR is trivial if it contains only:
* - Documentation changes
* - Example changes
* - TypeSpec file changes (.tsp, tspconfig.yaml)
* and does NOT contain:
* - Functional spec changes
* - Other file types
Expand All @@ -29,7 +33,7 @@ export class PullRequestChanges {
*/
isTrivial() {
const hasNoBlockingChanges = !this.rmFunctional && !this.rmOther && !this.other;
const hasTrivialChanges = this.rmDocumentation || this.rmExamples;
const hasTrivialChanges = this.rmDocumentation || this.rmExamples || this.rmTypeSpec;
return hasNoBlockingChanges && hasTrivialChanges;
Comment on lines 34 to 37
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

PullRequestChanges.isTrivial() now treats rmTypeSpec as a trivial change, but the JSDoc above still says trivial PRs contain only documentation/examples. Update the comment to include TypeSpec so the documentation matches the behavior (and avoids misleading future maintainers).

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the JSDoc to include TypeSpec file changes (.tsp, tspconfig.yaml) in the trivial changes list in commit a6d1f12.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied in a previous commit. The JSDoc for isTrivial() now documents TypeSpec file changes as a trivial category. Additionally, in commit 9e3f322, I added !this.rmTypeSpec to isDocumentationOnly() and isExamplesOnly() so they correctly exclude TypeSpec changes from those "only" checks.

}

Expand All @@ -38,7 +42,12 @@ export class PullRequestChanges {
*/
isDocumentationOnly() {
return (
this.rmDocumentation && !this.rmExamples && !this.rmFunctional && !this.rmOther && !this.other
this.rmDocumentation &&
!this.rmExamples &&
!this.rmTypeSpec &&
!this.rmFunctional &&
!this.rmOther &&
!this.other
);
}

Expand All @@ -47,7 +56,12 @@ export class PullRequestChanges {
*/
isExamplesOnly() {
return (
!this.rmDocumentation && this.rmExamples && !this.rmFunctional && !this.rmOther && !this.other
!this.rmDocumentation &&
this.rmExamples &&
!this.rmTypeSpec &&
!this.rmFunctional &&
!this.rmOther &&
!this.other
);
}
}
24 changes: 22 additions & 2 deletions .github/workflows/src/arm-auto-signoff/trivial-changes-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
markdown,
resourceManager,
swagger,
typespec,
} from "../../../shared/src/changed-files.js";
import { CoreLogger } from "../core-logger.js";
import { PullRequestChanges } from "./pr-changes.js";
Expand Down Expand Up @@ -136,6 +137,20 @@ function hasSignificantFileOperations(changedFilesStatuses, core) {
return true;
}

// New TypeSpec files are non-trivial (conservative approach)
const newTypeSpecFiles = changedFilesStatuses.additions.filter(typespec);
if (newTypeSpecFiles.length > 0) {
core.info(`Significant: New TypeSpec files detected: ${newTypeSpecFiles.join(", ")}`);
return true;
}

// Deleted TypeSpec files are non-trivial (conservative approach)
const deletedTypeSpecFiles = changedFilesStatuses.deletions.filter(typespec);
if (deletedTypeSpecFiles.length > 0) {
core.info(`Significant: Deleted TypeSpec files detected: ${deletedTypeSpecFiles.join(", ")}`);
return true;
}

// Any file renames/moves are non-trivial (conservative approach)
if (changedFilesStatuses.renames.length > 0) {
core.info(
Expand All @@ -161,12 +176,13 @@ async function analyzeAndUpdatePullRequestChanges(changedFiles, git, core, chang
const documentationFiles = changedFiles.filter(markdown);
const exampleFiles = changedFiles.filter(example);
const specFiles = changedFiles.filter(swagger);
const typespecFiles = changedFiles.filter(typespec);
const otherFiles = changedFiles.filter(
(file) => !markdown(file) && !example(file) && !swagger(file),
(file) => !markdown(file) && !example(file) && !swagger(file) && !typespec(file),
);
Comment on lines 178 to 182
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

With this change, new/deleted .tsp or tspconfig.yaml files under resource-manager/ will be classified as rmTypeSpec and can make isTrivial() return true. However, hasSignificantFileOperations() only treats Swagger JSON additions/deletions as significant, so adding/removing TypeSpec files won’t flip rmFunctional (unlike JSON specs). If the intent is to remain conservative for file additions/deletions, consider updating hasSignificantFileOperations() to also treat TypeSpec additions/deletions as significant (or otherwise explicitly justify why they’re safe).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Updated hasSignificantFileOperations() to also treat TypeSpec additions and deletions as significant (non-trivial), keeping the conservative approach consistent with Swagger JSON handling. Only TypeSpec modifications are now treated as trivial. See commit a6d1f12.


core.info(
`File breakdown: ${documentationFiles.length} docs, ${exampleFiles.length} examples, ${specFiles.length} specs, ${otherFiles.length} other`,
`File breakdown: ${documentationFiles.length} docs, ${exampleFiles.length} examples, ${specFiles.length} specs, ${typespecFiles.length} typespec, ${otherFiles.length} other`,
);

// Set flags for file types present
Expand All @@ -178,6 +194,10 @@ async function analyzeAndUpdatePullRequestChanges(changedFiles, git, core, chang
changes.rmExamples = true;
}

if (typespecFiles.length > 0) {
changes.rmTypeSpec = true;
}

if (otherFiles.length > 0) {
changes.rmOther = true;
}
Expand Down
Loading