-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Include .tsp files as trivial/non-functional changes for ARM auto sign-off #40396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a9ec88
909b9ce
cbc2c9f
1d36ddf
93631f7
a6d1f12
9e3f322
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"; | ||
|
|
@@ -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( | ||
|
|
@@ -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
|
||
|
|
||
| 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 | ||
|
|
@@ -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; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequestChanges.isTrivial()now treatsrmTypeSpecas 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).There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.rmTypeSpectoisDocumentationOnly()andisExamplesOnly()so they correctly exclude TypeSpec changes from those "only" checks.