Repository navigation
fix(hub): attribute imported Build authors and preserve webhook delivery IDs #323
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0ff6692
fix(hub): resolve imported Build authors and int64 webhook delivery IDs
weastler 3ac972f
merge(hub): integrate latest Hub base
weastler a549116
fix(hub): address author and webhook review findings
weastler 19b5ce3
Merge origin/build/hub/new into author/webhook fixes
weastler eac4972
merge(hub): integrate latest Hub base
weastler 285e327
fix(hub): address author and webhook review feedback
weastler ba83bf6
fix(hub): avoid retrying deselected failed builds
weastler 2d8a40e
fix(hub): settle deselected author retries and recover failed author …
weastler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
hub/client/application/hub/view-models/repository-show-data/index.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import { describe, expect, it } from "vitest" | ||
|
|
||
| import { repositoryResponseSchema, workspaceResponseSchema } from "@application/hub/contracts" | ||
|
|
||
| import { repositoryShowData } from "." | ||
|
|
||
| describe("repositoryShowData()", () => { | ||
| it("uses a GitHub snapshot without joining an unrelated user by login in real data", () => { | ||
| const repository = { id: "1", nameWithOwner: "example/repository", defaultBranch: "main" } | ||
| const workspace = workspaceResponseSchema.parse({ | ||
| viewer: { id: "viewer", login: "viewer", name: null, avatarUrl: null }, | ||
| repositories: [repository], | ||
| }) | ||
| const data = repositoryResponseSchema.parse({ | ||
| repository, | ||
| prototypes: [ | ||
| { | ||
| id: "2", | ||
| repositoryId: repository.id, | ||
| name: "GitHub snapshot", | ||
| branchName: "proto/github", | ||
| description: null, | ||
| authorId: null, | ||
| authorLogin: "sam", | ||
| authorProvider: "github", | ||
| canEdit: false, | ||
| builds: [], | ||
| }, | ||
| { | ||
| id: "3", | ||
| repositoryId: repository.id, | ||
| name: "Explicit owner", | ||
| branchName: "proto/owner", | ||
| description: null, | ||
| authorId: "entra-user", | ||
| authorLogin: "sam", | ||
| authorProvider: "entra", | ||
| canEdit: false, | ||
| builds: [], | ||
| }, | ||
| ], | ||
| pagination: { page: 1, pageSize: 20, totalCount: 2, pageCount: 1 }, | ||
| authors: [ | ||
| { | ||
| id: "entra-user", | ||
| login: "sam", | ||
| name: "Entra user", | ||
| provider: "entra", | ||
| avatarUrl: "https://example.test/entra.png", | ||
| }, | ||
| ], | ||
| }) | ||
|
|
||
| const { prototypes } = repositoryShowData(workspace, data, new URLSearchParams(), { | ||
| real: true, | ||
| }) | ||
|
|
||
| expect.soft(prototypes.find(({ id }) => id === "2")?.author).toEqual({ | ||
| avatarUrl: null, | ||
| label: "By @sam", | ||
| ownerLabel: "@sam", | ||
| url: "https://github.com/sam", | ||
| }) | ||
| expect(prototypes.find(({ id }) => id === "3")?.author).toEqual({ | ||
| avatarUrl: "https://example.test/entra.png", | ||
| label: "By Entra user", | ||
| ownerLabel: "Entra user", | ||
| url: null, | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export class GitHubBuildAuthorTargetError extends Error { | ||
| constructor() { | ||
| super("No GitHub Build matches that repository and Build ID.") | ||
| this.name = "GitHubBuildAuthorTargetError" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.