Skip to content

Commit 8ce8cb1

Browse files
authored
Merge pull request #374 from shapehq/develop
Deploy to production
2 parents c41bb5a + 443eeaf commit 8ce8cb1

17 files changed

+162
-133
lines changed

.env.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
FRAMNA_DOCS_BASE_URL=http://localhost:3000
21
FRAMNA_DOCS_TITLE=Framna Docs
32
FRAMNA_DOCS_DESCRIPTION=Documentation for Framna's APIs
43
FRAMNA_DOCS_HELP_URL=https://github.com/shapehq/framna-docs/wiki
54
FRAMNA_DOCS_PROJECT_CONFIGURATION_FILENAME=.shape-docs.yml
6-
NEXTAUTH_URL_INTERNAL=http://localhost:3000
5+
NEXTAUTH_URL=https://docs.example.com
76
NEXTAUTH_SECRET=use [openssl rand -base64 32] to generate a 32 bytes value
87
REDIS_URL=localhost
98
POSTGRESQL_HOST=localhost

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<div align="center">
66
<h3>👋 Welcome to Framna Docs</h3>
7-
<h4>Self-hosted web portal that collects OpenAPI documentation and facilitates spec-driven development, built with GitHub-based authorization.</h4>
7+
<h4>Self-hosted web portal that centralizes OpenAPI documentation and facilitates spec-driven development, built with GitHub-based authorization.</h4>
88
</div>
99

1010
<div align="center">

