Skip to content
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

Gitea support #8131

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into gitea
  • Loading branch information
anbraten committed Mar 10, 2022
commit 45fec6166935c8839a33182fb16ba6d98b4d40a9
33 changes: 18 additions & 15 deletions components/server/ee/src/auth/host-container-mapping.ts
Original file line number Diff line number Diff line change
@@ -9,24 +9,27 @@ import { HostContainerMapping } from "../../../src/auth/host-container-mapping";
import { gitlabContainerModuleEE } from "../gitlab/container-module";
import { bitbucketContainerModuleEE } from "../bitbucket/container-module";
import { giteaContainerModuleEE } from "../gitea/container-module";
import { gitHubContainerModuleEE } from "../github/container-module";

@injectable()
export class HostContainerMappingEE extends HostContainerMapping {
public get(type: string): interfaces.ContainerModule[] | undefined {
let modules = super.get(type) || [];
public get(type: string): interfaces.ContainerModule[] | undefined {
let modules = super.get(type) || [];

switch (type) {
case "GitLab":
return (modules || []).concat([gitlabContainerModuleEE]);
case "Bitbucket":
return (modules || []).concat([bitbucketContainerModuleEE]);
case "Gitea":
return (modules || []).concat([giteaContainerModuleEE]);
// case "BitbucketServer":
// FIXME
// return (modules || []).concat([bitbucketContainerModuleEE]);
default:
return modules;
switch (type) {
case "GitLab":
return (modules || []).concat([gitlabContainerModuleEE]);
case "Bitbucket":
return (modules || []).concat([bitbucketContainerModuleEE]);
// case "BitbucketServer":
// FIXME
// return (modules || []).concat([bitbucketContainerModuleEE]);
case "GitHub":
return (modules || []).concat([gitHubContainerModuleEE]);
case "Gitea":
return (modules || []).concat([giteaContainerModuleEE]);
default:
return modules;
}
}
}
}
1 change: 1 addition & 0 deletions components/server/ee/src/container-module.ts
Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@ export const productionEEContainerModule = new ContainerModule((bind, unbind, is
bind(BitbucketAppSupport).toSelf().inSingletonScope();
bind(GiteaApp).toSelf().inSingletonScope();
bind(GiteaAppSupport).toSelf().inSingletonScope();
bind(GitHubEnterpriseApp).toSelf().inSingletonScope();

bind(LicenseEvaluator).toSelf().inSingletonScope();
bind(LicenseKeySource).to(DBLicenseKeySource).inSingletonScope();
2 changes: 1 addition & 1 deletion components/server/src/projects/projects-service.ts
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ export class ProjectsService {
const hostContext = parsedUrl?.host ? this.hostContextProvider.get(parsedUrl?.host) : undefined;
const type = hostContext && hostContext.authProvider.info.authProviderType;
// TODO: handle gitea
if (type === "GitLab" || type === "Bitbucket") {
if (type !== "github.com") {
const repositoryService = hostContext?.services?.repositoryService;
if (repositoryService) {
// Note: For GitLab, we expect .canInstallAutomatedPrebuilds() to always return true, because earlier
You are viewing a condensed version of this merge commit. You can view the full changes here.