Skip to content

Commit

Permalink
add prebuildDefaultBranchOnly to Project.settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Sep 14, 2023
1 parent aa51d6c commit e5c8e3a
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 88 deletions.
1 change: 1 addition & 0 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@ type Project struct {

type ProjectSettings struct {
EnablePrebuilds bool `json:"enablePrebuilds,omitempty"`
PrebuildDefaultBranchOnly bool `json:"prebuildDefaultBranchOnly,omitempty"`
UseIncrementalPrebuilds bool `json:"useIncrementalPrebuilds,omitempty"`
UsePersistentVolumeClaim bool `json:"usePersistentVolumeClaim,omitempty"`
KeepOutdatedPrebuildsRunning bool `json:"keepOutdatedPrebuildsRunning,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions components/gitpod-protocol/src/teams-projects-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export interface ProjectConfig {

export interface ProjectSettings {
enablePrebuilds?: boolean;
/**
* Wether prebuilds (if enabled) should only be started on the default branch.
* Defaults to `true` on project creation.
*/
prebuildDefaultBranchOnly?: boolean;
useIncrementalPrebuilds?: boolean;
keepOutdatedPrebuildsRunning?: boolean;
// whether new workspaces can start on older prebuilds and incrementally update
Expand Down
1 change: 1 addition & 0 deletions components/public-api-server/pkg/apiv1/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func projectSettingsToAPIResponse(s *protocol.ProjectSettings) *v1.ProjectSettin
return &v1.ProjectSettings{
Prebuild: &v1.PrebuildSettings{
EnablePrebuilds: s.EnablePrebuilds,
PrebuildDefaultBranchOnly: s.PrebuildDefaultBranchOnly,
EnableIncrementalPrebuilds: s.UseIncrementalPrebuilds,
KeepOutdatedPrebuildsRunning: s.KeepOutdatedPrebuildsRunning,
UsePreviousPrebuilds: s.AllowUsingPreviousPrebuilds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ message PrebuildSettings {
bool use_previous_prebuilds = 3;
int32 prebuild_every_nth = 4;
bool enable_prebuilds = 5;
bool prebuild_default_branch_only = 6;
}

message WorkspaceSettings {
Expand Down
188 changes: 100 additions & 88 deletions components/public-api/go/experimental/v1/projects.pb.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/server/src/projects/projects-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { ScmService } from "./scm-service";
export class ProjectsService {
public static PROJECT_SETTINGS_DEFAULTS: ProjectSettings = {
enablePrebuilds: false,
prebuildDefaultBranchOnly: true,
};

constructor(
Expand Down

0 comments on commit e5c8e3a

Please sign in to comment.