__test__/hooks/FilteringPullRequestEventHandler.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ test("It calls pullRequestOpened(_:) when event is included", async () => {
1717
}
1818
})
1919
await sut.pullRequestOpened({
20+
hostURL: "https://localhost:3000",
2021
appInstallationId: 1234,
2122
pullRequestNumber: 42,
2223
repositoryName: "demo-openapi",
@@ -43,6 +44,7 @@ test("It calls pullRequestReopened(_:) when event is included", async () => {
4344
}
4445
})
4546
await sut.pullRequestReopened({
47+
hostURL: "https://localhost:3000",
4648
appInstallationId: 1234,
4749
pullRequestNumber: 42,
4850
repositoryName: "demo-openapi",
@@ -69,6 +71,7 @@ test("It calls pullRequestSynchronized(_:) when event is included", async () =>
6971
}
7072
})
7173
await sut.pullRequestSynchronized({
74+
hostURL: "https://localhost:3000",
7275
appInstallationId: 1234,
7376
pullRequestNumber: 42,
7477
repositoryName: "demo-openapi",
@@ -95,6 +98,7 @@ test("It skips calling pullRequestOpened(_:) when event is not included", async
9598
}
9699
})
97100
await sut.pullRequestOpened({
101+
hostURL: "https://localhost:3000",
98102
appInstallationId: 1234,
99103
pullRequestNumber: 42,
100104
repositoryName: "demo-openapi",
@@ -121,6 +125,7 @@ test("It skips calling pullRequestReopened(_:) when event is not included", asyn
121125
}
122126
})
123127
await sut.pullRequestReopened({
128+
hostURL: "https://localhost:3000",
124129
appInstallationId: 1234,
125130
pullRequestNumber: 42,
126131
repositoryName: "demo-openapi",
@@ -147,6 +152,7 @@ test("It skips calling pullRequestSynchronized(_:) when event is not included",
147152
}
148153
})
149154
await sut.pullRequestSynchronized({
155+
hostURL: "https://localhost:3000",
150156
appInstallationId: 1234,
151157
pullRequestNumber: 42,
152158
repositoryName: "demo-openapi",

__test__/hooks/PostCommentPullRequestEventHandler.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test("It comments when opening a pull request", async () => {
1010
}
1111
})
1212
await sut.pullRequestOpened({
13+
hostURL: "https://localhost:3000",
1314
appInstallationId: 1234,
1415
pullRequestNumber: 42,
1516
repositoryOwner: "acme",
@@ -29,6 +30,7 @@ test("It comments when reopening a pull request", async () => {
2930
}
3031
})
3132
await sut.pullRequestReopened({
33+
hostURL: "https://localhost:3000",
3234
appInstallationId: 1234,
3335
pullRequestNumber: 42,
3436
repositoryOwner: "acme",
@@ -48,6 +50,7 @@ test("It comments when synchronizing a pull request", async () => {
4850
}
4951
})
5052
await sut.pullRequestSynchronized({
53+
hostURL: "https://localhost:3000",
5154
appInstallationId: 1234,
5255
pullRequestNumber: 42,
5356
repositoryOwner: "acme",

__test__/hooks/PullRequestCommenter.test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { PullRequestCommenter } from "@/features/hooks/domain"
33
test("It adds comment when none exist", async () => {
44
let didAddComment = false
55
const sut = new PullRequestCommenter({
6-
domain: "https://example.com",
76
siteName: "Demo Docs",
87
repositoryNameSuffix: "-openapi",
98
projectConfigurationFilename: ".demo-docs.yml",
@@ -31,6 +30,7 @@ test("It adds comment when none exist", async () => {
3130
}
3231
})
3332
await sut.commentPullRequest({
33+
hostURL: "https://localhost:3000",
3434
appInstallationId: 1234,
3535
pullRequestNumber: 42,
3636
repositoryOwner: "acme",
@@ -44,7 +44,6 @@ test("It adds comment containing list of changed files", async () => {
4444
let didAddComment = false
4545
let commentBody: string | undefined
4646
const sut = new PullRequestCommenter({
47-
domain: "https://example.com",
4847
siteName: "Demo Docs",
4948
repositoryNameSuffix: "-openapi",
5049
projectConfigurationFilename: ".demo-docs.yml",
@@ -76,6 +75,7 @@ test("It adds comment containing list of changed files", async () => {
7675
}
7776
})
7877
await sut.commentPullRequest({
78+
hostURL: "https://localhost:3000",
7979
appInstallationId: 1234,
8080
pullRequestNumber: 42,
8181
repositoryOwner: "acme",
@@ -91,7 +91,6 @@ test("It adds comment containing list of changed files", async () => {
9191
test("It skips adding comment when no YAML files were found in the PR", async () => {
9292
let didAddComment = false
9393
const sut = new PullRequestCommenter({
94-
domain: "https://example.com",
9594
siteName: "Demo Docs",
9695
repositoryNameSuffix: "-openapi",
9796
projectConfigurationFilename: ".demo-docs.yml",
@@ -119,6 +118,7 @@ test("It skips adding comment when no YAML files were found in the PR", async ()
119118
}
120119
})
121120
await sut.commentPullRequest({
121+
hostURL: "https://localhost:3000",
122122
appInstallationId: 1234,
123123
pullRequestNumber: 42,
124124
repositoryOwner: "acme",
@@ -131,7 +131,6 @@ test("It skips adding comment when no YAML files were found in the PR", async ()
131131
test("It updates comment when one already exists", async () => {
132132
let didUpdateComment = false
133133
const sut = new PullRequestCommenter({
134-
domain: "https://example.com",
135134
siteName: "Demo Docs",
136135
repositoryNameSuffix: "-openapi",
137136
projectConfigurationFilename: ".demo-docs.yml",
@@ -166,6 +165,7 @@ test("It updates comment when one already exists", async () => {
166165
}
167166
})
168167
await sut.commentPullRequest({
168+
hostURL: "https://localhost:3000",
169169
appInstallationId: 1234,
170170
pullRequestNumber: 42,
171171
repositoryOwner: "acme",
@@ -179,7 +179,6 @@ test("It skips updating comment when the body has not changed", async () => {
179179
let addedCommentBody: string | undefined
180180
let didUpdateComment = false
181181
const sut = new PullRequestCommenter({
182-
domain: "https://example.com",
183182
siteName: "Demo Docs",
184183
repositoryNameSuffix: "-openapi",
185184
projectConfigurationFilename: ".demo-docs.yml",
@@ -220,6 +219,7 @@ test("It skips updating comment when the body has not changed", async () => {
220219
})
221220
// Add a comment.
222221
await sut.commentPullRequest({
222+
hostURL: "https://localhost:3000",
223223
appInstallationId: 1234,
224224
pullRequestNumber: 42,
225225
repositoryOwner: "acme",
@@ -228,6 +228,7 @@ test("It skips updating comment when the body has not changed", async () => {
228228
})
229229
// Attempt to update a comment. This is skipped because the body has not changed.
230230
await sut.commentPullRequest({
231+
hostURL: "https://localhost:3000",
231232
appInstallationId: 1234,
232233
pullRequestNumber: 42,
233234
repositoryOwner: "acme",
@@ -244,7 +245,6 @@ test("It updates comment to remove file list when all relevant file changes were
244245
let addedCommentBody: string | undefined
245246
let updatedCommentBody: string | undefined
246247
const sut = new PullRequestCommenter({
247-
domain: "https://example.com",
248248
siteName: "Demo Docs",
249249
repositoryNameSuffix: "-openapi",
250250
projectConfigurationFilename: ".demo-docs.yml",
@@ -292,6 +292,7 @@ test("It updates comment to remove file list when all relevant file changes were
292292
})
293293
// Add a comment.
294294
await sut.commentPullRequest({
295+
hostURL: "https://localhost:3000",
295296
appInstallationId: 1234,
296297
pullRequestNumber: 42,
297298
repositoryOwner: "acme",
@@ -300,6 +301,7 @@ test("It updates comment to remove file list when all relevant file changes were
300301
})
301302
// Attempt to update a comment. This is skipped because the body has not changed.
302303
await sut.commentPullRequest({
304+
hostURL: "https://localhost:3000",
303305
appInstallationId: 1234,
304306
pullRequestNumber: 42,
305307
repositoryOwner: "acme",
@@ -318,7 +320,6 @@ test("It adds comment if only project configuration was edited", async () => {
318320
let didAddComment = false
319321
let commentBody: string | undefined
320322
const sut = new PullRequestCommenter({
321-
domain: "https://example.com",
322323
siteName: "Demo Docs",
323324
repositoryNameSuffix: "-openapi",
324325
projectConfigurationFilename: ".demo-docs.yml",
@@ -357,6 +358,7 @@ test("It adds comment if only project configuration was edited", async () => {
357358
}
358359
})
359360
await sut.commentPullRequest({
361+
hostURL: "https://localhost:3000",
360362
appInstallationId: 1234,
361363
pullRequestNumber: 42,
362364
repositoryOwner: "acme",
@@ -372,7 +374,6 @@ test("It ignores files starting with a dot", async () => {
372374
let didAddComment = false
373375
let commentBody: string | undefined
374376
const sut = new PullRequestCommenter({
375-
domain: "https://example.com",
376377
siteName: "Demo Docs",
377378
repositoryNameSuffix: "-openapi",
378379
projectConfigurationFilename: ".demo-docs.yml",
@@ -404,6 +405,7 @@ test("It ignores files starting with a dot", async () => {
404405
}
405406
})
406407
await sut.commentPullRequest({
408+
hostURL: "https://localhost:3000",
407409
appInstallationId: 1234,
408410
pullRequestNumber: 42,
409411
repositoryOwner: "acme",
@@ -420,7 +422,6 @@ test("It ignores files in directories", async () => {
420422
let didAddComment = false
421423
let commentBody: string | undefined
422424
const sut = new PullRequestCommenter({
423-
domain: "https://example.com",
424425
siteName: "Demo Docs",
425426
repositoryNameSuffix: "-openapi",
426427
projectConfigurationFilename: ".demo-docs.yml",
@@ -452,6 +453,7 @@ test("It ignores files in directories", async () => {
452453
}
453454
})
454455
await sut.commentPullRequest({
456+
hostURL: "https://localhost:3000",
455457
appInstallationId: 1234,
456458
pullRequestNumber: 42,
457459
repositoryOwner: "acme",
@@ -467,7 +469,6 @@ test("It ignores files in directories", async () => {
467469
test("It does not post comment if changes only include ignored filenames", async () => {
468470
let didAddComment = false
469471
const sut = new PullRequestCommenter({
470-
domain: "https://example.com",
471472
siteName: "Demo Docs",
472473
repositoryNameSuffix: "-openapi",
473474
projectConfigurationFilename: ".demo-docs.yml",
@@ -498,6 +499,7 @@ test("It does not post comment if changes only include ignored filenames", async
498499
}
499500
})
500501
await sut.commentPullRequest({
502+
hostURL: "https://localhost:3000",
501503
appInstallationId: 1234,
502504
pullRequestNumber: 42,
503505
repositoryOwner: "acme",

0 commit comments

Comments
 (0)