fix: fixed getAuthors#1930
Conversation
d734c0c to
fdd4767
Compare
fdd4767 to
695d4f5
Compare
|
| async getAuthors(): Promise<Record<string, {login: string; commit: string}>> { | ||
| const base = await this.getBase(); | ||
| const scopes = [base, ...(this.config.vcs.scopes || [])].map(normalizePath); | ||
| const handled = new Set<string>(); |
There was a problem hiding this comment.
if you remove this behavior, several cases will break. Add tests for them
-
getAuthors: one commit affects files in different scopes — we check that the author is set for paths from all scopes, not just the first one. This is the main bug that the PR is fixing. It is already in the PR.
-
getContributors: one commit affects files in different scopes — similar to point 1, but for an accumulating array of contributors. It is already in the PR, but the mock for . is unrealistic — we need arc log . returned all commit paths, including those that would be included in the sub-scope.
-
getContributors: one path in the overlapping scopes (. + docs) - arc log . and arc log docs both return a commit with the path docs/intro.md; we check that there is only one entry in the contributors array, not two. This is a regression caused by removing the handled Set from getContributors, and it is directly related to the changes in the PR.
| shouldBeIgnored(ignore, {login: commit.login}) || handled.has(commit.sha); | ||
| handled.add(commit.sha); | ||
| const skip = shouldBeIgnored(ignore, {login: commit.login}); | ||
|
|
There was a problem hiding this comment.
fix: fixed getAuthors - it doesn't say anything, so I suggest something like fix(arcadia-vcs): credit authors on cross-scope commits in getAuthor



fix: fixed getAuthors