Skip to content

Commit dbf524c

Browse files
authored
fix(ui): Revert to using project release commmit API (#70485)
In #63860 we switched from a class component to a FC and also switched from hitting `ProjectReleaseCommitsEndpoint` to `OrganizationReleaseCommitsEndpoint`. The latter doesn't respect repo name or id in the query param, which makes it so selecting a repo in the dropdown will show you commits from other repos (and also messes up pagination as well, not showing you all commits). Related to #70411
1 parent 0b96de4 commit dbf524c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

static/app/views/releases/detail/commitsAndFiles/commits.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('Commits', () => {
6868
body: repos,
6969
});
7070
MockApiClient.addMockResponse({
71-
url: `/organizations/org-slug/releases/${encodeURIComponent(
71+
url: `/projects/org-slug/project-slug/releases/${encodeURIComponent(
7272
release.version
7373
)}/commits/`,
7474
body: [],
@@ -85,7 +85,7 @@ describe('Commits', () => {
8585
body: repos,
8686
});
8787
MockApiClient.addMockResponse({
88-
url: `/organizations/org-slug/releases/${encodeURIComponent(
88+
url: `/projects/org-slug/project-slug/releases/${encodeURIComponent(
8989
release.version
9090
)}/commits/`,
9191
body: [CommitFixture()],
@@ -112,7 +112,7 @@ describe('Commits', () => {
112112
],
113113
});
114114
MockApiClient.addMockResponse({
115-
url: `/organizations/org-slug/releases/${encodeURIComponent(
115+
url: `/projects/org-slug/project-slug/releases/${encodeURIComponent(
116116
release.version
117117
)}/commits/`,
118118
body: [CommitFixture()],
@@ -146,7 +146,7 @@ describe('Commits', () => {
146146
body: [repos[0]!, otherRepo],
147147
});
148148
MockApiClient.addMockResponse({
149-
url: `/organizations/org-slug/releases/${encodeURIComponent(
149+
url: `/projects/org-slug/project-slug/releases/${encodeURIComponent(
150150
release.version
151151
)}/commits/`,
152152
body: [

static/app/views/releases/detail/commitsAndFiles/commits.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Commits({activeReleaseRepo, releaseRepos, projectSlug}: CommitsProps) {
4949
getResponseHeader,
5050
} = useApiQuery<Commit[]>(
5151
[
52-
`/organizations/${organization.slug}/releases/${encodeURIComponent(
52+
`/projects/${organization.slug}/${projectSlug}/releases/${encodeURIComponent(
5353
params.release
5454
)}/commits/`,
5555
{query},
@@ -58,7 +58,6 @@ function Commits({activeReleaseRepo, releaseRepos, projectSlug}: CommitsProps) {
5858
staleTime: Infinity,
5959
}
6060
);
61-
6261
const commitsByRepository = getCommitsByRepository(commitList);
6362
const reposToRender = getReposToRender(Object.keys(commitsByRepository));
6463
const activeRepoName: string | undefined = activeReleaseRepo

0 commit comments

Comments
 (0)