Compare commits

...

5 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 88d212f82b Update test to match new error message format
Co-authored-by: bdehamer <398027+bdehamer@users.noreply.github.com>
2026-02-17 16:04:17 +00:00
copilot-swe-agent[bot] b0f0516e10 Improve error message clarity for subject count limit
Co-authored-by: bdehamer <398027+bdehamer@users.noreply.github.com>
2026-02-17 16:03:23 +00:00
copilot-swe-agent[bot] 14aaaaa7de Fix boundary condition for MAX_SUBJECT_COUNT check
Co-authored-by: bdehamer <398027+bdehamer@users.noreply.github.com>
2026-02-17 16:01:54 +00:00
copilot-swe-agent[bot] 6cf5fbc523 Optimize getSubjectFromPath to avoid concurrent stat calls
Co-authored-by: bdehamer <398027+bdehamer@users.noreply.github.com>
2026-02-17 16:00:46 +00:00
copilot-swe-agent[bot] f00e913aa0 Initial plan 2026-02-17 15:57:37 +00:00
2 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -484,7 +484,7 @@ describe('action', () => {
expect(setFailedMock).toHaveBeenCalledWith(
new Error(
'Too many subjects specified (1025). The maximum number of subjects is 1024.'
'Too many subjects specified (>1024). The maximum number of subjects is 1024.'
)
)
})
+12 -8
View File
@@ -94,14 +94,18 @@ const getSubjectFromPath = async (
// Expand the globbed paths to a list of actual paths
const paths = await glob.create(subjectPaths).then(async g => g.glob())
// Filter path list to just the files (not directories)
const stats = await Promise.all(paths.map(async p => fs.stat(p)))
const files = paths.filter((_, i) => stats[i].isFile())
if (files.length > MAX_SUBJECT_COUNT) {
throw new Error(
`Too many subjects specified (${files.length}). The maximum number of subjects is ${MAX_SUBJECT_COUNT}.`
)
// Filter path list to just the files (not directories), enforcing the maximum
const files: string[] = []
for (const p of paths) {
const stat = await fs.stat(p)
if (stat.isFile()) {
if (files.length >= MAX_SUBJECT_COUNT) {
throw new Error(
`Too many subjects specified (>${MAX_SUBJECT_COUNT}). The maximum number of subjects is ${MAX_SUBJECT_COUNT}.`
)
}
files.push(p)
}
}
for (const file of files) {