Skip to content

Commit 7db919e

Browse files
committed
Update README with Azure DevOps documentation
Add provider configuration section explaining how to use either GitHub or Azure DevOps as the project source provider.
1 parent a0346ef commit 7db919e

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

README.md

Lines changed: 31 additions & 3 deletions
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 centralizes 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, with support for GitHub and Azure DevOps.</h4>
88
</div>
99

1010
<div align="center">
@@ -54,16 +54,44 @@ brew install oasdiff
5454

5555
## 👨‍🔧 How does it work?
5656

57-
Framna Docs uses [OpenAPI specifications](https://swagger.io) from GitHub repositories. Users log in with their GitHub account to access documentation for projects they have access to. A repository only needs an OpenAPI spec to be recognized by Framna Docs, but customization is possible with a .framna-docs.yml file. Here's an example:
57+
Framna Docs uses [OpenAPI specifications](https://swagger.io) from GitHub or Azure DevOps repositories. Users log in with their GitHub or Microsoft Entra ID account (depending on the configured provider) to access documentation for projects they have access to. A repository only needs an OpenAPI spec to be recognized by Framna Docs, but customization is possible with a .framna-docs.yml file. Here's an example:
5858

5959
<img width="650" src="https://github.com/shapehq/framna-docs/raw/main/wiki/example-openapi-repository-with-config.png?raw=true"/>
6060

61-
Framna Docs supports spec-driven development by requiring OpenAPI specs in GitHub repos, ensuring version control and peer review. When a pull request is opened, Framna Docs comments with links to preview the documentation:
61+
Framna Docs supports spec-driven development by requiring OpenAPI specs in version-controlled repositories, ensuring peer review. When using GitHub, Framna Docs comments on pull requests with links to preview the documentation:
6262

6363
<img width="760" src="https://github.com/shapehq/framna-docs/raw/main/wiki/pr-comment.png?raw=true"/>
6464

6565
Learn more from the [Adding Documentation](https://github.com/shapehq/framna-docs/wiki/Adding-Documentation-to-Framna-Docs), [Browsing Documentation](https://github.com/shapehq/framna-docs/wiki/Browsing-Documentation), and [Updating Documentation](https://github.com/shapehq/framna-docs/wiki/Updating-Documentation) articles in the wiki.
6666

67+
### Provider Configuration
68+
69+
Framna Docs supports two project source providers: **GitHub** (default) and **Azure DevOps**. Set the `PROJECT_SOURCE_PROVIDER` environment variable to choose your provider.
70+
71+
#### GitHub (default)
72+
73+
```bash
74+
PROJECT_SOURCE_PROVIDER=github
75+
GITHUB_CLIENT_ID=...
76+
GITHUB_CLIENT_SECRET=...
77+
GITHUB_APP_ID=...
78+
GITHUB_PRIVATE_KEY_BASE_64=...
79+
```
80+
81+
#### Azure DevOps
82+
83+
Azure DevOps uses Microsoft Entra ID (formerly Azure AD) for authentication:
84+
85+
```bash
86+
PROJECT_SOURCE_PROVIDER=azure-devops
87+
AZURE_ENTRA_ID_CLIENT_ID=...
88+
AZURE_ENTRA_ID_CLIENT_SECRET=...
89+
AZURE_ENTRA_ID_TENANT_ID=...
90+
AZURE_DEVOPS_ORGANIZATION=your-organization
91+
```
92+
93+
See `.env.example` for a full list of configuration options.
94+
6795
## 👩‍💻 How can I contribute?
6896

6997
Pull requests with bugfixes and new features are much appreciated. We are happy to review PRs and merge them once they are ready, as long as they contain changes that fit within the vision of Framna Docs.

src/app/api/diff/[owner]/[repository]/[...path]/route.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ export async function GET(req: NextRequest, { params }: { params: Promise<GetDif
1414
return makeUnauthenticatedAPIErrorResponse()
1515
}
1616

17+
if (!diffCalculator) {
18+
return NextResponse.json(
19+
{ error: "Diff calculation is not available for this provider" },
20+
{ status: 501 }
21+
)
22+
}
23+
1724
const { path: paramsPath, owner, repository } = await params
1825
const path = paramsPath.join("/")
1926

src/composition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export const gitHubHookHandler = isGitHubProvider && gitHubClient ? new GitHubHo
343343
})
344344
})
345345
})
346-
) : null
346+
}) : null
347347

348348
// Diff calculator only available for GitHub provider (requires GitHub-specific APIs)
349349
export const diffCalculator: IOasDiffCalculator | null = gitHubClient

src/features/projects/data/AzureDevOpsRepositoryDataSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default class AzureDevOpsRepositoryDataSource implements IAzureDevOpsRepo
116116
const path = `${this.projectConfigurationFilename}${extension}`
117117
const content = await this.client.getFileContent(repositoryId, path, branchName)
118118

119-
if (content) {
119+
if (content && typeof content === "string") {
120120
return { text: content }
121121
}
122122
return undefined

0 commit comments

Comments
 (0)